This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Re: Compiling GCC


Andrew Haley kirjoitti:
Kai Ruottu writes:
> Paulo J. Matos wrote:
> > Probably this is due to the fact that in Gentoo intel core duo follow
> > the amd64 branch, since they are 64 bit processors...
> > Maybe your Gentoo is a "custom" Linux with unstandard conventions?


Oh. My. God. That is so truly screwed I don't know where to begin.
No wonder gcc was confused!
The first thing could be Paulo coming familiar with Gentoo, to investigate what its
'/lib' and '/usr/lib' have now, where those default 64-bit libs are, where the 32-bit libs
used with '-m32' are, where the GCC-version specific stuff should go, into two dirs:
'/usr/lib64/gcc/$target/$gcc-version' and '/usr/libexec/gcc/$target/$gcc-version', or
only into one ''/usr/lib/gcc/$target/$gcc-version'? What is the Gentoo "standard" in
these things?


The '*lib' versus '*lib64' issue could be easy to solve by editing the
'gcc-4.1.1/gcc/config/i386/t-linux64', the rows now there :

MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64 ../lib

by changing the last to be :

MULTILIB_OSDIRNAMES = ../lib ../lib32

in the Ubuntu case.... How "screwed" the Gentoo is, is hard to say. Things like where
the 'dynamic linker' is, can be totally "unstandard" :-) Here is a clip from a 'objdump -l'
done for a SuSE Linux/x86_64 executable :


Elf file type is EXEC (Executable file)
Entry point 0x400740
There are 9 program headers, starting at offset 64

Program Headers:
 Type           Offset             VirtAddr           PhysAddr
                FileSiz            MemSiz              Flags  Align
 PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                0x00000000000001f8 0x00000000000001f8  R E    8
 INTERP         0x0000000000000238 0x0000000000400238 0x0000000000400238
                0x000000000000001c 0x000000000000001c  R      1
     [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

As the last row tells the 'dynamic linker' will be searched from '/lib64', not from '/lib' !

I would assume the Gentoo and Ubuntu people to provide separate target templates
and config files for GCC, for 'x86_64-gentoo-linux' and 'x86_64-ubuntu-linux' hosts/targets,
if their Linux/x86_64's aren't like "the others"... Anyway there should be patches or patched
GCC sources for Gentoo and Ubuntu where their stuff will be delivered.


In any case this difference in the (shared) library places would cause quite interesting issue
in "binary compatability" between the Linux/x86_64 distros.... For instance if the
'/lib/ld-linux-x86-64.so.2' and '/lib/libc.so.6'would be needed by some 64-bit executables
but the runtime system wouldn't have the first and the second would be a 32-bit one....


Andrew.




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