On Tue, 2008-07-22 at 13:41 +0200, Paolo Bonzini wrote:
> > [EMAIL PROTECTED]:~/tmp$ gnatmake -f -g
> > -aO/home/guerby/build-mlib7/gcc/ada/rts32 -m32 p
>
> I guess this fixing this requires duplicating in gnatmake and gnatbind
> the logic in gcc.c that uses the info produced by genmultilib. Search
> gcc.c for
>
> multilib_raw
> multilib_matches_raw
> multilib_extra
> multilib_exclusions_raw
> multilib_options
> set_multilib_dir
>
> Maybe it makes sense to make a separate .c module for this, so that both
> the driver and gnat{make,bind} can use it.
When I invoke the gcc driver on a C source file:
$ gcc -c -v -m32 toto.c
...
/home/guerby/install-trunk-mlib7/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/cc1
-quiet -v -imultilib 32 -iprefix
/home/guerby/install-trunk-mlib7/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/
toto.c -quiet -dumpbase toto.c -m32 -mtune=generic -auxbase toto -version -o
/tmp/cc6kC8e8.s
...
=> it does add "-imultilib 32" when calling cc1 which if I understand
the logic is the subdirectory matching the multilib flags, it is
computed by set_multilib_dir, and it should match the MULTISUBDIR in
Makefiles when building. Correct me if I'm wrong.
But when I do it on an Ada source file:
$ gcc -c -v -m32 p.adb
...
/home/guerby/install-trunk-mlib7/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/gnat1
-quiet -dumpbase p.adb -m32 -mtune=generic p.adb -o /tmp/ccmqJCN2.s
...
=> this computation and addition of -imultilib is not done and gnat1 is
called without it.
What triggers the passing of -imultilib to a language driver?
Once gcc passes this info to gnat1 it will likely be easy to have
gnatmake/bind/link extract it when needed since those tools
call gcc.
Thanks in advance,
Laurent