[PATCH] Linux header search on Ubuntu 13.04 multiarch

Dmitri Gribenko gribozavr at gmail.com
Sun Feb 17 07:40:41 PST 2013


On Fri, Feb 15, 2013 at 9:50 PM, Sanne Wouda <sanne.wouda at gmail.com> wrote:
> Attached is a patch which fixes the problems on my system. A unittest
> (with the directory structure attached seperately) illustrates the
> problem and shows that it is fixed by the changes in the patch.
>
> If there are any comments on the patch, or if this should be fixed in
> some different way, I will be happy to update it.

Thank you for working on this!

Unfortunately, this patch does not fix -m32, which breaks asan build.

$ cat /tmp/zz.cc
#include <algorithm>

int main() {
}

$ ./bin/clang -m32 /tmp/zz.cc
In file included from /tmp/zz.cc:1:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/algorithm:60:
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/utility:69:10:
fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
         ^
1 error generated.
/usr/bin/ld: cannot find /tmp/zz-8flpaS.o: No such file or directory
clang-3: error: linker command failed with exit code 1 (use -v to see
invocation)

$ ./bin/clang -m32 -### /tmp/zz.cc
clang version 3.3 (trunk 175383)
Target: i386-unknown-linux-gnu
Thread model: posix
 "/home/llvmbb/clang/build-cmake-r+a/bin/clang-3.3" "-cc1" "-triple"
"i386-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "zz.cc" "-mrelocation-model" "static"
"-mdisable-fp-elim" "-fmath-errno" "-masm-verbose"
"-mconstructor-aliases" "-fuse-init-array" "-target-cpu" "pentium4"
"-momit-leaf-frame-pointer" "-resource-dir"
"/home/llvmbb/clang/build-cmake-r+a/bin/../lib/clang/3.3"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu/32"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/32/c++/4.7"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/home/llvmbb/clang/build-cmake-r+a/bin/../lib/clang/3.3/include"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdeprecated-macro" "-fdebug-compilation-dir"
"/home/llvmbb/clang/build-cmake-r+a" "-ferror-limit" "19"
"-fmessage-length" "190" "-mstackrealign" "-fobjc-runtime=gcc"
"-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-backend-option" "-vectorize-loops" "-o"
"/tmp/zz-Uj8Cev.o" "-x" "c++" "/tmp/zz.cc"
 "/usr/bin/ld" "-z" "relro" "--hash-style=gnu" "--build-id"
"--eh-frame-hdr" "-m" "elf_i386" "-dynamic-linker"
"/lib/ld-linux.so.2" "-o" "a.out"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib32/crt1.o"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib32/crti.o"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/32/crtbegin.o"
"-L/usr/lib/gcc/x86_64-linux-gnu/4.7/32"
"-L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib32"
"-L/lib/../lib32" "-L/usr/lib/../lib32"
"-L/usr/lib/x86_64-linux-gnu/../../lib32"
"-L/usr/lib/gcc/x86_64-linux-gnu/4.7"
"-L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../.." "-L/lib" "-L/usr/lib"
"/tmp/zz-Uj8Cev.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
"-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/32/crtend.o"
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib32/crtn.o"

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list