Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


* One problem is that at least on Linux those external projects are apparently built in a way so that the LDFLAGS' -rpath,$ORIGIN is appended to whatever other rpath settings the external build system (libtool?) decides that it needs. That is, I get

$ for i in instdir/program/{libassuan.so.0,libgpg-error.so.0,libgpgme.so.11,libgpgmepp.so.6}; do readelf -d 
"$i"; done | grep -w RPATH
 0x000000000000000f (RPATH)              Library rpath: 
[/data/sbergman/lo-clang/core/workdir/UnpackedTarball/libgpg-error/src/.libs:/usr/local/lib:$ORIGIN]
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN]
 0x000000000000000f (RPATH)              Library rpath: 
[/data/sbergman/lo-clang/core/workdir/UnpackedTarball/libassuan/src/.libs:/data/sbergman/lo-clang/core/workdir/UnpackedTarball/libgpg-error/src/.libs:/usr/local/lib:$ORIGIN]
 0x000000000000000f (RPATH)              Library rpath: 
[/data/sbergman/lo-clang/core/workdir/UnpackedTarball/gpgme/src/.libs:/data/sbergman/lo-clang/core/workdir/UnpackedTarball/libassuan/src/.libs:/usr/local/lib:$ORIGIN]

* The gpg-error lib only depends on system libs, so doesn't need an -rpath,$ORIGIN. (Not sure what external/libgpg-error/disable-rpath-option.patch is doing.)


On 03/05/2017 10:57 AM, Thorsten Behrens wrote:
commit 1f873596eded3d858c9ed97b988ccc5a0c1ef807
Author: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Date:   Sun Mar 5 03:45:58 2017 +0100

    gpg4libre: get rpath right for gpgme

    Also add initial crossbuild support, and avoid extraneous build
    targets (docs, arcane lang support)

    Change-Id: I51afa2ff91c576b35dcb73124396188b780ed84e
    Reviewed-on: https://gerrit.libreoffice.org/34898
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>

diff --git a/external/gpgme/ExternalPackage_gpgme.mk b/external/gpgme/ExternalPackage_gpgme.mk
index 03ab389..1a483a6 100644
--- a/external/gpgme/ExternalPackage_gpgme.mk
+++ b/external/gpgme/ExternalPackage_gpgme.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_ExternalPackage_use_external_project,gpgme,gpgme))
 ifneq ($(DISABLE_DYNLOADING),TRUE)

 $(eval $(call 
gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.3.0))
+$(eval $(call 
gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.17.0))

 endif # $(DISABLE_DYNLOADING)

diff --git a/external/gpgme/ExternalProject_gpgme.mk b/external/gpgme/ExternalProject_gpgme.mk
index bc6429b..768aef9 100644
--- a/external/gpgme/ExternalProject_gpgme.mk
+++ b/external/gpgme/ExternalProject_gpgme.mk
@@ -29,6 +29,10 @@ $(call gb_ExternalProject_get_state_target,gpgme,build):
                   GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
                   LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \
                   LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \
+                  $(if $(filter LINUX,$(OS)), \
+                               'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
+                                       -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
+                  $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
          && $(MAKE) \
        )

diff --git a/external/libassuan/ExternalPackage_libassuan.mk 
b/external/libassuan/ExternalPackage_libassuan.mk
new file mode 100644
index 0000000..490869a
--- /dev/null
+++ b/external/libassuan/ExternalPackage_libassuan.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libassuan,libassuan))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libassuan,libassuan))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+
+$(eval $(call 
gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.7.3))
+
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libassuan/ExternalProject_libassuan.mk 
b/external/libassuan/ExternalProject_libassuan.mk
index af1ffe9..bcfc08a 100644
--- a/external/libassuan/ExternalProject_libassuan.mk
+++ b/external/libassuan/ExternalProject_libassuan.mk
@@ -25,6 +25,10 @@ $(call gb_ExternalProject_get_state_target,libassuan,build):
                && ./configure \
                   GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
                   GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
+                  $(if $(filter LINUX,$(OS)), \
+                               'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
+                                       -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
+                  $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
          && $(MAKE) \
        )

diff --git a/external/libassuan/Module_libassuan.mk b/external/libassuan/Module_libassuan.mk
index 67e1b46..45ada66 100644
--- a/external/libassuan/Module_libassuan.mk
+++ b/external/libassuan/Module_libassuan.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_Module_Module,libassuan))

 $(eval $(call gb_Module_add_targets,libassuan,\
        ExternalProject_libassuan \
+       ExternalPackage_libassuan \
        UnpackedTarball_libassuan \
 ))

diff --git a/external/libgpg-error/ExternalPackage_libgpg-error.mk 
b/external/libgpg-error/ExternalPackage_libgpg-error.mk
new file mode 100644
index 0000000..ba6e8c6
--- /dev/null
+++ b/external/libgpg-error/ExternalPackage_libgpg-error.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libgpg-error,libgpg-error))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libgpg-error,libgpg-error))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+
+$(eval $(call 
gb_ExternalPackage_add_file,libgpg-error,$(LIBO_LIB_FOLDER)/libgpg-error.so.0,src/.libs/libgpg-error.so.0.21.0))
+
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libgpg-error/ExternalProject_libgpg-error.mk 
b/external/libgpg-error/ExternalProject_libgpg-error.mk
index 107babb..34a87c5 100644
--- a/external/libgpg-error/ExternalProject_libgpg-error.mk
+++ b/external/libgpg-error/ExternalProject_libgpg-error.mk
@@ -18,6 +18,13 @@ $(eval $(call gb_ExternalProject_use_autoconf,libgpg-error,build))
 $(call gb_ExternalProject_get_state_target,libgpg-error,build):
        $(call gb_ExternalProject_run,build,\
                MAKE=$(MAKE) ./configure \
+                       --disable-rpath \
+                       --disable-languages \
+                       --disable-doc \
+                       $(if $(filter LINUX,$(OS)), \
+                               'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
+                                       -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
+                       $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
          && $(MAKE) \
        )

diff --git a/external/libgpg-error/Module_libgpg-error.mk 
b/external/libgpg-error/Module_libgpg-error.mk
index bbebcfb..0079dcb 100644
--- a/external/libgpg-error/Module_libgpg-error.mk
+++ b/external/libgpg-error/Module_libgpg-error.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_Module_Module,libgpg-error))

 $(eval $(call gb_Module_add_targets,libgpg-error,\
        ExternalProject_libgpg-error \
+       ExternalPackage_libgpg-error \
        UnpackedTarball_libgpg-error \
 ))

diff --git a/external/libgpg-error/UnpackedTarball_libgpg-error.mk 
b/external/libgpg-error/UnpackedTarball_libgpg-error.mk
index b2f4252..4606e80 100644
--- a/external/libgpg-error/UnpackedTarball_libgpg-error.mk
+++ b/external/libgpg-error/UnpackedTarball_libgpg-error.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgpg-error,0))

 $(eval $(call gb_UnpackedTarball_add_patches,libgpg-error, \
     external/libgpg-error/fix-autoconf-macros.patch \
+    external/libgpg-error/disable-rpath-option.patch \
 ))

 # vim: set noet sw=4 ts=4:
diff --git a/external/libgpg-error/disable-rpath-option.patch 
b/external/libgpg-error/disable-rpath-option.patch
new file mode 100644
index 0000000..b039b68
--- /dev/null
+++ b/external/libgpg-error/disable-rpath-option.patch
@@ -0,0 +1,13 @@
+diff -ur libgpg-error.org/configure.ac libgpg-error/configure.ac
+--- configure.ac       2017-03-05 01:27:38.249210887 +0100
++++ configure.ac~      2017-03-05 01:29:36.820894687 +0100
+@@ -404,6 +404,9 @@
+    CFLAGS="$CFLAGS -fvisibility=hidden"
+ fi
+
++# permit disabling rpath
++AC_LIB_RPATH
++
+ #
+ # Check whether ld supports a version script.
+ # (Actually not a check but a list of systems which are known to support it.)


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.