@@ -4,14 +4,11 @@ $(package)_download_path=https://github.com/theuni/cctools-port/archive
44$(package)_file_name =$($(package ) _version) .tar.gz
55$(package)_sha256_hash =a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a
66$(package)_build_subdir =cctools
7-
8- # Updated LLVM toolchain (Ubuntu 18.04)
9- $(package)_clang_version =10.0.0
10- $(package)_clang_download_path =https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package ) _clang_version)
11- $(package)_clang_download_file =clang+llvm-$($(package ) _clang_version) -x86_64-linux-gnu-ubuntu-18.04.tar.xz
12- $(package)_clang_file_name =$($(package ) _clang_download_file)
13- $(package)_clang_sha256_hash =b25f592a0c00686f03e3b7db68ca6dc87418f681f4ead4df4745a01d9be63843
14-
7+ $(package)_clang_version =3.7.1
8+ $(package)_clang_download_path =http://llvm.org/releases/$($(package ) _clang_version)
9+ $(package)_clang_download_file =clang+llvm-$($(package ) _clang_version) -x86_64-linux-gnu-ubuntu-14.04.tar.xz
10+ $(package)_clang_file_name =clang-llvm-$($(package ) _clang_version) -x86_64-linux-gnu-ubuntu-14.04.tar.xz
11+ $(package)_clang_sha256_hash =99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9
1512$(package)_extra_sources =$($(package ) _clang_file_name)
1613
1714define $(package)_fetch_cmds
@@ -24,23 +21,13 @@ define $(package)_extract_cmds
2421 echo "$($(package ) _sha256_hash) $($(package ) _source) " > $($(package ) _extract_dir) /.$($(package ) _file_name) .hash && \
2522 echo "$($(package ) _clang_sha256_hash) $($(package ) _source_dir) /$($(package ) _clang_file_name) " >> $($(package ) _extract_dir) /.$($(package ) _file_name) .hash && \
2623 $(build_SHA256SUM ) -c $($(package ) _extract_dir) /.$($(package ) _file_name) .hash && \
27- \
28- # Extract cctools-port first
29- tar --strip-components=1 -xf $($(package ) _source) && \
30- \
31- # Prepare toolchain dirs
32- mkdir -p toolchain/bin toolchain/lib/clang/$($(package ) _clang_version) /include && \
33- \
34- # Extract LLVM toolchain
24+ mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \
3525 tar --strip-components=1 -C toolchain -xf $($(package ) _source_dir) /$($(package ) _clang_file_name) && \
36- \
37- # Remove bundled libc++abi (conflicts)
3826 rm -f toolchain/lib/libc++abi.so* && \
39- \
40- # Fake dsymutil (not needed during cross-compile)
4127 echo "# !/bin/sh" > toolchain/bin/$(host)-dsymutil && \
4228 echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \
43- chmod +x toolchain/bin/$(host)-dsymutil
29+ chmod +x toolchain/bin/$(host)-dsymutil && \
30+ tar --strip-components=1 -xf $($(package)_source)
4431endef
4532
4633define $(package)_set_vars
5744
5845define $(package)_config_cmds
5946 $($(package ) _autoconf)
60- endedef
47+ endef
6148
6249define $(package)_build_cmds
6350 $(MAKE )
@@ -66,23 +53,29 @@ endef
6653define $(package)_stage_cmds
6754 $(MAKE ) DESTDIR=$($(package ) _staging_dir) install && \
6855 cd $($(package ) _extract_dir) /toolchain && \
69- \
7056 mkdir -p $($(package ) _staging_prefix_dir) /lib/clang/$($(package ) _clang_version) /include && \
7157 mkdir -p $($(package ) _staging_prefix_dir) /bin $($(package ) _staging_prefix_dir) /include && \
72- \
73- cp bin/clang $($(package ) _staging_prefix_dir) /bin/ && \
74- cp -P bin/clang++ $($(package ) _staging_prefix_dir) /bin/ && \
75- \
76- # Copy LLVM libs (conditionally)
77- if [ -f lib/libLTO.so ]; then cp lib/libLTO.so $($(package ) _staging_prefix_dir) /lib/; fi && \
78- if [ -f lib/libRemarks.so ]; then cp lib/libRemarks.so $($(package ) _staging_prefix_dir) /lib/; fi && \
79- \
80- # Copy clang builtin headers
81- cp -rf lib/clang/$($(package ) _clang_version) /include/* \
82- $($(package ) _staging_prefix_dir) /lib/clang/$($(package ) _clang_version) /include/ && \
83- \
58+ cp bin/clang $($(package ) _staging_prefix_dir) /bin/ &&\
59+ cp -P bin/clang++ $($(package ) _staging_prefix_dir) /bin/ &&\
60+ cp lib/libLTO.so $($(package ) _staging_prefix_dir) /lib/ && \
61+ cp -rf lib/clang/$($(package ) _clang_version) /include/* $($(package ) _staging_prefix_dir) /lib/clang/$($(package ) _clang_version) /include/ && \
8462 cp bin/llvm-dsymutil $($(package ) _staging_prefix_dir) /bin/$(host ) -dsymutil && \
85- \
86- if [ -d include/c++/ ]; then cp -rf include/c++/ $($(package ) _staging_prefix_dir) /include/; fi && \
87- if [ -d lib/c++/ ]; then cp -rf lib/c++/ $($(package ) _staging_prefix_dir) /lib/; fi
63+ if `test -d include/c++/`; then cp -rf include/c++/ $($(package ) _staging_prefix_dir) /include/; fi && \
64+ if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package ) _staging_prefix_dir) /lib/; fi
8865endef
66+
67+ # ============================================================
68+ # macOS-only overrides (safe, does NOT affect other platforms)
69+ # ============================================================
70+ ifeq ($(host_os ) ,darwin)
71+
72+ # Force REAL CC and CXX used by configure
73+ CC =$(build_prefix ) /native/bin/clang
74+ CXX =$(build_prefix ) /native/bin/clang++
75+
76+ # Prevent ld64 / clang warnings from breaking the build
77+ CFLAGS+ = -Wno-unused-command-line-argument
78+ CXXFLAGS+ = -Wno-unused-command-line-argument
79+ LDFLAGS+ = -Wno-unused-command-line-argument
80+
81+ endif
0 commit comments