summaryrefslogtreecommitdiff
path: root/lang/llvm
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2022-08-30 07:13:02 +0000
committerhe <he@pkgsrc.org>2022-08-30 07:13:02 +0000
commitf53b761aab1739a8d106783762200f775aed8385 (patch)
treedfee027c7956eb9660d26df67e69a745b28366ec /lang/llvm
parentea76e206e307f4c165e5a815995f2437784afa1a (diff)
downloadpkgsrc-f53b761aab1739a8d106783762200f775aed8385.tar.gz
llvm: On NetBSD/powerpc 8.x or 9.x, omit use of -mno-pltseq.
Fixes build on NetBSD/macppc 8.0, where we end up with pkgsrc gcc7. NetBSD 9.0 has gcc 7.4 in-tree, so is also missing -mno-pltseq. On non-NetBSD powerpc platforms, for now just insist on -mno-pltseq, i.e. a gcc at least newer than 7 (untested).
Diffstat (limited to 'lang/llvm')
-rw-r--r--lang/llvm/Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/lang/llvm/Makefile b/lang/llvm/Makefile
index e8a9ab36938..0910bec3958 100644
--- a/lang/llvm/Makefile
+++ b/lang/llvm/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.78 2022/08/24 14:38:56 ryoon Exp $
+# $NetBSD: Makefile,v 1.79 2022/08/30 07:13:02 he Exp $
#
# When updating this, please also update:
# devel/include-what-you-use
@@ -116,8 +116,20 @@ CXXFLAGS+= -march=i586
.if ${MACHINE_ARCH:Mpowerpc*}
# Needed to avoid "relocation truncated to fit: R_PPC_REL24"
-CFLAGS+= -mlongcall -mno-pltseq
-CXXFLAGS+= -mlongcall -mno-pltseq
+CFLAGS+= -mlongcall
+CXXFLAGS+= -mlongcall
+. if ${OPSYS} == "NetBSD"
+. if empty(OS_VERSION:M8.*) && empty(OS_VERSION:M9.[012345678]*)
+# The -mno-pltseq option is not available in gcc7, but is needed for
+# the above-mentioned relocation truncation issue in newer GCC
+CFLAGS+= -mno-pltseq
+CXXFLAGS+= -mno-pltseq
+. endif
+. else # Not NetBSD
+# Let's just insist on newer gcc -- untested.
+CFLAGS+= -mno-pltseq
+CXXFLAGS+= -mno-pltseq
+. endif
.endif
.if ${OPSYS} == "NetBSD"