This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
multiarch proposal
- From: Goswin von Brederlow <goswin-v-b at web dot de>
- To: Binutils <binutils at sourceware dot org>
- Date: Thu, 24 Apr 2008 13:41:37 +0200
- Subject: multiarch proposal
Hi,
in Debian there is a group of people that want to support installing
and running binaries from multiple architectures (or ABIs) on the same
system. The most common example would be i386 and x86_64 support on
Debian amd64. But ppc, sparc, s390, mips and mipsel would also benefit
from this feature. But this poses some challenges, one of them being
binutils.
To support multiple architectures or ABIs the same library has to be
installed multiple times, once for each supported architecture or ABI.
Clearly they can't all be in /usr/lib. The existing /usr/lib32 and
/usr/lib64 are also too limited. So some new directories have to be
added. And binutils (ld) will have to search those directories when
linking.
There are two solutions to this problem, both using the gnu tripplet
to create a unique library location for each architecture:
1) Create complectly new multiarch directories:
/lib/i486-linux-gnu/
/lib/x86_64-linux-gnu/
/lib/powerpc-linux-gnu/
/usr/lib/i486-linux-gnu/
/usr/lib/x86_64-linux-gnu/
/usr/lib/powerpc-linux-gnu/
/usr/local/lib/i486-linux-gnu/
/usr/local/lib/x86_64-linux-gnu/
/usr/local/lib/powerpc-linux-gnu/
The TOOL_DIR would be used in genscripts.sh like this:
--- binutils.orig/ld/genscripts.sh 2006-09-11 11:19:00.000000000 +0000
+++ bintuils/ld/genscripts.sh 2006-09-11 11:19:04.000000000 +0000
@@ -173,6 +173,17 @@
*) LIB_PATH2=${LIB_PATH2}:${lib} ;;
esac
fi
+ if ! [ "x${TOOL_LIB}" = "x" ] ; then
+ case ${lib} in
+ *${TOOL_LIB}*) ;; # No multiarch below cross-compile dirs
+ *) # Add multiarch dir for target alias
+ case :${LIB_PATH}: in
+ *:${lib}/${TOOL_LIB}:*) ;;
+ ::) LIB_PATH=${lib}/${TOOL_LIB} ;;
+ *) LIB_PATH=${LIB_PATH}:${lib}/${TOOL_LIB} ;;
+ esac
+ esac
+ fi
done
case :${LIB_PATH}:${LIB_PATH2}: in
2) Reuse the cross-compile directory scheme
/i486-linux-gnu/lib/
/x86_64-linux-gnu/lib/
/powerpc-linux-gnu/lib/
/usr/i486-linux-gnu/lib/
/usr/x86_64-linux-gnu/lib/
/usr/powerpc-linux-gnu/lib/
/usr/local/i486-linux-gnu/lib/
/usr/local/x86_64-linux-gnu/lib/
/usr/local/powerpc-linux-gnu/lib/
Note that only /usr/<tripplet>/lib is currently searched. So this adds
new dirs as well.
Some people feel that the cross-compile scheme pollutes top level
directories.
What do you think about this?
MfG
Goswin