[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help linking ipfilter package.
From: |
Nick Clifton |
Subject: |
Re: Help linking ipfilter package. |
Date: |
Fri, 14 Nov 2003 09:38:15 +0000 |
User-agent: |
Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux) |
Hi Mario,
> From the spec file (/usr/gnu/lib/gcc-lib/sparc-sun-solaris2.8/3.3.1/specs):
> *link_arch64:
> %{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G}
[snip]
> I notice with some interest that the -M in the below4G spec is the
> only place in the whole file that that -M is used (other than -MD,
> -MMD, and -MQ for a cpp section). Is this perhaps a typo that
> should be -T?
It certainly looks like it.
For the GNU linker -M means "write a map file to the standard output"
and it does not take an argument. Whereas -T would mean "the
following argument is a linker script".
The problem however is that for the *Solaris* native linker the -M
switch means that same thing as the -T switch to the GNU linker...
So you have two choices:
1. Use the Solaris native linker not the GNU one.
2. Edit the spec file to replace the -M with -T and use the GNU
linker.
The whole situation however would appear to be a bug in the header
files used to construct the spec string. If you have access to the
gcc sources then have a look at the file gcc/config/sparc/sol2-bi.h
which is where the "-M /usr/lib/ld/sparcv9/map.below4G" option is
added to the spec string. (In the definition of LINK_ARCH64_SPEC).
The contents of this header are *supposed* to be overridden by the
definitions in gcc/config/sparc/sol2-gld-bi.h *if* the linker is the
GNU linker. My guess is that this file needs to provide an
alternative definition of the LINK_ARCH64_SPEC definition.
Hence you may find that this (untested, unapplied) patch will allow
you to build a gcc that does work. (If it does work, feel free to
submit it).
Cheers
Nick
Index: gcc/config/sparc/sol2-gld-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-gld-bi.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 sol2-gld-bi.h
*** gcc/config/sparc/sol2-gld-bi.h 17 Jun 2003 01:00:43 -0000 1.3
--- gcc/config/sparc/sol2-gld-bi.h 14 Nov 2003 09:37:49 -0000
***************
*** 7,9 ****
--- 7,27 ----
%{m64:-m elf64_sparc %(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
+
+ /* This is a duplicate of the defintion of LINK_ARCH64_SPEC
+ in sol2-bi.h, except that it uses -T rather than -M to
+ load the linker script. */
+ #undef LINK_ARCH64_SPEC
+ #define LINK_ARCH64_SPEC \
+ "%{mcmodel=medlow:-T /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}}}}"
+