(Ubuntu 16.04.1)
By default 16.04.1 clang selects the gcc toolchain for 5.4. Unfortunately, I have a library that requires pre-5.0 ABI and I do not have access to the source, and the developer has not released a new version. I tried to use the -gcc-toolchain option, but I can't get it to work. (ctrbegin.o and crtend.o do not get the correct prefix by reference.)
$ clang++-3.8 -v -print-search-dirs clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.4.0 Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6.0.0 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.0.0 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0 Candidate multilib: .;@m64 Selected multilib: .;@m64 programs: =/usr/bin:/usr/lib/llvm-3.8/bin:/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../x86_64-linux-gnu/bin libraries: =/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu: /lib/x86_64-linux-gnu: /lib/../lib64: /usr/lib/x86_64-linux-gnu: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../..: /usr/lib/llvm-3.8/bin/../lib: /lib: /usr/lib
When I try to specify -gcc-toolchain, clang seems to accept and then completely ignore the value. (The same thing happens with clang ++ - 3.5 on 04.16.1.)
Is this the correct syntax? Please note that library directories are missing at the output.
$ clang++-3.8 -v --gcc-toolchain=/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3 -print-search-dirs clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin programs: =/usr/bin:/usr/lib/llvm-3.8/bin:/..//bin libraries: =/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/llvm-3.8/bin/../lib:/lib:/usr/lib
I tried MANY variations of this theme. (4.9, deleting the relative path, etc.) I tried the -system parameter and the -cxx-isystem parameter. (Both are offered as solutions to similar problems.)
What am I missing? (I hope this is easy, but the dizziness is fine!)
source share