-fPIC flag does'nt work on freebsd

Satish Balay balay@mcs.anl.gov
Thu Mar 19 17:10:00 GMT 1998

We also have a newer gcc installed, (gcc-2.7.2) and it also
has the same problem

snowy:/homes/balay/junk>/usr/local/gcc-2.7.2/bin/gcc -v -fPIC -c sizeof.c 
Reading specs from /usr/local/gcc-2.7.2/lib/gcc-lib/i386-unknown-freebsd2.1.0/2.7.2/specs
gcc version 2.7.2
 /usr/local/gcc-2.7.2/lib/gcc-lib/i386-unknown-freebsd2.1.0/2.7.2/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -Dunix -Di386 -D__FreeBSD__ -D__386BSD__ -D__unix__ -D__i386__ -D__FreeBSD__ -D__386BSD__ -D__unix -D__i386 -Asystem(unix) -Asystem(Fre
eBSD) -Acpu(i386) -Amachine(i386) sizeof.c /var/tmp/cc012503.i
GNU CPP version 2.7.2 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 /usr/local/gcc-2.7.2/lib/gcc-lib/i386-unknown-freebsd2.1.0/2.7.2/cc1 /var/tmp/cc012503.i -quiet -dumpbase sizeof.c -version -fPIC -o /var/tmp/cc012503.s
GNU C version 2.7.2 (80386, BSD syntax) compiled by GNU C version 2.7.2.
 as -k -o sizeof.o /var/tmp/cc012503.s
as: unrecognized option `-k'

On Thu, 19 Mar 1998, Jim Wilson wrote:

> Try using the -v flag with both the old gcc and the new egcs gcc to see
> what the difference in assembler flags is.
> Also check to see what assembler each compiler is using.  It may be that
> egcs is using a different assembler.  I would guess that is the problem
> here.  The old gcc is perhaps using the very old as that comes with freebsd
> and which requires the -k flag, whereas the new egcs gcc may perhaps be using
> a new as that you installed from a recent binutils which doesn't want the
> -k option.  If that is the case, then we need some kind of configuration
> change to handle the old assembler differently than the new assembler.
> Jim

More information about the Gcc-bugs mailing list