public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Installing multilib on x86_64*-linux* with 32-bit libs to lib32 and 64-bit libs to lib
@ 2006-06-06 23:20 Albert Chin
  2006-06-07  7:19 ` Kai Ruottu
  0 siblings, 1 reply; 6+ messages in thread
From: Albert Chin @ 2006-06-06 23:20 UTC (permalink / raw)
  To: gcc-help

How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
installed to $prefix/lib32 and 64-bit libs to $prefix/lib?

-- 
albert chin (china@thewrittenword.com)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Installing multilib on x86_64*-linux* with 32-bit libs to lib32  and 64-bit libs to lib
  2006-06-06 23:20 Installing multilib on x86_64*-linux* with 32-bit libs to lib32 and 64-bit libs to lib Albert Chin
@ 2006-06-07  7:19 ` Kai Ruottu
  2006-06-08 10:05   ` Kai Ruottu
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2006-06-07  7:19 UTC (permalink / raw)
  To: gcc-help

Albert Chin wrote :

 > How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
 > installed to $prefix/lib32 and 64-bit libs to $prefix/lib?

 This is unstandard, all the Linux/*64's should use '*/lib64' for the 
64-bit libs and
'*/lib' for the 32-bit libs, this is the de-facto standard!  Whether it 
is also an official
standard is unknown... Also the GCC sources  use this existing de-facto 
standard.

 The only 64-bit Linux I have met using what you describe, is the 
Ubuntu.  Why it
tries that old "proprietary" idea: "get me and then be married with me", 
is somehow
uncomprehensible in this "open standard systems" age...

 So your only choice  without doing manual fixes to the FSF sources, is 
to "marry
with" Ubuntu, use only its patched sources, and never try any pristine 
FSF ones!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Installing multilib on x86_64*-linux* with 32-bit libs to lib32   and 64-bit libs to lib
  2006-06-07  7:19 ` Kai Ruottu
@ 2006-06-08 10:05   ` Kai Ruottu
  2006-06-08 13:45     ` Albert Chin
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2006-06-08 10:05 UTC (permalink / raw)
  To: Kai Ruottu; +Cc: gcc-help

Kai Ruottu wrote :
> Albert Chin wrote :
>
> > How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
> > installed to $prefix/lib32 and 64-bit libs to $prefix/lib?
>
> So your only choice  without doing manual fixes to the FSF sources, is 
> to "marry
> with" Ubuntu, use only its patched sources, and never try any pristine 
> FSF ones!
>
 Those "manual fixes" to the sources are quite obvious though, the 
"target Makefile
fragment", 'gcc/config/i386/t-linux64', has in it :

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

and changing this into :

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

should succeed even for a newbie.  This could sound being enough, but 
then there
are things like :

#undef  LINK_SPEC
#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
  %{shared:-shared} \
  %{!shared: \
    %{!static: \
      %{rdynamic:-export-dynamic} \
      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
      %{!m32:%{!dynamic-linker:-dynamic-linker 
/lib64/ld-linux-x86-64.so.2}}} \
    %{static:-static}}"

in the 'gcc/config/i386/linux64.h' and maybe something else too...

 That the 32-bit "command interpreter" or "dynamic linker" is in '/lib' 
and that
the 64-bit one is in '/lib64', is also one part of the 'de-facto' 
Linux/x86_64 standard,
so a 64-bit application made in Ubuntu searching its 64-bit 
'ld-linux-x86-64.so.2'
from '/lib' and a 32-bit application made in Ubuntu searching its 
'ld-linux.so.2'
from '/lib32' would simply clash  with all the 32-bit Linux/x86's and 
all the other
Linux/x86_64's installations....

 Maybe there should be a totally separate 'x86_64-ubuntu-linux'  target 
in  the
GCC sources and this target then considered being totally incompatible 
with the
other Linux/x86 and Linux/x86_64 distros  :-(   The 'Ubuntu 6.0.6'  
Install/Live-CD
told it at least using special Firefox 1.5.03, not the generic one from 
the Mozilla.org,
but this doesn't yet prove anything. Interesting would be if running 
those generic
Firefoxes and Thunderbirds, Skypes, X-Lites, Acrobat Readers etc. 
wouldn't work,
but one should stay within the once tied "marriage"....

 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Installing multilib on x86_64*-linux* with 32-bit libs to lib32   and 64-bit libs to lib
  2006-06-08 10:05   ` Kai Ruottu
@ 2006-06-08 13:45     ` Albert Chin
  2006-06-09  9:35       ` Albert Chin
  0 siblings, 1 reply; 6+ messages in thread
From: Albert Chin @ 2006-06-08 13:45 UTC (permalink / raw)
  To: gcc-help

On Thu, Jun 08, 2006 at 01:12:56PM +0300, Kai Ruottu wrote:
> Kai Ruottu wrote :
> >Albert Chin wrote :
> >
> >> How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
> >> installed to $prefix/lib32 and 64-bit libs to $prefix/lib?
> >
> >So your only choice  without doing manual fixes to the FSF sources, is 
> >to "marry
> >with" Ubuntu, use only its patched sources, and never try any pristine 
> >FSF ones!
> >
> Those "manual fixes" to the sources are quite obvious though, the 
> "target Makefile
> fragment", 'gcc/config/i386/t-linux64', has in it :
> 
>  MULTILIB_OPTIONS = m64/m32
>  MULTILIB_DIRNAMES = 64 32
>  MULTILIB_OSDIRNAMES = ../lib64 ../lib
> 
> and changing this into :
> 
>  MULTILIB_OPTIONS = m64/m32
>  MULTILIB_DIRNAMES = 64 32
>  MULTILIB_OSDIRNAMES = ../lib ../lib32

Yeah, I saw this.

> should succeed even for a newbie.  This could sound being enough, but 
> then there
> are things like :
> 
> #undef  LINK_SPEC
> #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
>  %{shared:-shared} \
>  %{!shared: \
>    %{!static: \
>      %{rdynamic:-export-dynamic} \
>      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
>      %{!m32:%{!dynamic-linker:-dynamic-linker 
> /lib64/ld-linux-x86-64.so.2}}} \
>    %{static:-static}}"
> 
> in the 'gcc/config/i386/linux64.h' and maybe something else too...

Ok, thanks. I'll check out the changes required for the above.

-- 
albert chin (china@thewrittenword.com)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Installing multilib on x86_64*-linux* with 32-bit libs to lib32   and 64-bit libs to lib
  2006-06-08 13:45     ` Albert Chin
@ 2006-06-09  9:35       ` Albert Chin
  0 siblings, 0 replies; 6+ messages in thread
From: Albert Chin @ 2006-06-09  9:35 UTC (permalink / raw)
  To: gcc-help

On Thu, Jun 08, 2006 at 08:43:33AM -0500, Albert Chin wrote:
> On Thu, Jun 08, 2006 at 01:12:56PM +0300, Kai Ruottu wrote:
> > Kai Ruottu wrote :
> > >Albert Chin wrote :
> > >
> > >> How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
> > >> installed to $prefix/lib32 and 64-bit libs to $prefix/lib?
> > >
> > >So your only choice  without doing manual fixes to the FSF sources, is 
> > >to "marry
> > >with" Ubuntu, use only its patched sources, and never try any pristine 
> > >FSF ones!
> > >
> > Those "manual fixes" to the sources are quite obvious though, the 
> > "target Makefile
> > fragment", 'gcc/config/i386/t-linux64', has in it :
> > 
> >  MULTILIB_OPTIONS = m64/m32
> >  MULTILIB_DIRNAMES = 64 32
> >  MULTILIB_OSDIRNAMES = ../lib64 ../lib
> > 
> > and changing this into :
> > 
> >  MULTILIB_OPTIONS = m64/m32
> >  MULTILIB_DIRNAMES = 64 32
> >  MULTILIB_OSDIRNAMES = ../lib ../lib32
> 
> Yeah, I saw this.
> 
> > should succeed even for a newbie.  This could sound being enough, but 
> > then there
> > are things like :
> > 
> > #undef  LINK_SPEC
> > #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
> >  %{shared:-shared} \
> >  %{!shared: \
> >    %{!static: \
> >      %{rdynamic:-export-dynamic} \
> >      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
> >      %{!m32:%{!dynamic-linker:-dynamic-linker 
> > /lib64/ld-linux-x86-64.so.2}}} \
> >    %{static:-static}}"
> > 
> > in the 'gcc/config/i386/linux64.h' and maybe something else too...
> 
> Ok, thanks. I'll check out the changes required for the above.

I don't think what I want to do is moderately possible. Having made
the change to gcc/config/i386/t-linux64, I built gcc-4.0.2 on RHEL
4/amd64 and failed with:
  stage1/xgcc -Bstage1/
  -B/nokia/apps/tww/@sys/gcc402/x86_64-unknown-linux-gnu/bin/   -g -O2
  -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
  -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros
  -Wold-style-definition     -DHAVE_CONFIG_H -DGENERATOR_FILE  -o
  build/genmodes build/genmodes.o build/errors.o
  ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
  /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
  searching for -lc
  /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when
  searching for -lc
  /usr/bin/ld: warning: i386 architecture of input file
  `/usr/lib/../lib/crt1.o' is incompatible with i386:x86-64 output
  /usr/bin/ld: warning: i386 architecture of input file
  `/usr/lib/../lib/crti.o' is incompatible with i386:x86-64 output
  /usr/bin/ld: warning: i386 architecture of input file
  `/usr/lib/../lib/crtn.o' is incompatible with i386:x86-64 output

If I strace the above command, the call to collect2 is:
  execve("stage1/collect2", ["stage1/collect2", "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "build/genmodes", "/usr/lib/../lib64/crt1.o", "/usr/lib/../lib64/crti.o", "stage1/crtbegin.o", "-Lstage1", "-L/lib/../lib64", "-L/usr/lib/../lib64", "build/genmodes.o", "build/errors.o", "../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "-lc", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "stage1/crtend.o", "/usr/lib/../lib64/crtn.o"], [/* 34 vars */]) = 0

gcc/multilib.h starts with:
  static const char *const multilib_raw[] = {
  ". !m64 !m32;",
  "64:../lib m64 !m32;",
  "32:../lib32 !m64 m32;",
  NULL
  };
and gcc/stage1/specs has:
  *multilib:
  . !m64 !m32;64:../lib m64 !m32;32:../lib32 !m64 m32;

Ubuntu can get away with lib/lib32 if the entire system is built this
way. However, if the OS has lib/lib64 (32-bit/64-bit) and I want GCC
to use lib32/lib, then things won't work. GCC is appending one of the
paths specified in MULTILIB_OSDIRNAMES to locate the system files and,
more than likely, its own.

-- 
albert chin (china@thewrittenword.com)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Installing multilib on x86_64*-linux* with 32-bit libs to lib32 and 64-bit libs to lib
@ 2006-05-05  3:26 Albert Chin
  0 siblings, 0 replies; 6+ messages in thread
From: Albert Chin @ 2006-05-05  3:26 UTC (permalink / raw)
  To: gcc-help

How do I build gcc-4.0.2 on x86_64*-linux* so 32-bit libs are
installed to $prefix/lib32 and 64-bit libs to $prefix/lib?

-- 
albert chin (china@thewrittenword.com)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-09  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-06 23:20 Installing multilib on x86_64*-linux* with 32-bit libs to lib32 and 64-bit libs to lib Albert Chin
2006-06-07  7:19 ` Kai Ruottu
2006-06-08 10:05   ` Kai Ruottu
2006-06-08 13:45     ` Albert Chin
2006-06-09  9:35       ` Albert Chin
  -- strict thread matches above, loose matches on Subject: below --
2006-05-05  3:26 Albert Chin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).