#49273: clang-mp-3.7 and MACOSX_DEPLOYMENT_TARGET=10.3 do not mix --------------------+-------------------------------- Reporter: jhi@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: clang --------------------+-------------------------------- I have the latest macports clang 3.7 on the latest Yosemite or 10.10 (not yet El Capitan or 10.11), and the XCode 7.0.1 Command Line Tools installed. Originally this failure came from trying to compile Perl, but I managed to reduce it to simply to the below-demonstrated problem, no Perl source needed: the macports clang doesn't work with the MACOSX_DEPLOYMENT_TARGET (https://developer.apple.com/library/mac/documentation/DeveloperTools/Concept...) as opposed to the system clang, or the macports clang with**OUT** the MACOSX_DEPLOYMENT_TARGET. I also show below the find outputs for the libgcc_s both in the XCode and under /opt/local/lib {{{ % cat main.c int main() { return 0; } % env MACOSX_DEPLOYMENT_TARGET=10.3 clang-mp-3.7 -o main main.c ld: library not found for -lgcc_s.10.4 clang: error: linker command failed with exit code 1 (use -v to see invocation) % env MACOSX_DEPLOYMENT_TARGET=10.3 /usr/bin/clang -o main main.c % env clang-mp-3.7 -o main main.c % clang-mp-3.7 -v clang version 3.7.0 (tags/RELEASE_370/final) Target: x86_64-apple-darwin14.5.0 % /usr/bin/clang -v Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin14.5.0 Thread model: posix % env MACOSX_DEPLOYMENT_TARGET=10.3 clang-mp-3.7 -v -o main main.c clang version 3.7.0 (tags/RELEASE_370/final) Target: x86_64-apple-darwin14.5.0 Thread model: posix "/opt/local/libexec/llvm-3.7/bin/clang" -cc1 -triple x86_64-apple- macosx10.3.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name main.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 242 -v -dwarf-column-info -resource-dir /opt/local/libexec/llvm-3.7/bin/../lib/clang/3.7.0 -fdebug-compilation-dir /Users/jhi -ferror-limit 19 -fmessage-length 80 -mstackrealign -fblocks -fblocks-runtime-optional -fobjc-runtime=macosx-10.3.0 -fobjc-dispatch- method=non-legacy -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/yg/hdcrkqfx5cgc80b9zgbhnw_h0000gn/T/main-86350b.o -x c main.c clang -cc1 version 3.7.0 based upon LLVM 3.7.0 default target x86_64 -apple-darwin14.5.0 #include "..." search starts here: #include <...> search starts here: /usr/local/include /opt/local/libexec/llvm-3.7/bin/../lib/clang/3.7.0/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. "/opt/local/libexec/llvm-3.7/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.3.0 -o main -lcrt1.o /var/folders/yg/hdcrkqfx5cgc80b9zgbhnw_h0000gn/T/main-86350b.o -lSystem -lgcc_s.10.4 /opt/local/libexec/llvm-3.7/bin/../lib/clang/3.7.0/lib/darwin/libclang_rt.10.4.a ld: library not found for -lgcc_s.10.4 clang: error: linker command failed with exit code 1 (use -v to see invocation) % find /Applications/Xcode.app -name 'libgcc_s*' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libgcc_s.1.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libgcc_s.1.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libgcc_s.10.4.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libgcc_s.10.5.tbd % find /opt/local/lib -name 'libgcc_s*' /opt/local/lib/gcc43/libgcc_s.1.dylib /opt/local/lib/gcc43/libgcc_s.10.4.dylib /opt/local/lib/gcc43/libgcc_s.10.5.dylib /opt/local/lib/gcc43/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc43/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc44/libgcc_s.1.dylib /opt/local/lib/gcc44/libgcc_s.10.4.dylib /opt/local/lib/gcc44/libgcc_s.10.5.dylib /opt/local/lib/gcc44/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc44/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc45/libgcc_s.1.dylib /opt/local/lib/gcc45/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc45/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc46/libgcc_s.1.dylib /opt/local/lib/gcc46/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc46/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc47/libgcc_s.1.dylib /opt/local/lib/gcc47/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc47/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc48/libgcc_s.1.dylib /opt/local/lib/gcc48/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc48/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc49/libgcc_s.1.dylib /opt/local/lib/gcc49/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc49/libgcc_s_x86_64.1.dylib /opt/local/lib/gcc5/libgcc_s.1.dylib /opt/local/lib/gcc5/libgcc_s_ppc64.1.dylib /opt/local/lib/gcc5/libgcc_s_x86_64.1.dylib /opt/local/lib/libgcc/libgcc_s.1.dylib % }}} -- Ticket URL: <https://trac.macports.org/ticket/49273> MacPorts <https://www.macports.org/> Ports system for OS X