Before this path the default linker script had:
armel:
SEARCH_DIR("/usr/arm-linux-gnueabi/lib");
amd64:
SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); S$
with this patch the search dir is:
armel:
SEARCH_DIR("/usr/arm-linux-gnueabi/lib"); SEARCH_DIR("/lib/arm-linux-gnueabi"); SEARCH_DIR("/usr/lib/arm-linux-gnueabi");
amd64:
SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); S$
I think the correct search path should be:
SEARCH_DIR("/lib/arm-linux-gnueabi"); SEARCH_DIR("/usr/lib/arm-linux-gnueabi");SEARCH_DIR("/usr/arm-linux-gnueabi/lib");
(i.e so multiarch dirs are searched before the 'classic cross-build' path.
This solves the immediate problem that native and cross behaviour are different, but I'm concerned that in fact neither of them are doing it right.
If main has symbols in libhi and libhi has symbols in liblo, but main does not have symbols in liblo, then libhi is a build-dep of main but liblo is not. Liblo is a build-dep of libhi. And binutils should be able to link main without liblo being present.
So far as I can see that's not currently happenning. Unless I am misunderstanding something.
Before this path the default linker script had: DIR("/usr/ arm-linux- gnueabi/ lib"); DIR("/usr/ x86_64- linux-gnu/ lib64") ; SEARCH_ DIR("=/ usr/local/ lib/x86_ 64-linux- gnu"); SEARCH_ DIR("=/ usr/local/ lib64") ; S$
armel:
SEARCH_
amd64:
SEARCH_
with this patch the search dir is: DIR("/usr/ arm-linux- gnueabi/ lib"); SEARCH_ DIR("/lib/ arm-linux- gnueabi" ); SEARCH_ DIR("/usr/ lib/arm- linux-gnueabi" ); DIR("/usr/ x86_64- linux-gnu/ lib64") ; SEARCH_ DIR("=/ usr/local/ lib/x86_ 64-linux- gnu"); SEARCH_ DIR("=/ usr/local/ lib64") ; S$
armel:
SEARCH_
amd64:
SEARCH_
I think the correct search path should be: DIR("/lib/ arm-linux- gnueabi" ); SEARCH_ DIR("/usr/ lib/arm- linux-gnueabi" );SEARCH_ DIR("/usr/ arm-linux- gnueabi/ lib");
SEARCH_
(i.e so multiarch dirs are searched before the 'classic cross-build' path.
This solves the immediate problem that native and cross behaviour are different, but I'm concerned that in fact neither of them are doing it right.
If main has symbols in libhi and libhi has symbols in liblo, but main does not have symbols in liblo, then libhi is a build-dep of main but liblo is not. Liblo is a build-dep of libhi. And binutils should be able to link main without liblo being present.
So far as I can see that's not currently happenning. Unless I am misunderstanding something.