Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

libstdc++.so.6 64-bit binary for Solaris x86?

880 views
Skip to first unread message

MarkMcWiggins

unread,
Mar 12, 2010, 6:56:57 PM3/12/10
to
Hi ...

I'm trying to get mongodb to run on Solaris X86, but (a) I can't get
gcc to compile into 64-bit version
with libstdc++ coming out as a 64-bit version and (b) the supplied 64-
bit gcc in /usr/sfw/bin on Solaris 10
still comes with a 32-bit libstdc++!

Help! Where can I get one of these: build instructions for getting
this to build (with either SunPro 11 or gcc 3.4x)
or a binary I can download? Sunfreeware's version is 32-bit.

Thanks much,
Mark McWiggins

Paul Floyd

unread,
Mar 13, 2010, 1:50:03 PM3/13/10
to
On Fri, 12 Mar 2010 15:56:57 -0800 (PST), MarkMcWiggins
<ma...@printcop.com> wrote:
> Hi ...
>
> I'm trying to get mongodb to run on Solaris X86, but (a) I can't get
> gcc to compile into 64-bit version

Are you trying to build a 64bit version of GCC? Why? From what I can
tell, you want GCC (no matter how many bits) to compile 64bit binaries.

You shouldn't jump to the conclusion that you need a 64bit version of
GCC to build 64bit binaries.

> with libstdc++ coming out as a 64-bit version and (b) the supplied 64-
> bit gcc in /usr/sfw/bin on Solaris 10
> still comes with a 32-bit libstdc++!

Here is the 32bit version
file /usr/sfw/lib/libstdc++.so
/usr/sfw/lib/libstdc++.so: ELF 32-bit LSB dynamic lib 80386 Version 1,
dynamically linked, not stripped, no debugging information available

and here is the 64bit version
file /usr/sfw/lib/amd64/libstdc++.so
/usr/sfw/lib/amd64/libstdc++.so: ELF 64-bit LSB dynamic lib AMD64
Version 1, dynamically linked, not stripped

> Help! Where can I get one of these: build instructions for getting
> this to build (with either SunPro 11 or gcc 3.4x)
> or a binary I can download? Sunfreeware's version is 32-bit.

I assume that you mean Sun Studio. The latest version is 12 update 1,
available as a free download.

which g++
/usr/sfw/bin/g++

g++ -m64 hello.cpp

file a.out
a.out: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked,
not stripped, no debugging information available

ldd ./a.out
libstdc++.so.6 => /usr/sfw/lib/amd64/libstdc++.so.6
libm.so.2 => /lib/64/libm.so.2
libgcc_s.so.1 => /usr/sfw/lib/amd64/libgcc_s.so.1
libc.so.1 => /lib/64/libc.so.1

So basically you just need to compile and link with -m64. (The same is
true for Sun Studio).

A bientot
Paul
--
Paul Floyd http://paulf.free.fr

0 new messages