[openwrt/openwrt] pcre2: fix host compilation of libselinux by enabling PIC
LEDE Commits
lede-commits at lists.infradead.org
Fri Jun 2 10:27:22 PDT 2023
hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/20295c071a6285066b847a9ad2bc1b7d1f6e5e88
commit 20295c071a6285066b847a9ad2bc1b7d1f6e5e88
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Fri May 26 13:08:06 2023 +0200
pcre2: fix host compilation of libselinux by enabling PIC
libselinux-3.5 fails to compile in Fedora 38 container due to the
following:
cc -O2 -I/openwrt/staging_dir/host/include -I/openwrt/staging_dir/hostpkg/include -I/openwrt/staging_dir/target-x86_64_musl/host/include -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 -I/openwrt/staging_dir/hostpkg/include -L/openwrt/staging_dir/host/lib -L/openwrt/staging_dir/hostpkg/lib -L/openwrt/staging_dir/target-x86_64_musl/host/lib -Wl,-rpath=/openwrt/staging_dir/hostpkg/lib -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo [...]
/usr/bin/ld: /openwrt/staging_dir/hostpkg/lib/libpcre2-8.a(pcre2_compile.c.o): relocation R_X86_64_32S against symbol `_pcre2_ucd_stage1_8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
So lets fix it by enabling build of host static library with the
position independent code option enabled.
Signed-off-by: Petr Štetiar <ynezz at true.cz>
(cherry picked from commit 12494f5b8a7bb48cbf7b2fba7d17a53981173120)
---
package/libs/pcre2/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/libs/pcre2/Makefile b/package/libs/pcre2/Makefile
index d178e3cd04..fa4282cee8 100644
--- a/package/libs/pcre2/Makefile
+++ b/package/libs/pcre2/Makefile
@@ -66,7 +66,8 @@ CMAKE_HOST_OPTIONS += \
-DPCRE2_SUPPORT_JIT=OFF \
-DPCRE2_SHOW_REPORT=OFF \
-DPCRE2_BUILD_PCRE2GREP=OFF \
- -DPCRE2_BUILD_TESTS=OFF
+ -DPCRE2_BUILD_TESTS=OFF \
+ -DPCRE2_STATIC_PIC=ON
CMAKE_OPTIONS += \
-DBUILD_SHARED_LIBS=ON \
More information about the lede-commits
mailing list