Article View: comp.sys.sgi.misc
Article #370gcc-wrapper for multiple OS - FOLLOW UP
From: Patric Beuthen
Date: Mon, 27 Jul 1998 00:00
Date: Mon, 27 Jul 1998 00:00
66 lines
3174 bytes
3174 bytes
Hi,
here is some additional information - I was asked for it. Maybe this is
enough and one of you can point me to the mistake.
Hi xxx,
you are right. I just thought many other poeple (try to) manage things
like that.
The option '-R' is not available under IRIX. So I searched the ld
and CC manpages for a similar option. It deals with 'runtime linkting -
I
was told'. The Solaris script is not mine. What I found was the '-rpath'
and I'm not quiet sure if it really works:
pb@habakuk:/tmp_mnt/KM/hiwis/pb [507] gcc -v
Reading specs from /opt/gnu/6.4/lib/gcc-lib/mips-sgi-irix6.4/2.8.1/specs
gcc version 2.8.1
The hint I was given was ' -Wl,$option'. But using it, it tells me:
pb@habakuk:/tmp_mnt/KM/hiwis/pb [518] ./g++ -v
Reading specs from /opt/gnu/6.4/lib/gcc-lib/mips-sgi-irix6.4/2.8.1/specs
gcc version 2.8.1
ld -call_shared -no_unresolved -init __do_global_ctors -fini
__do_global_dtors -_SYSTYPE_SVR4 -n32 /usr/lib32/mips3/crt1.o
/opt/gnu/6.4/lib/gcc-lib/mips-sgi-irix6.4/2.8.1/crtbegin.o
-L/opt/gnu/6.4/lib/gcc-lib/mips-sgi-irix6.4/2.8.1
-L/opt/gnu/6.4/mips-sgi-irix6.4/lib -L/opt/gnu/6.4/lib -L/opt/gnu/lib
-lstdc++ -lm -dont_warn_unused -lgcc -warn_unused -L/usr/lib32/mips3
-L/usr/lib32 -dont_warn_unused -lc -warn_unused -dont_warn_unused -lgcc
-warn_unused /opt/gnu/6.4/lib/gcc-lib/mips-sgi-irix6.4/2.8.1/crtend.o
/usr/lib32/mips3/crtn.o
ld32: ERROR 33: Unresolved text symbol "main" -- 1st referenced by
/usr/lib32/mips3/crt1.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: INFO 152: Output file removed because of error.
Of course the linker has nothing to do - the option only should let him
know where to get the libs when he needs them.
Sorry, this is everything I know.
Patric.
--------------------------------------------
Hi,
a shell-script in a NFS Network-Environment that checks the OS-type and
gives you the corresponding gcc/g++ with its libs is a very good idea.
In the following is one that works under SOLARIS. It is called
gcc-wrapper and symlinks gcc and g++ link to it:
#!/usr/local/bin/bash
GCC=/opt/gnu/`uname -r`/bin/`basename $0`
$GCC "$@" -L/opt/gnu/lib -R/opt/gnu/lib
But its doesn't work that way under IRIX (we have 6.2 and 6.4 -- when is
6.5 coming?)):
#!/usr/local/bin/bash
GCC=/opt/gnu/`uname -r`/bin/`basename $0`
$GCC "$@" -rpath /opt/gnu/`uname -r`/lib
# $GCC "$@" -Wl,-L/opt/gnu/lib # -L/opt/gnu/`uname -r`/lib
Maybe one of you solved a similar problem and can tell me how to do it.
Technical Details
Message-ID:
<35BCE2C7.1AD0A78@mpi-sb.mpg.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100159,9cb01f221451b150,start X-Google-Attributes: gid100159,public X-Google-Thread: 10ba33,9cb01f221451b150,start X-Google-Attributes: gid10ba33,public From: Patric Beuthen <pb@mpi-sb.mpg.de> Subject: gcc-wrapper for multiple OS - FOLLOW UP Date: 1998/07/27 Message-ID: <35BCE2C7.1AD0A78@mpi-sb.mpg.de> X-Deja-AN: 375423859 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Max-Planck-Institut fuer Informatik Mime-Version: 1.0 Reply-To: pb@mpi-sb.mpg.de Newsgroups: comp.sys.sgi.misc,gnu.g++.help