<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/a8ed8d1a868a5156704a0abad0eb512ec37cd652">https://github.com/macports/macports-ports/commit/a8ed8d1a868a5156704a0abad0eb512ec37cd652</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a8ed8d1a868a5156704a0abad0eb512ec37cd652
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Sat May 25 17:57:11 2019 +0100
<span style='display:block; white-space:pre;color:#404040;'> cctools: Decouple clang versions search for by 'as' at runtime from llvm variant version
</span>---
devel/cctools/Portfile | 24 ++++++++++++++++++++++--
devel/cctools/files/as-try-clang.patch | 30 +++++++++++++++++++-----------
2 files changed, 41 insertions(+), 13 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cctools/Portfile b/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index a463e7f..27b6348 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6,7 +6,7 @@ name cctools
</span> # Xcode 10.0
version 921
set ld64_version 409.12
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span> categories devel
platforms darwin
maintainers {jeremyhu @jeremyhu} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -140,9 +140,29 @@ post-patch {
</span> reinplace "s:\"llvm-objdump\":\"llvm-objdump-mp-${llvm_version}\":" ${worksrcpath}/otool/main.c
reinplace "s:\"llvm-mc\":\"llvm-mc-mp-${llvm_version}\":" ${worksrcpath}/as/driver.c
reinplace "s:@@LLVM_LIBDIR@@:${prefix}/libexec/llvm-${llvm_version}/lib:" ${worksrcpath}/libstuff/lto.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>- reinplace "s:__MP_CLANG_NAME__:clang-mp-${llvm_version}:" ${worksrcpath}/as/driver.c
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # List of clang versions to search for at runtime internally by 'as'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Build list from llvm variants, excluding clang < 5 and devel version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # (unless devel variant is used in which case it is included first)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set as_comps ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach variantname ${all_llvm_variants} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ver $llvm_variant_version($variantname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Use all non-devel and clang > 4 versions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${ver} ne "devel" && ${ver} > 4.999 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${as_comps} ne "" } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set as_comps ",${as_comps}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set as_comps "\"clang-mp-${ver}\"${as_comps}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If llvmdev variant is active, include at start of list
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[variant_isset llvmdev]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set as_comps "\"clang-mp-devel\",${as_comps}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "as compiler list ${as_comps}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s:__MP_CLANG_NAMES__:${as_comps}:" ${worksrcpath}/as/driver.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {${os.major} >= 11} {
set try_system_clang 1
} else {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cctools/files/as-try-clang.patch b/devel/cctools/files/as-try-clang.patch
</span><span style='display:block; white-space:pre;color:#808080;'>index 22ee4de..9e2216c 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/cctools/files/as-try-clang.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cctools/files/as-try-clang.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,6 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- as/driver.c.orig 2018-09-19 08:01:56.000000000 +1000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ as/driver.c 2019-01-25 01:35:21.000000000 +1100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -295,11 +295,18 @@ char **envp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- as/driver.c.orig 2019-05-25 16:26:59.000000000 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ as/driver.c 2019-05-25 16:49:42.000000000 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -295,11 +295,26 @@
</span> arch_flag.cputype == CPU_TYPE_ARM64 ||
arch_flag.cputype == CPU_TYPE_ARM64_32 ||
arch_flag.cputype == CPU_TYPE_ARM)){
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,22 +9,30 @@
</span> - printf("%s: assembler (%s) not installed\n", progname, as);
- exit(1);
- }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ as = makestr(prefix, "__MP_CLANG_NAME__", NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if(access(as, F_OK) != 0){
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char * mp_comps[] = { __MP_CLANG_NAMES__ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const size_t n_comps = sizeof(mp_comps) / sizeof(mp_comps[0]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for ( size_t i = 0; i < n_comps; ++i ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ as = makestr(prefix, mp_comps[i], NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(access(as, F_OK) == 0){
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // found working compiler so break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ as = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span> +#if __TRY_SYSTEM_CLANG__
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( as == NULL ) {
</span> + as = "/usr/bin/clang";
+ if(access(as, F_OK) != 0){
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ as = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ as = NULL;
</span> + }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ as = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span> +#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (as != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (as != NULL) {
</span> new_argv = allocate((argc + 8) * sizeof(char *));
new_argv[0] = as;
j = 1;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -360,6 +367,7 @@ char **envp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -360,6 +375,7 @@
</span> exit(0);
else
exit(1);
</pre><pre style='margin:0'>
</pre>