libbsd: fix libpath to not use host path
authorXuefer H <xuefer@gmail.com>
Sat, 24 Dec 2022 12:16:11 +0000 (20:16 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 26 Dec 2022 12:36:41 +0000 (13:36 +0100)
libpath.so uses host path in ld script causing other packages fail to
cross compile, e.g. perl:
"ld: cannot find /usr/lib/libbsd.so.0.11.6: No such file or directory"

Fixes: openwrt/packages#19390
Signed-off-by: Xuefer H <xuefer@gmail.com>
package/libs/libbsd/Makefile
package/libs/libbsd/patches/001-fix-libpath.patch [new file with mode: 0644]

index 789126cb829306a12e54f67f9d3b81bebc20bd9f..92c7054e3bd3fa2d681ceb584db81c54be6d9a07 100644 (file)
@@ -14,6 +14,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS := libmd
+PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/package/libs/libbsd/patches/001-fix-libpath.patch b/package/libs/libbsd/patches/001-fix-libpath.patch
new file mode 100644 (file)
index 0000000..ca24070
--- /dev/null
@@ -0,0 +1,13 @@
+do not use host path to fix cross compiling
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -160,7 +160,7 @@
+       (echo '/* GNU ld script'; \
+        echo ' * The MD5 functions are provided by the libmd library. */'; \
+        cat format.ld; \
+-       echo "GROUP($(runtimelibdir)/$$soname AS_NEEDED($(MD5_LIBS)))"; \
++       echo "GROUP($$soname AS_NEEDED($(MD5_LIBS)))"; \
+       )>$(DESTDIR)$(libdir)/libbsd.so
+ else
+       if [ "$(libdir)" != "$(runtimelibdir)" ]; then \