I get a funny error while trying to build ipfilters for Solaris. It seems that that package tries to use a compilation flag that is broken. It's something with the specs, I think; anyway here's what happens:
$$$$ cat trial.c #include <stdio.h>
main() { printf("Sizeof int: %d\n", sizeof (int)); printf("Sizeof long: %d\n", sizeof (long)); printf("Sizeof *: %d\n", sizeof (void *)); } $$$$ gcc -o trial64 -m64 -mcmodel=medlow trial.c /usr/lib/ld/sparcv9/map.below4G: file not recognized: File format not recognized collect2: ld returned 1 exit status $$$$ gcc -o trial64 -m64 trial.c $$$$ ./trial64 Sizeof int: 4 Sizeof long: 8 Sizeof *: 8
More detail:
$$$$ gcc -v Reading specs from /usr/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/specs Configured with: /media/gnu/gcc-3.3.1/configure --prefix=/tools/GNU/005/SunOS_5.8 --disable-nls --with-gnu-as --with-as=/tools/GNU/005/SunOS_5.8/bin/as --with-gnu-ld --with-ld=/tools/GNU/005/SunOS_5.8/bin/ld Thread model: posix gcc version 3.3.1
From the specs file:
*link_arch64: %{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} %{G:-G} %{YP,*} %{R*} %{compat-bsd: %{!YP,*:%{p|pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/libp/sparcv9:/usr/lib/sparcv9} %{!p:%{!pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/sparcv9}}} -R /usr/ucblib} %{!compat-bsd: %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}
The map.below4G file is SUN's so I won't paste it here, but it's basically comments and one line to (I guess) set the start address of the text segment. Currently, I've fixed the ipfilters script by commenting out this part of the buildsunos script, but it's been there for several versions.
I think I posted this problem to the binutils group some time ago, and we investigated some changes to the specs file, but they never worked. So I took the -mcmodel out and things work. But I'm concerned about this flag; it seems to be there for use by the Sun linker, yet if I'm using GNU ld, then it just gets in the way. Can the specs file be made smarter to avoid this problem? Is there something similar which needs to be set-up so that the it will work for either ld?
Mario -- Whoever fights monsters should see to it that in the process he does not become a monster. -- Nietzsche
Poppy says: [x] GBI [] Internal Use Only [] Confidential Proprietary Mommy says: [x] wash your face [x] brush your teeth [x] watch yo' mouth