[PATCH] Fix "ld" build failure on IRIX

Roger Sayle roger@eyesopen.com
Thu Jan 19 00:15:00 GMT 2006


The following one-line patch fixes a build failure compiling GNU ld
on mips-sgi-irix6.5.  The failure mode is the fatal error message:

eelf32bmipn32.c: In function `irix_after_open':
eelf32bmipn32.c:68: warning: implicit declaration of function
`basename_cannot_be_used_without_a_prototype'
eelf32bmipn32.c:68: warning: assignment makes pointer from integer without
a cast

I believe the correct fix is for irix_after_open to use the more portable
lbasename provided by libiberty, as implemented in the patch below.

Ok for mainline (and where ever else its needed)?  Although my binutils
copyright assignment is on file, I don't have CVS write access for src,
so I'd appreciate it if someone could commit this change for me.

Many thanks in advance,


2006-01-18  Roger Sayle  <roger@eyesopen.com>

	* emultempl/irix.em: Use lbasename instead of basename.


Index: emultempl/irix.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/irix.em,v
retrieving revision 1.2
diff -c -3 -p -r1.2 irix.em
*** emultempl/irix.em	12 May 2005 07:32:03 -0000	1.2
--- emultempl/irix.em	19 Jan 2006 00:04:21 -0000
***************
*** 1,5 ****
  # This shell script emits a C file. -*- C -*-
! #   Copyright 2004 Free Software Foundation, Inc.
  #
  # This file is part of GLD, the Gnu Linker.
  #
--- 1,5 ----
  # This shell script emits a C file. -*- C -*-
! #   Copyright 2004, 2006 Free Software Foundation, Inc.
  #
  # This file is part of GLD, the Gnu Linker.
  #
*************** static void
*** 32,38 ****
  irix_after_open (void)
  {
    if (link_info.shared && command_line.soname == 0)
!     command_line.soname = basename (bfd_get_filename (output_bfd));

    gld${EMULATION_NAME}_after_open ();
  }
--- 32,38 ----
  irix_after_open (void)
  {
    if (link_info.shared && command_line.soname == 0)
!     command_line.soname = (char *) lbasename (bfd_get_filename (output_bfd));

    gld${EMULATION_NAME}_after_open ();
  }


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833



More information about the Binutils mailing list