🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51333

dyn. link w/cross compiler?

#51333
From: Dave McGuire
Date: Sat, 05 Jun 1993 03:05
58 lines
3815 bytes
  Hello folks...I just built a gcc v2.4.3 cross-compiler to run on my
Sparc machine (SunOS 4.1.3) and produce executables for a Sun3 system
(SunOS4.1.1).  I used ./configure --host=sun4-sunos4.1.3
--target=sun3-sunos4.1.1.  I haven't tried anything big yet, but
simple test programs compile & link ok and run fine when ftp'd to the
Sun3 box.

  The problem is this: all the executables produced by the
cross-compiler appear to be statically linked.  I've put all the
shared libraries in /usr/local/sun3-sunos4.1.1 and it's finding
everything else just fine, it's just not dynamically linking them.
I'm using gnu ld from the binutils-2.1.1 distribution, that I placed
in /usr/local/sun3-sunos4.1.1/bin.  Is this something that just
doesn't work with cross-compilation, or am I doing something wrong?
Any ideas?

  Here's some output:


  With the cross-compiler:

rocinante$ gcc -b sun3-sunos4.1.1 -v -O2 -o foo foo.c
Reading specs from /usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3/specs
gcc version 2.4.3
 /usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3/cpp -lang-c -v -undef -D__GNUC__=2 -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__mc68000 -D__sun -D__unix -D__OPTIMIZE__ -D__HAVE_68881__ -D__mc68020__ -Dmc68020 foo.c /usr/tmp/cca19054.i
GNU CPP version 2.4.3 (68k, MIT syntax)
 /usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3/cc1 /usr/tmp/cca19054.i -quiet -dumpbase foo.c -O2 -version -o /usr/tmp/cca19054.s
GNU C version 2.4.3 (68k, MIT syntax) compiled by CC.
 /usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3/as -mc68020 -o /usr/tmp/cca190541.o /usr/tmp/cca19054.s
 /usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3/ld -e start -dc -dp -o foo /usr/local/sun3-sunos4.1.1/lib/crt0.o /usr/local/sun3-sunos4.1.1/lib/Mcrt1.o -L/usr/local/lib/gcc-lib/sun3-sunos4.1.1/2.4.3 -L/usr/local/sun3-sunos4.1.1/lib /usr/tmp/cca190541.o -lgcc -lc -L/usr/lib/f68881 -lgcc
rocinante$ 
rocinante$ file foo
foo:		mc68020 demand paged executable not stripped
rocinante$


  And with the native compiler:

rocinante$ gcc -v -O2 -o foo foo.c
Reading specs from /usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3/specs
gcc version 2.4.3
 /usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -D__sparc__ -D__sun__ -D__unix__ -D__GCC_NEW_VARARGS__ -D__sparc -D__sun -D__unix -D__GCC_NEW_VARARGS__ -D__OPTIMIZE__ foo.c /usr/tmp/cca19060.i
GNU CPP version 2.4.3 (sparc)
 /usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3/cc1 /usr/tmp/cca19060.i -quiet -dumpbase foo.c -O2 -version -o /usr/tmp/cca19060.s
GNU C version 2.4.3 (sparc) compiled by GNU C version 2.4.3.
 /usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3/as -o /usr/tmp/cca190601.o /usr/tmp/cca19060.s
 /usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3/ld -e start -dc -dp -o foo /lib/crt0.o -L/usr/local/lib/gcc-lib/sun4-sunos4.1.3/2.4.3 -L/usr/local/lib /usr/tmp/cca190601.o -lgcc -lc -lgcc
rocinante$ file foo
foo:		sparc demand paged dynamically linked executable not stripped
rocinante$ 

See what I mean?


       -Dave McGuire
        Systems Programmer
        Digital Express Group, Incorporated
        mcguire@digex.net
Technical Details
Message-ID: <1up2id$p04@news1.digex.net>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!digex.com!rocinante.digex.net!mcguire

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,227b8ef202e1d6a,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-06-04 20:16:55 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!digex.com!rocinante.digex.net!mcguire
From: mcguire@rocinante.digex.net (Dave McGuire)
Newsgroups: gnu.gcc.help
Subject: dyn. link w/cross compiler?
Date: 5 Jun 1993 03:05:49 GMT
Organization: Express Access Online Communications, Greenbelt MD USA
Lines: 58
Message-ID: <1up2id$p04@news1.digex.net>
NNTP-Posting-Host: rocinante.digex.net
X-Newsreader: TIN [version 1.1 PL8]