pkgsrc-Bugs archive

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

pkg/56236: Patch FreeBSD link errors, "can't create dynamic relocation R_386_32 ..."



>Number:         56236
>Category:       pkg
>Synopsis:       Patch FreeBSD link errors, "can't create dynamic relocation R_386_32 ..."
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 05 15:15:00 +0000 2021
>Originator:     Yoshihiro Ota
>Release:        2021Q1 and HEAD
>Organization:
>Environment:
FreeBSD localhost 13.0-RELEASE-p1 FreeBSD 13.0-RELEASE-p1 #2708 n244777-cd3dbcb3
bb4-dirty: Sat May 15 12:28:41 EDT 2021     XXX@localhost:/usr/obj/usr/src/i386.
i386/sys/GENERIC  i386
>Description:
While installing www/seamonkey, the following software listed below had link error:
ld: error: can't create dynamic relocation R_386_32 against local symbol in read only segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output

multimedia/ffmpeg4
multimedia/x264-devel
multimedia/x265
multimedia/xvidcore


>How-To-Repeat:
cd multimedai/xvidcore && bmake

on FreeBSD 13.0-RELEASE i386
>Fix:
I'm not sure what's the preferred approach in NetBSD or pkgsrc.
The following patches makes easy work-around.


Index: multimedia/ffmpeg4/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/ffmpeg4/Makefile,v
retrieving revision 1.52
diff -u -r1.52 Makefile
--- multimedia/ffmpeg4/Makefile 24 May 2021 19:53:11 -0000      1.52
+++ multimedia/ffmpeg4/Makefile 5 Jun 2021 14:16:05 -0000
@@ -36,6 +36,8 @@
 
 .include "../../mk/compiler.mk"

+CFLAGS.FreeBSD+=               -fPIC
+LDFLAGS.FreeBSD+=              -Wl,-z,notext
 # disable asm on i386 for non-gcc and gcc < 4.2
 .if ${MACHINE_ARCH} == "i386"
 .  if !empty(MACHINE_PLATFORM:MDarwin-*-i386) \


Index: multimedia/x264-devel/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/x264-devel/Makefile,v
retrieving revision 1.76
diff -u -r1.76 Makefile
--- multimedia/x264-devel/Makefile      24 May 2021 19:53:14 -0000      1.76
+++ multimedia/x264-devel/Makefile      5 Jun 2021 14:16:05 -0000
@@ -54,6 +54,9 @@
 .include "../../mk/pthread.builtin.mk"
 CHECK_BUILTIN.pthread:=        no

+CFLAGS.FreeBSD+=               -fPIC
+LDFLAGS.FreeBSD+=              -Wl,-z,notext
+
 .if !empty(USE_BUILTIN.pthread:M[Yy][Ee][Ss])
 X264_BUILD_THREADS_SUPPORT=    yes
 .else


Index: multimedia/x265/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/x265/Makefile,v
retrieving revision 1.34
diff -u -r1.34 Makefile
--- multimedia/x265/Makefile    10 Apr 2021 08:36:03 -0000      1.34
+++ multimedia/x265/Makefile    5 Jun 2021 14:16:05 -0000
@@ -23,8 +23,9 @@
 .include "options.mk"

 .include "../../mk/bsd.prefs.mk"
+
 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
-.  if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "i386"
+.  if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" && ${MACHINE_ARCH} == "i386
"
 # Avoid text relocations
 CMAKE_ARGS+=   -DENABLE_ASSEMBLY=OFF
 .  else


Index: multimedia/xvidcore/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/xvidcore/Makefile,v
retrieving revision 1.49
diff -u -r1.49 Makefile
--- multimedia/xvidcore/Makefile        16 May 2020 17:44:15 -0000      1.49
+++ multimedia/xvidcore/Makefile        5 Jun 2021 14:16:06 -0000
@@ -29,6 +29,8 @@
 #BUILD_DEPENDS+=       yasm>=0.4.0:../../devel/yasm
 .endif

+CFLAGS.FreeBSD+=               -fPIC
+LDFLAGS.FreeBSD+=              -Wl,-z,notext
 CFLAGS.SunOS+=         -D__inline=inline
 SUBST_CLASSES.SunOS+=  ld
 SUBST_MESSAGE.ld=      Fixing linker arguments for Solaris


Home | Main Index | Thread Index | Old Index