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
15581558 #ifdef TCC_TARGET_PE
15591559 { "impdef", TCC_OPTION_impdef, 0},
15601560 #endif
1561−//#ifdef TCC_TARGET_MACHO
1561+#ifdef TCC_TARGET_MACHO
15621562 { "arch", TCC_OPTION_arch, TCC_OPTION_HAS_ARG },
1563−//#endif
1563+#endif
15641564 { "C", TCC_OPTION_C, 0},
15651565 { NULL, 0, 0 },
15661566 };
@@ -1991,12 +1991,25 @@ reparse: · 424 unmodified lines
19911991 tcc_error("cannot parse %s here", r);
19921992 tool = x;
19931993 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
19942008 case TCC_OPTION_traditional:
19952009 case TCC_OPTION_pedantic:
19962010 case TCC_OPTION_pipe:
19972011 case TCC_OPTION_s:
19982012 case TCC_OPTION_C:
1999− case TCC_OPTION_arch:
20002013 /* ignored */
20012014 break;
20022015 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