summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred Wingate <parona@protonmail.com>2023-11-02 05:57:07 +0200
committerYixun Lan <dlan@gentoo.org>2023-11-13 12:06:38 +0000
commitd71a4483a05c58244ca99b561853436ce510c1fa (patch)
tree0cb48392015cff6d3c559c1280770d47f646b57b /net-misc/zerotier
parentdev-util/android-udev-rules: drop 20220903, 20230104, 20230303 (diff)
downloadgentoo-d71a4483a05c58244ca99b561853436ce510c1fa.tar.gz
gentoo-d71a4483a05c58244ca99b561853436ce510c1fa.tar.bz2
gentoo-d71a4483a05c58244ca99b561853436ce510c1fa.zip
net-misc/zerotier: fix build on llvm toolchain
Closes: https://github.com/gentoo/gentoo/pull/33640 Signed-off-by: Alfred Wingate <parona@protonmail.com> Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'net-misc/zerotier')
-rw-r--r--net-misc/zerotier/files/zerotier-1.12.2-noexecstack.patch24
-rw-r--r--net-misc/zerotier/zerotier-1.12.2.ebuild7
2 files changed, 26 insertions, 5 deletions
diff --git a/net-misc/zerotier/files/zerotier-1.12.2-noexecstack.patch b/net-misc/zerotier/files/zerotier-1.12.2-noexecstack.patch
new file mode 100644
index 000000000000..2888577d13ba
--- /dev/null
+++ b/net-misc/zerotier/files/zerotier-1.12.2-noexecstack.patch
@@ -0,0 +1,24 @@
+https://github.com/zerotier/ZeroTierOne/pull/2161
+
+From e171384c19bb0c0dfe0368e4f249dd6a30d33748 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sun, 29 Oct 2023 13:48:07 +0200
+Subject: [PATCH] Append noexecstack to linker flags instead of assembler flags
+
+* Better compatibility with LLVM toolchain where clang -c doesn't
+ support the flag, but the linker does. LLD already defaults to
+ noexecstack, but adding it in the linker phase will avoid errors about
+ unsupported options.
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -358,7 +358,7 @@ override CFLAGS+=-fPIC -fPIE
+ override CXXFLAGS+=-fPIC -fPIE
+
+ # Non-executable stack
+-override ASFLAGS+=--noexecstack
++override LDFLAGS+=-Wl,-z,noexecstack
+
+ .PHONY: all
+ all: one
diff --git a/net-misc/zerotier/zerotier-1.12.2.ebuild b/net-misc/zerotier/zerotier-1.12.2.ebuild
index fb7ba2cbffc8..d380ca84b14c 100644
--- a/net-misc/zerotier/zerotier-1.12.2.ebuild
+++ b/net-misc/zerotier/zerotier-1.12.2.ebuild
@@ -191,7 +191,7 @@ declare -A GIT_CRATES=(
[jwt]='https://github.com/glimberg/rust-jwt;61a9291fdeec747c6edf14f4fa0caf235136c168;rust-jwt-%commit%'
)
-inherit cargo flag-o-matic systemd toolchain-funcs
+inherit cargo systemd toolchain-funcs
DESCRIPTION="A software-based managed Ethernet switch for planet Earth"
HOMEPAGE="https://www.zerotier.com/"
@@ -225,6 +225,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-1.10.1-respect-ldflags.patch
"${FILESDIR}"/${PN}-1.10.1-add-armv7a-support.patch
+ "${FILESDIR}"/${PN}-1.12.2-noexecstack.patch
)
DOCS=( README.md AUTHORS.md )
@@ -248,10 +249,6 @@ src_prepare() {
src_configure() {
tc-export CXX CC
- # Several assembler files without GNU-stack markings
- # https://github.com/zerotier/ZeroTierOne/issues/1179
- append-ldflags -Wl,-z,noexecstack
-
use cpu_flags_arm_neon || export ZT_DISABLE_NEON=1
use sso && cargo_src_configure