Fix Linux RPATH of various external modules

...as discussed in 371cc81bd9 "external/liborcus:
Fix Linux RPATH:"

* When an external module produces multiple libraries (that we all install) that
  depend on each other, they need to contain $ORIGIN in RPATH (strictly
  speaking, those that do not depend on any other libraries from the module
  would not need that, but it is harmless and easier to do that way).

* When an external module's libraries depend on other external modules'
  libraries, and (at least some of) those other external modules are not
  configuread as --with-system-*, they need to contain $ORIGIN in RPATH (again,
  for simplicity, some libraries may get that even if they would not strictly
  need it).

* Try to outsmart the external modules' libtool instances to not add (ultimately
  bogus) paths to RPATH for dependencies on libraries from external modules
  (either from the same module, or from anohter module not configured as
  --with-system-*).  The only time we do not outsmart libtool, and instead rely
  on it (hopefully?) doing the right thing is when a given external modules'
  libraries depend on libraries from excatly one other external module, and the
  latter is configured as --with-system-*.

* That outsmarting means that if an external library depends both on external
  libraries provided by modules not configured as --with-system-* (so RPATH
  contains $ORIGIN, and the outsmarting is not suppressed) and on external
  libraries provided by modules configured as --with-system-*:  Then if the
  latter are in unusual locations on the system that would require an RPATH
  entry (which might be provided via the corresponding "pkg-config --libs", say,
  and presumably would be honoured by libtool if we did not outsmart it), then
  those paths are now erroneously missing from RPATH.

* That outsmarting also causes linking of some utility applications in module
  redland to fail, but those are ultimately unused, so cut them off by patching
  their respective sub-directory Makefile.in.

Change-Id: Iec05b3568fbcf04987018322c328b769ae4f5dab
This commit is contained in:
Stephan Bergmann 2015-06-12 14:38:02 +02:00
parent 688995bbb2
commit 1d028d4783
29 changed files with 227 additions and 0 deletions

View file

@ -31,6 +31,9 @@ $(call gb_ExternalProject_get_state_target,coinmp,build) :
$(if $(DISABLE_DYNLOADING),--disable-shared) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
--enable-dependency-linking F77=unavailable \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
&& $(MAKE) \
$(if $(filter MACOSX,$(OS)),&& $(PERL) \
$(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \

View file

@ -15,6 +15,8 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,coinmp,\
CoinMP/MSVisualStudio/v9/CoinMP.sln \
))
$(eval $(call gb_UnpackedTarball_set_patchlevel,coinmp,0))
$(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
external/coinmp/android.build.patch.1 \
external/coinmp/no-binaries.patch.1 \
@ -27,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
$(if $(filter MACOSX,$(OS)),external/coinmp/macosx.build.patch.1) \
external/coinmp/werror-format-pedantic.patch.0 \
external/coinmp/ubsan.patch.0 \
external/coinmp/rpath.patch \
))
# vim: set noet sw=4 ts=4:

50
external/coinmp/rpath.patch vendored Normal file
View file

@ -0,0 +1,50 @@
--- Cbc/configure
+++ Cbc/configure
@@ -12484,6 +12484,7 @@
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)
# FIXME: insert proper C++ library support
--- Cgl/configure
+++ Cgl/configure
@@ -12455,6 +12455,7 @@
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)
# FIXME: insert proper C++ library support
--- Clp/configure
+++ Clp/configure
@@ -12482,6 +12482,7 @@
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)
# FIXME: insert proper C++ library support
--- CoinMP/configure
+++ CoinMP/configure
@@ -12424,6 +12424,7 @@
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)
# FIXME: insert proper C++ library support
--- Osi/configure
+++ Osi/configure
@@ -12453,6 +12453,7 @@
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)
# FIXME: insert proper C++ library support

View file

@ -40,6 +40,9 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) :
--without-tools \
$(if $(filter WNT,$(OS_FOR_BUILD)),MKDIR_P="$(shell cygpath -m /usr/bin/mkdir) -p") \
$(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
BOOST_CFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \
XML_CFLAGS="$(LIBXML_CFLAGS)" \
XML_LIBS="$(LIBXML_LIBS)" \

View file

@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
external/libetonyek/ubsan.patch \
external/libetonyek/0001-add-missing-breaks.patch.1 \
external/libetonyek/0002-remove-surplus-breaks.patch.1 \
external/libetonyek/rpath.patch \
))
ifeq ($(COM_GCC_IS_CLANG),TRUE)

10
external/libetonyek/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -14451,6 +14451,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -39,6 +39,9 @@ $(call gb_ExternalProject_get_state_target,libmwaw,build) :
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),\
$(if $(COM_GCC_IS_CLANG),-Qunused-arguments) \
-I$(call gb_UnpackedTarball_get_dir,boost))" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
&& (cd $(EXTERNAL_WORKDIR)/src/lib && \

View file

@ -21,4 +21,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,libmwaw, \
endif
endif
ifeq ($(SYSTEM_REVENGE),)
$(eval $(call gb_UnpackedTarball_add_patches,libmwaw, \
external/libmwaw/rpath.patch \
))
endif
# vim: set noet sw=4 ts=4:

10
external/libmwaw/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -15353,6 +15353,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -36,6 +36,9 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) :
--without-docs \
$(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) $(if $(SYSTEM_REVENGE),,$(if $(filter-out MSC,$(COM)),-DLIBREVENGE_VISIBILITY))" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
&& $(MAKE) \

View file

@ -21,4 +21,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
endif
endif
ifeq ($(SYSTEM_REVENGE),)
$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
external/libodfgen/rpath.patch \
))
endif
# vim: set noet sw=4 ts=4:

10
external/libodfgen/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -13940,6 +13940,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -35,6 +35,9 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) :
--prefix=/@.__________________________________________________OOO) \
$(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(gb_COMPILEROPTFLAGS)") \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
&& $(MAKE) \
$(if $(filter MACOSX,$(OS)),\

View file

@ -11,8 +11,11 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libwpd))
$(eval $(call gb_UnpackedTarball_set_tarball,libwpd,$(WPD_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,libwpd,0))
$(eval $(call gb_UnpackedTarball_add_patches,libwpd,\
external/libwpd/libwpd-vs2013.patch.1 \
$(if $(SYSTEM_REVENGE),,external/libwpd/rpath.patch) \
))
# vim: set noet sw=4 ts=4:

10
external/libwpd/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -13850,6 +13850,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -35,6 +35,9 @@ $(call gb_ExternalProject_get_state_target,libwpg,build) :
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
&& $(MAKE) \
$(if $(filter MACOSX,$(OS)),\
&& $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \

View file

@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libwpg))
$(eval $(call gb_UnpackedTarball_set_tarball,libwpg,$(WPG_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,libwpg,0))
$(eval $(call gb_UnpackedTarball_add_patches,libwpg, \
external/libwpg/rpath.patch \
))
# vim: set noet sw=4 ts=4:

10
external/libwpg/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -13858,6 +13858,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -36,6 +36,9 @@ $(call gb_ExternalProject_get_state_target,libwps,build) :
--disable-werror \
$(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX)" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
&& $(MAKE) \

View file

@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,1))
$(eval $(call gb_UnpackedTarball_add_patches,libwps,\
external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch \
external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch \
$(if $(SYSTEM_REVENGE),,external/libwps/rpath.patch.0) \
))
ifeq ($(COM_GCC_IS_CLANG),TRUE)

10
external/libwps/rpath.patch.0 vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -14306,6 +14306,7 @@
esac
;;
esac
+hardcode_libdir_flag_spec_CXX=
;;
lynxos*)

View file

@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,xslt,\
external/libxslt/libxslt-1.1.26-memdump.patch \
$(if $(filter ANDROID,$(OS)),external/libxslt/libxslt-android.patch) \
external/libxslt/libxslt-config-guess.patch.0 \
external/libxslt/rpath.patch.0 \
))
# vim: set noet sw=4 ts=4:

10
external/libxslt/rpath.patch.0 vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -10196,6 +10196,7 @@
else
ld_shlibs=no
fi
+hardcode_libdir_flag_spec=
;;
netbsd*)

View file

@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\
$(if $(filter-out WNT,$(OS)),external/redland/raptor/raptor-bundled-soname.patch.1) \
$(if $(filter ANDROID,$(OS)),external/redland/raptor/raptor-android.patch.1) \
external/redland/raptor/ubsan.patch \
$(if $(SYSTEM_LIBXML),,external/redland/raptor/rpath.patch) \
))
# vim: set noet sw=4 ts=4:

View file

@ -14,6 +14,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,rasqal,$(RASQAL_TARBALL),,redland))
# configure generated files for MSVC
$(eval $(call gb_UnpackedTarball_add_file,rasqal,src/rasqal.h,external/redland/rasqal/rasqal.h))
$(eval $(call gb_UnpackedTarball_set_patchlevel,rasqal,0))
$(eval $(call gb_UnpackedTarball_add_patches,rasqal,\
external/redland/rasqal/rasqal-pkgconfig.patch.1 \
external/redland/rasqal/rasqal-freebsd.patch.1 \
@ -23,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,rasqal,\
$(if $(filter ANDROID,$(OS)),external/redland/rasqal/rasqal-android.patch.1) \
$(if $(filter WNTGCC,$(OS)$(COM)),external/redland/rasqal/rasqal-mingw.patch.1) \
$(if $(CROSS_COMPILING),external/redland/rasqal/rasqal-xcompile.patch.1) \
external/redland/rasqal/rpath.patch \
))
# vim: set noet sw=4 ts=4:

View file

@ -14,6 +14,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,redland,$(REDLAND_TARBALL),,redland
# configure generated files for MSVC
$(eval $(call gb_UnpackedTarball_add_file,redland,src/librdf.h,external/redland/redland/librdf.h))
$(eval $(call gb_UnpackedTarball_set_patchlevel,redland,0))
# redland-format.patch.0 sent upstream as
# <https://github.com/dajobe/librdf/pull/6>
$(eval $(call gb_UnpackedTarball_add_patches,redland,\
@ -26,6 +28,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,redland,\
$(if $(filter WNTGCC,$(OS)$(COM)),external/redland/redland/redland-mingw.patch.1) \
$(if $(CROSS_COMPILING),external/redland/redland/redland-xcompile.patch.1) \
external/redland/redland/redland-format.patch.0 \
external/redland/redland/rpath.patch \
))
# vim: set noet sw=4 ts=4:

21
external/redland/raptor/rpath.patch vendored Normal file
View file

@ -0,0 +1,21 @@
--- configure
+++ configure
@@ -9892,6 +9892,7 @@
else
ld_shlibs=no
fi
+hardcode_libdir_flag_spec=
;;
netbsd* | netbsdelf*-gnu)
--- utils/Makefile.in
+++ utils/Makefile.in
@@ -343,7 +343,7 @@
rapper_LDADD = $(top_builddir)/src/libraptor2.la
rdfdiff_SOURCES = rdfdiff.c $(am__append_2)
rdfdiff_LDADD = $(top_builddir)/src/libraptor2.la
-all: all-am
+all:
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj

21
external/redland/rasqal/rpath.patch vendored Normal file
View file

@ -0,0 +1,21 @@
--- configure
+++ configure
@@ -9843,6 +9843,7 @@
else
ld_shlibs=no
fi
+hardcode_libdir_flag_spec=
;;
netbsd* | netbsdelf*-gnu)
--- utils/Makefile.in
+++ utils/Makefile.in
@@ -373,7 +373,7 @@
$(man_MANS) \
roqet.html
-all: all-am
+all:
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj

10
external/redland/redland/rpath.patch vendored Normal file
View file

@ -0,0 +1,10 @@
--- configure
+++ configure
@@ -10308,6 +10308,7 @@
else
ld_shlibs=no
fi
+hardcode_libdir_flag_spec=
;;
netbsd* | netbsdelf*-gnu)