This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

PATCH: PR binutils/3631: bfd/archive64.c is compiled unconditionally even for 32-bit targets


The problem is all files in libbfd_la_SOURCES are added to libbfd
unconditionally while libbfd_la_SOURCES won't take substitution.
bfd_libs is never used. I replace it with bfd64_libs and substitute
it in OFILES. I tested it for both 32bit and 64bit targets.


H.J.
----
2076-01-05  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/3631
	* Makefile.am (OFILES): Add @bfd64_libs@.
	(libbfd_la_SOURCES): Remove $(BFD64_LIBS_CFILES).
	* Makefile.in: Regenerated.

	* configure.in (bfd_libs): Replaced by ...
	(bfd64_libs): This.
	* configure: Regenerated.

--- bfd/Makefile.am.foo	2006-10-24 23:49:19.000000000 -0700
+++ bfd/Makefile.am	2007-01-05 10:36:34.000000000 -0800
@@ -717,7 +717,8 @@ install-html-recursive:
 # BFD_BACKENDS	Routines the configured targets need.
 # BFD_MACHINES	Architecture-specific routines the configured targets need.
 # COREFILE	Core file routines for a native configuration
-OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+# bfd64_libs	Routines for 64bit support
+OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
 
 stamp-ofiles: Makefile
 	rm -f tofiles
@@ -734,7 +735,9 @@ stamp-ofiles: Makefile
 
 ofiles: stamp-ofiles ; @true
 
-libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
+# Since BFD64_LIBS is optional and we can't have substitution in
+# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
+libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
 libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
 libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
--- bfd/configure.in.foo	2006-12-25 08:47:53.000000000 -0800
+++ bfd/configure.in	2007-01-05 10:30:00.000000000 -0800
@@ -910,7 +910,7 @@ fi	# all_targets is true
 case ${host64}-${target64}-${want64} in
   *true*)
     wordsize=64
-    bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)'
+    bfd64_libs='$(BFD64_LIBS)'
     all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
     if test $BFD_HOST_64_BIT_DEFINED = 0; then
       AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
@@ -931,13 +931,12 @@ case ${host64}-${target64}-${want64} in
     ;;
   false-false-false)
     wordsize=32
-    bfd_libs='$(BFD32_LIBS)'
     all_backends='$(BFD32_BACKENDS)'
     ;;
 esac
 
 AC_SUBST(wordsize)
-AC_SUBST(bfd_libs)
+AC_SUBST(bfd64_libs)
 AC_SUBST(all_backends)
 AC_SUBST(bfd_backends)
 AC_SUBST(bfd_machines)


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