[gnu.gcc.bug] gcc doesn't pass ld flag

mrm%puffin@Sun.COM (Marianne Mueller) (05/03/89)

In version 1.34 or 1.35, configured for sun4-os4, gcc doesn't pass
the ld flag -Bstatic to the link editor.  

Here's what gcc -v says:
-------------------------
sparc% gcc -o gcc.test -v test.c -lm -Bstatic
gcc version 1.35
 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix
-D__sparc__ -\
D__sun__ -D__unix__ test.c /tmp/cca02001.cpp
GNU CPP version 1.35
 /usr/local/lib/gcc-cc1 /tmp/cca02001.cpp -quiet -dumpbase test.c
-version -o /\
tmp/cca02001.s
GNU C version 1.35 (sparc) compiled by GNU C version 1.35.
 as -o test.o /tmp/cca02001.s
 ld -o gcc.test -e start -dc -dp /lib/crt0.o test.o -lm /usr/local/lib/gcc-gnulib -lc


Here's the demo program:
------------------------
sparc% cat test.c
#include <math.h>
main ()
{
        double x;
        x = exp(1.0);
        printf("exp(1.00)=%8.7e\n", x);
}


p.s. You can accomplish static linking on Suns running SunOS4 by
being sure to tell the link editor an entry point (along with the
-Bstatic flag):

	gcc -c yourprog.c
	ld -e start -X -dc -dp /usr/lib/crt0.o yourprog.o -Bstatic -lm -lc