public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/RFC] Fix compile time warning when building ld
@ 2005-02-16 11:54 Kaz Kojima
  2005-02-16 11:57 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Kaz Kojima @ 2005-02-16 11:54 UTC (permalink / raw)
  To: binutils

Hi,

I've got a compile time warning when building ld with
--target=sh4-unknown-linux-gnu  --with-sysroot=/foo --enable-build-warnings=-Werror,-Wall,-Wstrict-prototypes,-Wmissing-prototypes

  eshlelf_linux.c: In function `gldshlelf_linux_after_open':
  eshlelf_linux.c:768: warning: unused variable `lib_path'
  make[3]: *** [eshlelf_linux.o] Error 1

on i686-linux.  The variable lib_path is used only for NATIVE case
in gld${EMULATION_NAME}_after_open but defined for USE_LIBPATH case.
When --with-sysroot is used for cross building, only USE_LIBPATH is
yes and then we get the above warning.
The patch below is to fix this warning.  Regtested with no regressions
both on i686-linux cross sh4-unknown-linux-gnu and native i686-linux.

Regards,
	kaz
--
[ld/ChangeLog]
2005-02-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Define
	lib_path if NATIVE is yes.

diff -uprN ORIG/src/ld/emultempl/elf32.em LOCAL/src/ld/emultempl/elf32.em
--- ORIG/src/ld/emultempl/elf32.em	2005-02-12 18:17:11.000000000 +0900
+++ LOCAL/src/ld/emultempl/elf32.em	2005-02-15 08:20:07.000000000 +0900
@@ -836,9 +836,13 @@ gld${EMULATION_NAME}_after_open (void)
 	  size_t len;
 	  search_dirs_type *search;
 EOF
-if [ "x${USE_LIBPATH}" = xyes ] ; then
+if [ "x${NATIVE}" = xyes ] ; then
 cat >>e${EMULATION_NAME}.c <<EOF
 	  const char *lib_path;
+EOF
+fi
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
 	  struct bfd_link_needed_list *rp;
 	  int found;
 EOF

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH/RFC] Fix compile time warning when building ld
  2005-02-16 11:54 [PATCH/RFC] Fix compile time warning when building ld Kaz Kojima
@ 2005-02-16 11:57 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2005-02-16 11:57 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: binutils

On Wed, Feb 16, 2005 at 01:27:03PM +0900, Kaz Kojima wrote:
> 	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Define
> 	lib_path if NATIVE is yes.

OK.  (If you haven't already committed as obvious.)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-16  4:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-16 11:54 [PATCH/RFC] Fix compile time warning when building ld Kaz Kojima
2005-02-16 11:57 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).