summaryrefslogtreecommitdiff
path: root/external/coinmp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-12 14:38:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-12 14:59:40 +0200
commit1d028d4783da69c5c0e6e0b59e0f8ac55eb9d2b1 (patch)
treec4cc2d4e37be6eca68b9829258176e156b993f93 /external/coinmp
parent688995bbb296e875511403fcce9276183f2545b0 (diff)
Fix Linux RPATH of various external modules
...as discussed in 371cc81bd9ccbfbed25f810e70899c044280349e "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
Diffstat (limited to 'external/coinmp')
-rw-r--r--external/coinmp/ExternalProject_coinmp.mk3
-rw-r--r--external/coinmp/UnpackedTarball_coinmp.mk3
-rw-r--r--external/coinmp/rpath.patch50
3 files changed, 56 insertions, 0 deletions
diff --git a/external/coinmp/ExternalProject_coinmp.mk b/external/coinmp/ExternalProject_coinmp.mk
index 84052481345a..d8bfaac944bb 100644
--- a/external/coinmp/ExternalProject_coinmp.mk
+++ b/external/coinmp/ExternalProject_coinmp.mk
@@ -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 \
diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index aad0cd3be756..468589b47d12 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -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:
diff --git a/external/coinmp/rpath.patch b/external/coinmp/rpath.patch
new file mode 100644
index 000000000000..b60bd188de45
--- /dev/null
+++ b/external/coinmp/rpath.patch
@@ -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