This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Is this supposed to work, or am I loopy?


Hi Phil,

: > What's wrong with using -Wl, ?  It is only four more characters to
: > type, and it will then work on all build environments.
: > 
: >    g++ -Wl,-R/home/pme/build/install-2001-01-04/lib huh.cc 
: 
: Nothing's *wrong* with it.  Just
: 
:   1)  wanted to make certain I wasn't missing anything obvious, and
:   2)  it seems a bit on the gratuitiously incompatible side.
: 
: A user brought (2) to my attention ("gcc takes -R under everything else,
: gcc doesn't take -R under linux, ergo linux is broken") and I wanted to
: test it with the current sources.

Ah, I see.  I guess it is a trivial thing to fix.  I am not sure if it
is really important though.  Support for the pass through of -R does
not appear to be documented and there is an official way of passing
switches to the linker that does work.  Not my call really.  The patch
below might make the i386 Linux target consistent with the Sparc
Solaris target, although there are still plenty of other targets that
do not support this abbreviation.

Cheers
	Nick


2001-01-05  Nick Clifton  <nickc@redhat.com>

	* config/i386/linux.h (LINK_SPEC): Pass -R on to linker.

Index: config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.21
diff -p -r1.21 linux.h
*** linux.h	2000/11/02 23:29:10	1.21
--- linux.h	2001/01/05 18:30:05
*************** Boston, MA 02111-1307, USA.  */
*** 125,130 ****
--- 125,131 ----
  #ifdef USE_GNULIBC_1
  #ifndef LINUX_DEFAULT_ELF
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \
*************** Boston, MA 02111-1307, USA.  */
*** 133,138 ****
--- 134,140 ----
  	%{!rpath:-rpath /lib/elf/}} %{static:-static}}}"
  #else
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \
*************** Boston, MA 02111-1307, USA.  */
*** 142,147 ****
--- 144,150 ----
  #endif
  #else
  #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+   %{R*} \
    %{!shared: \
      %{!ibcs: \
        %{!static: \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]