aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2022-03-13 00:09:52 -0800
committerRosen Penev <rosenp@gmail.com>2022-03-17 23:14:27 -0700
commit0ce744202ad2a2feaa3b841ce934765416d1339e (patch)
tree49a036899e86040fdb7fda593b5a14a2077ade74
parentd640480c0e874cd492efa3f4b905d2d312e1e267 (diff)
glib2: fix compilation with Alpine Linux
Patch taken from Alpine Linux git. The problem is missing -lintl linker flag. Placed in a separate directory as the patch interferes with the way libintl is implemented in OpenWrt. Also removed rpath hack, which is not needed as all libraries are static. Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--libs/glib2/Makefile3
-rw-r--r--libs/glib2/patches-host/001-musl-libintl.patch20
2 files changed, 22 insertions, 1 deletions
diff --git a/libs/glib2/Makefile b/libs/glib2/Makefile
index d6256e642..0393fef20 100644
--- a/libs/glib2/Makefile
+++ b/libs/glib2/Makefile
@@ -27,6 +27,8 @@ HOST_BUILD_DEPENDS:=libiconv/host libffi/host pcre/host
PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
PKG_INSTALL:=1
+HOST_PATCH_DIR:=./patches-host
+
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@@ -44,7 +46,6 @@ define Package/glib2/description
The GLib library of C routines
endef
-HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections $(if $(INTL_FULL),-lintl)
diff --git a/libs/glib2/patches-host/001-musl-libintl.patch b/libs/glib2/patches-host/001-musl-libintl.patch
new file mode 100644
index 000000000..db224f58e
--- /dev/null
+++ b/libs/glib2/patches-host/001-musl-libintl.patch
@@ -0,0 +1,20 @@
+--- a/meson.build
++++ b/meson.build
+@@ -2047,9 +2047,6 @@ endif
+ # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
+ # implementations. This could be extended if issues are found in some platforms.
+ libintl_deps = []
+-if cc.has_function('ngettext', args : osx_ldflags)
+- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
+-else
+ # First just find the bare library.
+ libintl = cc.find_library('intl', required : false)
+ # The bare library probably won't link without help if it's static.
+@@ -2081,7 +2078,6 @@ else
+ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', args : osx_ldflags,
+ dependencies : libintl_deps)
+ endif
+-endif
+
+ glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)
+