Ok, as in every second mail Jeff already talks about this
-Wl,--as-needed flag, I got tired and investigated on this stuff ;-)
Well, it's just an option which tells ld(1) to leave out any libraries
which are _not_ really referenced by an object. I'm not sure whether
I really understand all the commotion about this flag, but AFAIK the
current internal RPM library dependencies are already correct. Only
minimalized external dependencies through the bottleneck librpmmisc
cause trouble under -Wl,--as-needed.
So, I've added a --with-build-maxlibdep which does for the remaining
librpmxxx the same as --with-build-extlibdep does for librpmisc: it
links against the $LIBS -- which carries the external third-party
libraries. This way _TRY_ to link against more libs, but -Wl,--as-needed
reduces automatically again. With the appended patch I was at least able
to build under FreebSD 6 and Fedora 7 with
$ LDFLAGS="-Wl,--as-needed" ./configure --with-build-maxlibdep [...]
So, is this enough to get rid of this topic or do I still miss an
important point?
Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com
Index: configure.ac
===================================================================
RCS file: /v/rpm/cvs/rpm/configure.ac,v
retrieving revision 2.223
diff -u -d -u -d -r2.223 configure.ac
--- configure.ac 26 Jul 2007 07:39:25 -0000 2.223
+++ configure.ac 26 Jul 2007 08:10:42 -0000
@@ -223,7 +223,7 @@
[ENABLE_BUILD_INTLIBDEP],
[test ".$do_build_intlibdep" = .yes])
-dnl # support implicit external library dependencies
+dnl # support implicit (minimum) external library dependencies
AC_ARG_ENABLE(
[build-extlibdep],
AC_HELP_STRING(
@@ -235,6 +235,18 @@
[ENABLE_BUILD_EXTLIBDEP],
[test ".$do_build_extlibdep" = .yes])
+dnl # support implicit maximum (external) library dependencies
+AC_ARG_ENABLE(
+ [build-maxlibdep],
+ AC_HELP_STRING(
+ [--disable-build-maxlibdep],
+ [disable use of implicit maxium (external) library dependencies]),
+ [ do_build_maxlibdep=$enableval ],
+ [ do_build_maxlibdep=yes ])
+AM_CONDITIONAL(
+ [ENABLE_BUILD_MAXLIBDEP],
+ [test ".$do_build_maxlibdep" = .yes])
+
dnl # support removal of GNU libtool *.la files
AC_ARG_ENABLE(
[build-lafiles],
Index: build/Makefile.am
===================================================================
RCS file: /v/rpm/cvs/rpm/build/Makefile.am,v
retrieving revision 2.67
diff -u -d -u -d -r2.67 Makefile.am
--- build/Makefile.am 23 Jul 2007 15:03:42 -0000 2.67
+++ build/Makefile.am 26 Jul 2007 08:10:42 -0000
@@ -42,6 +42,10 @@
$(top_builddir)/rpmio/librpmio.la \
$(top_builddir)/misc/librpmmisc.la
endif
+if ENABLE_BUILD_MAXLIBDEP
+librpmbuild_la_LDFLAGS += $(LDFLAGS)
+librpmbuild_la_LIBADD += $(LIBS)
+endif
librpmbuild.la: $(librpmbuild_la_OBJECTS) $(librpmbuild_la_DEPENDENCIES)
$(librpmbuild_la_LINK) -rpath $(usrlibdir) $(librpmbuild_la_OBJECTS) $(librpmbuild_la_LIBADD)
Index: lib/Makefile.am
===================================================================
RCS file: /v/rpm/cvs/rpm/lib/Makefile.am,v
retrieving revision 2.162
diff -u -d -u -d -r2.162 Makefile.am
--- lib/Makefile.am 23 Jul 2007 15:03:42 -0000 2.162
+++ lib/Makefile.am 26 Jul 2007 08:10:42 -0000
@@ -51,6 +51,10 @@
$(top_builddir)/rpmio/librpmio.la \
$(top_builddir)/misc/librpmmisc.la
endif
+if ENABLE_BUILD_MAXLIBDEP
+librpm_la_LDFLAGS += $(LDFLAGS)
+librpm_la_LIBADD += $(LIBS)
+endif
librpm.la: $(librpm_la_OBJECTS) $(librpm_la_DEPENDENCIES)
$(librpm_la_LINK) -rpath $(usrlibdir) $(librpm_la_OBJECTS) $(librpm_la_LIBADD)
Index: rpmdb/Makefile.am
===================================================================
RCS file: /v/rpm/cvs/rpm/rpmdb/Makefile.am,v
retrieving revision 1.75
diff -u -d -u -d -r1.75 Makefile.am
--- rpmdb/Makefile.am 26 Jul 2007 07:39:26 -0000 1.75
+++ rpmdb/Makefile.am 26 Jul 2007 08:10:42 -0000
@@ -53,6 +53,10 @@
$(top_builddir)/rpmio/librpmio.la \
$(top_builddir)/misc/librpmmisc.la
endif
+if ENABLE_BUILD_MAXLIBDEP
+librpmdb_la_LDFLAGS += $(LDFLAGS)
+librpmdb_la_LIBADD += $(LIBS)
+endif
librpmdb_la_DEPENDENCIES = $(DBLIBOBJS)
librpmdb.la: $(librpmdb_la_OBJECTS) $(librpmdb_la_DEPENDENCIES)
$(librpmdb_la_LINK) -rpath $(usrlibdir) $(librpmdb_la_OBJECTS) $(librpmdb_la_LIBADD)
Index: rpmio/Makefile.am
===================================================================
RCS file: /v/rpm/cvs/rpm/rpmio/Makefile.am,v
retrieving revision 1.100
diff -u -d -u -d -r1.100 Makefile.am
--- rpmio/Makefile.am 23 Jul 2007 15:03:43 -0000 1.100
+++ rpmio/Makefile.am 26 Jul 2007 08:10:42 -0000
@@ -60,6 +60,10 @@
librpmio_la_LIBADD += \
$(top_builddir)/misc/librpmmisc.la
endif
+if ENABLE_BUILD_MAXLIBDEP
+librpmio_la_LDFLAGS += $(LDFLAGS)
+librpmio_la_LIBADD += $(LIBS)
+endif
librpmio.la: $(librpmio_la_OBJECTS) $(librpmio_la_DEPENDENCIES)
$(librpmio_la_LINK) -rpath $(usrlibdir) $(librpmio_la_OBJECTS) $(librpmio_la_LIBADD)
Received on Thu Jul 26 10:19:15 2007