Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The clang integrated assembler is way more up-to-date than the ancient pre-GPLv3 version of gas that is the alternative. The latter doesn't know about newer instructions such as AVX. The as(1) shipped with recent Xcode versions will just run clang behind the scenes under most circumstances for this reason. Our cctools can't actually depend on clang because that would create a circular dependency. So we'll try to run the clang corresponding to the LLVM being used by cctools, and if that isn't present, try the system clang in /usr/bin if we're on an OS version that has a clang with a working integrated assembler. (The ancient gas is still used as a final fallback.) Fixes: https://trac.macports.org/ticket/37846
- Loading branch information
1 parent
57f499f
commit 7aa2ff6
Showing
3 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- as/driver.c.orig 2018-09-19 08:01:56.000000000 +1000 | ||
+++ as/driver.c 2019-01-25 01:35:21.000000000 +1100 | ||
@@ -295,11 +295,18 @@ char **envp) | ||
arch_flag.cputype == CPU_TYPE_ARM64 || | ||
arch_flag.cputype == CPU_TYPE_ARM64_32 || | ||
arch_flag.cputype == CPU_TYPE_ARM)){ | ||
- as = makestr(prefix, CLANG, NULL); | ||
- if(access(as, F_OK) != 0){ | ||
- printf("%s: assembler (%s) not installed\n", progname, as); | ||
- exit(1); | ||
- } | ||
+ as = makestr(prefix, "__MP_CLANG_NAME__", NULL); | ||
+ if(access(as, F_OK) != 0){ | ||
+#if __TRY_SYSTEM_CLANG__ | ||
+ as = "/usr/bin/clang"; | ||
+ if(access(as, F_OK) != 0){ | ||
+ as = NULL; | ||
+ } | ||
+#else | ||
+ as = NULL; | ||
+#endif | ||
+ } | ||
+ if (as != NULL) { | ||
new_argv = allocate((argc + 8) * sizeof(char *)); | ||
new_argv[0] = as; | ||
j = 1; | ||
@@ -360,6 +367,7 @@ char **envp) | ||
exit(0); | ||
else | ||
exit(1); | ||
+ } /* as != NULL */ | ||
} | ||
|
||
/* |
This file was deleted.
Oops, something went wrong.