Matthias Klose <[EMAIL PROTECTED]> writes:

> Goswin von Brederlow writes:
>> Matthias Klose <[EMAIL PROTECTED]> writes:
>> 
>> > Goswin von Brederlow writes:
>> >> Hi,
>> >> 
>> >> I believe the gcc source already has a patch for multiarch include and 
>> >> library
>> >> directories but they are deactiveated in rules.defs.
>> >> 
>> >> Can you comment on the functionality of them?
>> >
>> > no, this one is obsolete. removed in svn.
>> >
>> >   Matthias
>> 
>> Obsolete as in gcc already has another fix in svn or bit-rot?
>
> the latter.

I tried to fix the patch but I think it tries to change the wrong
thing.

The old lib/lib32/lib64 biarch directories must remain in gcc's search
list for compatibility reasons and one can't add a second set of
multilib dirs.

Further the directory to use depends not only on the target and
-m64/32/n32 switch, as multilib dirs do, but also on the libc we link
against.

The specs file already has an -mglibc/-muclibc switch to pick the
right dynamic linker and libc to use so I used the same mechanism to
add the multiarch directories. Adding them as -L options is not
perfect, I would have prefered some add_prefix() call, but it is the
only mechanism I could find so far.

Below the changes required for amd64 as example. Other archs and
kernels would need a similar entry.

Index: gcc-4.3-4.3.1/src/gcc/config/i386/linux64.h
===================================================================
--- gcc/config/i386/linux64.h   2008-06-24 22:35:40.000000000 +0200
+++ gcc/config/i386/linux64.h   2008-06-24 22:35:56.000000000 +0200
@@ -72,7 +72,9 @@
       %{rdynamic:-export-dynamic} \
       %{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 
"}} \
       %{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 
"}}} \
-    %{static:-static}}"
+    %{static:-static}} \
+  %{" SPEC_32 ":" 
CHOOSE_DYNAMIC_LINKER("-L/usr/i486-linux-gnu/lib","-L/usr/i486-linux-uclibc/lib")"}
 \
+  %{" SPEC_64 ":" 
CHOOSE_DYNAMIC_LINKER("-L/usr/x86_64-linux-gnu/lib","-L/usr/x86_64-linux-uclibc/lib")"}"
 
 /* Similar to standard Linux, but adding -ffast-math support.  */
 #undef  ENDFILE_SPEC


MfG
        Goswin



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to