pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

x265 Cannot write-enable text segment: Permission denied

I built multimedia/x265 on 9.0_STABLE i386, but it does not run:

/usr/pkg/lib/ text relocations
/usr/pkg/lib/ Cannot write-enable text segment: Permission denied

The Makefile ensures it is built with ENABLE_PIC=ON:

This looks to set -fPIC:


I patched CMakeASM_NASMInformation.cmake to make sure that -DPIC was added (without this, it is only added for x64):

--- cmake/CMakeASM_NASMInformation.cmake.orig   2020-02-17 15:15:57.000000000 +0000
+++ cmake/CMakeASM_NASMInformation.cmake        2020-06-25 10:49:13.000000000 +0100
@@ -22,6 +22,9 @@
         set(ARGS -f win32 -DPREFIX)
+    if(ENABLE_PIC)
+        list(APPEND ASM_FLAGS -DPIC)
+    endif()

I also patched x86inc.asm as it explicitly disabled PIC for 32-bit:

--- common/x86/x86inc.asm.orig  2020-06-25 10:50:38.000000000 +0100
+++ common/x86/x86inc.asm       2020-06-25 10:51:01.000000000 +0100
@@ -97,7 +97,7 @@
 ; x86_32 doesn't require PIC.
 ; Some distros prefer shared objects to be PIC, but nothing breaks if
 ; the code contains a few textrels, so we'll skip that complexity.
-    %undef PIC
+;    %undef PIC
 %ifdef PIC
     default rel

But it didn't build:

/usr/obj/pkgsrc/multimedia/x265/work/x265_3.3/source/common/x86/mc-a.asm:7210: error: symbol `r7' undefined
/usr/obj/pkgsrc/multimedia/x265/work/x265_3.3/source/common/x86/mc-a.asm:7211: error: symbol `r7' undefined
/usr/obj/pkgsrc/multimedia/x265/work/x265_3.3/source/common/../common/x86/x86inc.asm:1104: ... from macro `add' defined here

I'm out of my depth now, can anyone help?


Home | Main Index | Thread Index | Old Index