aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Jacobs <freebsd@dev.thsi.be>2024-02-07 18:10:46 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2024-02-10 13:42:26 +0000
commit84ef6c1c612525c29dd4c271ea4e91c2d54074af (patch)
treed82e5c4ae0f4df35596f412c00d881b7f35faee4
parentdf4e32c9b3af97b2790f4ee8e35f0a3d1f1f2e24 (diff)
downloadports-84ef6c1c612525c29dd4c271ea4e91c2d54074af.tar.gz
ports-84ef6c1c612525c29dd4c271ea4e91c2d54074af.zip
devel/ocaml-opam: Fix build on armv7.
The LLVM assembler chokes on the assembly generated by the ARM32 backend of OCAML. Fixed by forcing binutils on ARM32. The OCaml compiler generates text relocations on all of its supported 32 bits architectures, however the configure script only sets the -z notext linker flag in the x86 case. This change makes sure that this flag is used for the other architectures by setting LDFLAGS in the environment of the configure script. This commit may fix armv6 and powerpc as well, but this hasn't been verified. PR: 261180 MFH: 2024Q1 Reported by: fuz Approved by: hannes@mehnert.org (maintainer)
-rw-r--r--devel/ocaml-opam/Makefile25
1 files changed, 17 insertions, 8 deletions
diff --git a/devel/ocaml-opam/Makefile b/devel/ocaml-opam/Makefile
index d7e060451647..e8274f7019dd 100644
--- a/devel/ocaml-opam/Makefile
+++ b/devel/ocaml-opam/Makefile
@@ -1,6 +1,6 @@
PORTNAME= opam
DISTVERSION= 2.1.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= https://github.com/ocaml/opam/releases/download/${DISTVERSION}/
PKGNAMEPREFIX= ocaml-
@@ -12,13 +12,17 @@ WWW= https://opam.ocaml.org/
LICENSE= LGPL21
-BROKEN_armv6= ld: error: can't create dynamic relocation R_ARM_ABS32 against symbol: caml_program in readonly segment
-BROKEN_armv7= ld: error: can't create dynamic relocation R_ARM_ABS32 against symbol: caml_program in readonly segment
-
RUN_DEPENDS= curl:ftp/curl \
- gpatch:devel/patch
+ gpatch:devel/patch \
+ ${RUN_DEPENDS_${ARCH}}
+RUN_DEPENDS_armv6= ${LOCALBASE}/bin/as:devel/binutils
+RUN_DEPENDS_armv7= ${LOCALBASE}/bin/as:devel/binutils
USES= gmake
+ARCH!= uname -p
+.if ${ARCH} == armv6 || ${ARCH} == armv7
+USE_BINUTILS= yes
+.endif
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-checks
@@ -26,6 +30,13 @@ CONFIGURE_ARGS= --disable-checks
MAKE_JOBS_UNSAFE= yes
ALL_TARGET= cold-lib-ext cold-all
+LDFLAGS_armv6= -Wl,-z,notext
+LDFLAGS_armv7= -Wl,-z,notext
+LDFLAGS_powerpc= -Wl,-z,notext
+LDFLAGS+= ${LDFLAGS_${ARCH}}
+
+NOPRECIOUSMAKEVARS= yes
+
OPTIONS_DEFINE= DARCS GIT MERCURIAL RSYNC
OPTIONS_DEFAULT= GIT RSYNC
NO_OPTIONS_SORT= yes
@@ -37,10 +48,8 @@ GIT_RUN_DEPENDS= git:devel/git
MERCURIAL_RUN_DEPENDS= ${PY_MERCURIAL}
RSYNC_RUN_DEPENDS= rsync:net/rsync
-NOPRECIOUSMAKEVARS= yes
-
pre-configure:
- cd ${WRKSRC} && ${MAKE_CMD} compiler
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} compiler)
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/opam-installer