History

macOS: if used, -arch option must match target

Christian Jullien committed 5 years ago

Commit e449db51 parent a951dc01 file · +16 −3Browse files

Unified · Split

libtcc.c+16−3
@@ -1558,9 +1558,9 @@ static const TCCOption tcc_options[] = { · 1557 unmodified lines
1558#ifdef TCC_TARGET_PE1558#ifdef TCC_TARGET_PE
1559 { "impdef", TCC_OPTION_impdef, 0},1559 { "impdef", TCC_OPTION_impdef, 0},
1560#endif1560#endif
1561//#ifdef TCC_TARGET_MACHO1561#ifdef TCC_TARGET_MACHO
1562 { "arch", TCC_OPTION_arch, TCC_OPTION_HAS_ARG },1562 { "arch", TCC_OPTION_arch, TCC_OPTION_HAS_ARG },
1563//#endif1563#endif
1564 { "C", TCC_OPTION_C, 0},1564 { "C", TCC_OPTION_C, 0},
1565 { NULL, 0, 0 },1565 { NULL, 0, 0 },
1566};1566};
@@ -1991,12 +1991,25 @@ reparse: · 424 unmodified lines
1991 tcc_error("cannot parse %s here", r);1991 tcc_error("cannot parse %s here", r);
1992 tool = x;1992 tool = x;
1993 break;1993 break;
1994#if defined(TCC_TARGET_MACHO)
1995 case TCC_OPTION_arch:
1996#if defined(TCC_TARGET_X86_64)
1997 if (strcmp(optarg, "x86_64") == 0)
1998 break; /* Ok, arch matches target */
1999#endif
2000#if defined(TCC_TARGET_ARM64)
2001 if (strcmp(optarg, "arm64") == 0)
2002 break; /* Ok, arch matches target */
2003#endif
2004 tcc_error("this compiler does not support %s", optarg);
2005 /* ignored */
2006 break;
2007#endif
1994 case TCC_OPTION_traditional:2008 case TCC_OPTION_traditional:
1995 case TCC_OPTION_pedantic:2009 case TCC_OPTION_pedantic:
1996 case TCC_OPTION_pipe:2010 case TCC_OPTION_pipe:
1997 case TCC_OPTION_s:2011 case TCC_OPTION_s:
1998 case TCC_OPTION_C:2012 case TCC_OPTION_C:
1999 case TCC_OPTION_arch:
2000 /* ignored */2013 /* ignored */
2001 break;2014 break;
2002 default:2015 default:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t