public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)?
@ 2004-08-03 15:55 Daniel Franke
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Franke @ 2004-08-03 15:55 UTC (permalink / raw)
  To: gcc-help


Hi all,
I try to figure out how to compile the code below as 64bit executable:

-- foo.cpp --
int main () {
  return 0;
}
--
The code compiles:
$> g++ -m64 -O2 -g foo.cpp

and:
$> file a.out
a.out:          ELF 64-bit MSB executable SPARCV9 Version 1, dynamically 
linked, not stripped

tells me that I got what I asked for, but:
$> ldd a.out
        libstdc++.so.6 =>        /usr/local/lib/libstdc++.so.6  - wrong ELF 
class: ELFCLASS32
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1  - wrong ELF 
class: ELFCLASS32
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1

As you can see, the linker (sun ld) seems to include the 32bit versions of 
libstd++ and libgcc_s, instead of their 64bit companions - which are located 
in '/usr/local/lib/sparcv9/'.

Verbose output (see below) shows that
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9
actually _is_ included in the library search path.

What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in 
g++/collect2? Something completely different? 

Thanks in advance for any hints :)

	Daniel Franke


$> g++ -v -m64 -O2 -g foo.cpp
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v 
-D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet 
-dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version 
-o /var/tmp//ccKbcjqe.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory 
"/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward
 /usr/local/include
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include
 /usr/include
End of search list.
GNU C++ version 3.4.1 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /usr/ccs/bin/as -V -Qy -s -xarch=v9 
-o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s
/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y 
P,/usr/lib/sparcv9 
-Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 
-L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 
-L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc 
-lc -lgcc_s_sparcv9 -lgcc 
-lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284


$> g++ -v
reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1

$> g++ -print-multi-lib
.;
sparcv9;@m64




-- 
Dipl.-Math. (FH) Daniel Franke
Institut fuer Medizinische Biometrie und Statistik
Medizinische Universität zu Luebeck
Ratzeburger Allee 160, Haus 4
23538 Luebeck
Telefon: 0451-500-2786
Telefax: 0451-500-2999
daniel.franke@imbs.uni-luebeck.de

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

* Re: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)?
  2004-08-03 16:25 lrtaylor
@ 2004-08-03 16:41 ` Daniel Franke
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Franke @ 2004-08-03 16:41 UTC (permalink / raw)
  To: lrtaylor; +Cc: gcc-help

Am Dienstag, 3. August 2004 18:24 schrieb lrtaylor@micron.com:
> GCC's 64-bit libraries are in a different directory.  For example, try
> looking under /usr/local/lib for a directory named sparcv9 or something. 
> Or, if GCC's libraries are installed into a GCC-specific sub directory
> somewhere, try looking there.  You'll then need to modify your
> LD_LIBRARY_PATH to look there before /usr/local/lib.
>
> Thanks,
> Lyle

Oh my goddess!

Lyle, thank you very much. I hadn't had '/usr/local/lib/sparcv9' in my 
LD_LIBRARY_PATH. I somehow thought the libs should be found anyway (magic?).
I knew it must be something really stupid!

Thanks a lot!

	Daniel

-- 
Dipl.-Math. (FH) Daniel Franke
Institut fuer Medizinische Biometrie und Statistik
Medizinische Universität zu Luebeck
Ratzeburger Allee 160, Haus 4
23538 Luebeck
Telefon: 0451-500-2786
Telefax: 0451-500-2999
daniel.franke@imbs.uni-luebeck.de

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

* RE: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)?
@ 2004-08-03 16:25 lrtaylor
  2004-08-03 16:41 ` Daniel Franke
  0 siblings, 1 reply; 3+ messages in thread
From: lrtaylor @ 2004-08-03 16:25 UTC (permalink / raw)
  To: daniel.franke, gcc-help

GCC's 64-bit libraries are in a different directory.  For example, try looking under /usr/local/lib for a directory named sparcv9 or something.  Or, if GCC's libraries are installed into a GCC-specific sub directory somewhere, try looking there.  You'll then need to modify your LD_LIBRARY_PATH to look there before /usr/local/lib.

Thanks,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Daniel Franke
Sent: Tuesday, August 03, 2004 9:46 AM
To: gcc-help@gcc.gnu.org
Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)?


Hi all,
I try to figure out how to compile the code below as 64bit executable:

-- foo.cpp --
int main () {
  return 0;
}
--
The code compiles:
$> g++ -m64 -O2 -g foo.cpp

and:
$> file a.out
a.out:          ELF 64-bit MSB executable SPARCV9 Version 1, dynamically 
linked, not stripped

tells me that I got what I asked for, but:
$> ldd a.out
        libstdc++.so.6 =>        /usr/local/lib/libstdc++.so.6  - wrong ELF 
class: ELFCLASS32
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1  - wrong ELF 
class: ELFCLASS32
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1

As you can see, the linker (sun ld) seems to include the 32bit versions of 
libstd++ and libgcc_s, instead of their 64bit companions - which are located 
in '/usr/local/lib/sparcv9/'.

Verbose output (see below) shows that
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9
actually _is_ included in the library search path.

What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in 
g++/collect2? Something completely different? 

Thanks in advance for any hints :)

	Daniel Franke


$> g++ -v -m64 -O2 -g foo.cpp
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v 
-D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet 
-dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version 
-o /var/tmp//ccKbcjqe.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory 
"/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward
 /usr/local/include
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include
 /usr/include
End of search list.
GNU C++ version 3.4.1 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /usr/ccs/bin/as -V -Qy -s -xarch=v9 
-o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s
/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y 
P,/usr/lib/sparcv9 
-Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 
-L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 
-L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 
-L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc 
-lc -lgcc_s_sparcv9 -lgcc 
-lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284


$> g++ -v
reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1

$> g++ -print-multi-lib
.;
sparcv9;@m64




-- 
Dipl.-Math. (FH) Daniel Franke
Institut fuer Medizinische Biometrie und Statistik
Medizinische Universität zu Luebeck
Ratzeburger Allee 160, Haus 4
23538 Luebeck
Telefon: 0451-500-2786
Telefax: 0451-500-2999
daniel.franke@imbs.uni-luebeck.de

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

end of thread, other threads:[~2004-08-03 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-03 15:55 sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Daniel Franke
2004-08-03 16:25 lrtaylor
2004-08-03 16:41 ` Daniel Franke

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).