Message ID | 514211D0.8020407@ubuntu.com |
---|---|
State | New |
Headers | show |
On Fri, Mar 15, 2013 at 02:07:12AM +0800, Matthias Klose wrote: > sorry, didn't comment about this patch because it didn't seem to affect > multiarch. However this patch assumes that every system does have at least a > */lib64 symlink, if it doesn't have a */lib64 directory. I think that is a > wrong assumption. Things like Why do you think the patch assumes it? And why do you care for multiarch? It just adjusts where the libraries are searched. In a cross, I see (for non-multiarch): grep '^ \$ \.\.' ../config.log; strace -v -s1024 ./xgcc -B ./ -print-file-name=libc.so 2>&1 | grep access.*libc.so $ ../configure --target aarch64-linux --enable-languages=c,c++ access("./aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("./libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa/gcc/../lib/gcc/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/../lib64/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/libc.so", R_OK) = -1 ENOENT (No such file or directory) for multiarch: grep '^ \$ \.\.' ../config.log; strace -v -s1024 ./xgcc -B ./ -print-file-name=libc.so 2>&1 | grep access.*libc.so $ ../configure --target aarch64-linux --enable-languages=c,c++ --enable-multiarch access("./aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("./aarch64-linux-gnu/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("./libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux-gnu/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/aarch64-linux/4.8.0/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/aarch64-linux-gnu/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/../lib64/libc.so", R_OK) = -1 ENOENT (No such file or directory) access("/usr/src/gcc/objaa2/gcc/../lib/gcc/aarch64-linux/4.8.0/../../../../aarch64-linux/lib/libc.so", R_OK) = -1 ENOENT (No such file or directory) as you can see, if lib64 paths don't exist, it just goes on to look in */lib (like it does on x86_64 etc). And, for multiarch, it looks first in multiarch directories. Checking for lib64 directory or symlink is what I'd prefer to avoid. Jakub
Index: gcc/config/aarch64/t-aarch64-linux =================================================================== --- gcc/config/aarch64/t-aarch64-linux (revision 196661) +++ gcc/config/aarch64/t-aarch64-linux (working copy) @@ -22,4 +22,4 @@ LIB1ASMFUNCS = _aarch64_sync_cache_range AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) -MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) +MULTILIB_OSDIRNAMES = .=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib64),../lib64,../lib)$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)