This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] add FreeBSD-specific `ld' emulations


In article <orit7wwe0q.fsf@free.redhat.lsd.ic.unicamp.br> you write:
>On Feb 24, 2002, Alexandre Oliva <aoliva@redhat.com> wrote:

>> Index: gcc/ChangeLog
>> from  Alexandre Oliva  <aoliva@redhat.com>

>> 	* config/i386/freebsd.h (LINK_SPEC): Don't pass default
>> 	emulation to the linker.

> Ping?  http://gcc.gnu.org/ml/gcc-patches/2002-02/msg01694.html

Hi Alexandre,

Sorry I didn't speak up sooner but I don't have approval rights and
assumed someone with global privs would speak up.  Given the
concurrent approved change to binutils and the history of published
versions; I think this is almost "obvious".  I write this today since
it just hit me after upgrading to a current FSF binutils.

I support installing your patch on mainline and all branches back to
2.95.  Based on his e-mail in the thread, I think David O'Brien fully
supports it.  Upgrading binutils to 2.12 (prerelease post-mid-Feb)
causes gcc bootstraps to fail without this patch.  I can confirm that
it works with /usr/bin/ld as well on the various versions of FreeBSD I
tested.  Since there was only one "emulation" available under older
system ld (I only tested 4.5 and 5.0), I don't see how failing to
provide an explicit -m switch could break (but I am often surprised).

I also think other config/*/freebsd.h need a similar patch which I
have included below (sparc version untested but identical in purpose).

Regards,
Loren

	* config/i386/freebsd.h (LINK_SPEC): Don't pass default
	emulation to the linker.
	* config/alpha/freebsd.h (LINK_SPEC): Likewise.
	* config/sparc/freebsd.h (LINK_SPEC): Likewise.

Index: config/alpha/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/freebsd.h,v
retrieving revision 1.5
diff -c -r1.5 freebsd.h
*** freebsd.h	2002/01/22 20:54:32	1.5
--- freebsd.h	2002/03/29 02:59:18
***************
*** 1,5 ****
  /* Definitions for DEC Alpha/AXP running FreeBSD using the ELF format
!    Copyright (C) 2000 Free Software Foundation, Inc.
     Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
  
  This file is part of GNU CC.
--- 1,5 ----
  /* Definitions for DEC Alpha/AXP running FreeBSD using the ELF format
!    Copyright (C) 2000, 2002 Free Software Foundation, Inc.
     Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
  
  This file is part of GNU CC.
***************
*** 32,38 ****
    %{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT}"
  
  #undef  LINK_SPEC
! #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}			\
    %{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
    %{Wl,*:%*}								\
    %{assert*} %{R*} %{rpath*} %{defsym*}					\
--- 32,38 ----
    %{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT}"
  
  #undef  LINK_SPEC
! #define LINK_SPEC "%{G*} %{relax:-relax}				\
    %{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
    %{Wl,*:%*}								\
    %{assert*} %{R*} %{rpath*} %{defsym*}					\
Index: config/i386/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/freebsd.h,v
retrieving revision 1.29
diff -c -r1.29 freebsd.h
*** freebsd.h	2001/10/31 14:32:27	1.29
--- freebsd.h	2002/03/29 02:59:18
***************
*** 1,5 ****
  /* Definitions for Intel 386 running FreeBSD with ELF format
!    Copyright (C) 1996, 2000 Free Software Foundation, Inc.
     Contributed by Eric Youngdale.
     Modified for stabs-in-ELF by H.J. Lu.
     Adapted from GNU/Linux version by John Polstra.
--- 1,5 ----
  /* Definitions for Intel 386 running FreeBSD with ELF format
!    Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
     Contributed by Eric Youngdale.
     Modified for stabs-in-ELF by H.J. Lu.
     Adapted from GNU/Linux version by John Polstra.
***************
*** 105,111 ****
     done.  */
  
  #undef	LINK_SPEC
! #define LINK_SPEC "-m elf_i386 \
    %{Wl,*:%*} \
    %{v:-V} \
    %{assert*} %{R*} %{rpath*} %{defsym*} \
--- 105,111 ----
     done.  */
  
  #undef	LINK_SPEC
! #define LINK_SPEC "\
    %{Wl,*:%*} \
    %{v:-V} \
    %{assert*} %{R*} %{rpath*} %{defsym*} \
Index: config/sparc/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/freebsd.h,v
retrieving revision 1.6
diff -c -r1.6 freebsd.h
*** freebsd.h	2002/03/27 10:30:42	1.6
--- freebsd.h	2002/03/29 02:59:18
***************
*** 1,5 ****
  /* Definitions for Sun Sparc64 running FreeBSD using the ELF format
!    Copyright (C) 2001 Free Software Foundation, Inc.
     Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
  
  This file is part of GNU CC.
--- 1,5 ----
  /* Definitions for Sun Sparc64 running FreeBSD using the ELF format
!    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
     Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
  
  This file is part of GNU CC.
***************
*** 26,32 ****
  #undef  CPP_PREDEFINES
  #define CPP_PREDEFINES FBSD_CPP_PREDEFINES
  
! #define LINK_SPEC "-m elf64_sparc %(link_arch)				\
    %{!mno-relax:%{!r:-relax}}						\
    %{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
    %{Wl,*:%*}								\
--- 26,32 ----
  #undef  CPP_PREDEFINES
  #define CPP_PREDEFINES FBSD_CPP_PREDEFINES
  
! #define LINK_SPEC "%(link_arch)						\
    %{!mno-relax:%{!r:-relax}}						\
    %{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
    %{Wl,*:%*}								\


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