This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A problem of multilib build


Hi All,

I have just joined this group for asking one question of the binutils
multilib build.

I am trying to build  binutils in my Ubuntu system. I don't want to
make effect to the main system so I am going to install it in a
separate  directory by applying the option --libdir=/tools/lib64.
Everything is OK except the libiberty. Unlike other libs included in
binutils, it installed in /tools/lib directory rather than
/tools/lib64

I have track this problem for a while. It seems that the libiberty
depends on the option '--print-multi-os-directory' of C compiler to
detect the install directory. Unfortunately, the Ubuntu version of gcc
outputs '/lib' for this option rather than 'lib64'. I have searched
this option through out the binutils, I found that only the libiberty
is using this option in a special way.

this is the output of command `grep -r "\-multi\-os" .` on the
binutils-2.18 directory:

./gprof/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`
 ./gas/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`
./opcodes/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`
 ./ld/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`
./bfd/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`
 ./binutils/configure:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS
$LDFLAGS -print-multi-os-directory 2>/dev/null`
./libiberty/Makefile.in:MULTIOSDIR = `$(CC) $(LIBCFLAGS)
-print-multi-os-directory`
./libiberty/ChangeLog:    /`$$CC -print-multi-os-directory`.
 ./libtool.m4:  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS
-print-multi-os-directory 2>/dev/null`

Yes, this problem is easy to walk around. However, I think there
should be a more consistent  way to do the job.

My suggestion is:

1. Add a --multilib="32,64" to configure script for setting the
libprefix to /lib32(for 32 bit) and /lib64(for 64 bit)
2. Allow automatic generation for 32 bit binutils libs if multilib
environment is detected
 3. Add a option to ld to detect the configuration of multilib rather
than use cc to do this job. e.g. ld --print-multi-os-directory should
print the multilib configuration. this is suggested because the
binutils is the first component of the toolchain, some impotent
configurations like multilib  should be maintain by binutils rather
than gcc.

I am a C/C++ programer. However I am not familiar with the Makefile.
Actually, the Build System of binutils is quite complex for me. I can
do this job but I need some guideline for the understanding of the
build system.

At the beginning, who can tell me how to and a new option to configure.ac?

Regards,

Joe Ren



-- 
 不 矢口 亻十 幺 日寸 候,亻奄 口斤 言兑 言仑 土云 有 辶寸 氵虑 白勺 言兑 氵去,于 是,亻奄 学 会 了 扌斥 字 。

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]