From nobody Fri Oct 18 18:49:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XVYdf5HTZz5YpN8; Fri, 18 Oct 2024 18:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XVYdf4cFNz43yt; Fri, 18 Oct 2024 18:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729277350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXDnMG+yvmlymQO0V7kLaqJN1lkWjZm46rzAwH+Zrm8=; b=YVgYUwKr96vut2b4mEPRVPwj9o67Yieat/XFAoi0+4serB8mWdOBadYnJ9ibik4H2mWsHR c+mq3GHp1aZRAocIcmhTUk0OU2J0ufzBWqkQQOcP/tlngzg2zclCyGjMPWazEcv5U4a6In xwr32ZflNxO3OiQfqoX1m/sJU60tzXzSopO6tZ26pD9OGEwo3G7c/sdWgBakKosy/SWEwQ nMPTeXEKqYC2FlUZAl5sqy2Gdmr7E/Vp4l+AQ/RsDaxgeMhSFBn248JFR00egWnCAkd58S Oo6LaJemGyaCradu8WJlNQXETdjInMc5VGU8432q2W160CmXHEZm2GkfFD5Lcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729277350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXDnMG+yvmlymQO0V7kLaqJN1lkWjZm46rzAwH+Zrm8=; b=P8WgZsHjkCcdweylyzByNsgzjBP1cw4dJOB/YWEMGywr+k4SXp5cxaQ8gyiIHyBWDlSwDB WsN48nEY/v73Dezj1lLRptxdKwuMtNMyrv7jcl9MuEt/bHfNzZ04pt5uuHgRKnk86/L8Mu 9o3GDoWJrFIp7euZKDtnF/Va0//7umcD1a0oDygprlaq7+SzKnQa11bX+mR92pdHftsIeZ eE1P6CpzcgNKHGLj41iqXjMvrpcrlvNwnOxKrdvzKMUj3O1qDIHDmkMb5QQgKXKDWw8Bnb pDTQFf29vpb2ZpWAgrA4kX/s9Ile15/z9CwiacncN84RPj9Q7VDfv2smT3J6bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729277350; a=rsa-sha256; cv=none; b=BAgd5TnBMGIoyP31QofedJYVne40XQwhaKoSKuWwUYGKhQR9romqxXpPDA17VUONVTRXH9 Obmh05XrccKD9xCGkzM0c207Ut3cJlRZ85lXsRxKJHQmK2RepkNIrMkN+RipY8XVjAeTil jFZUmiY6f+4ww+nG58xs7HmRnqo+IkgXZZor58OCtHIZWySUB2PniqCQzrQp/U1tHA57bD zoH1jgtOL16u+aT21v+0MPitFwpaTIUYcXwQSm/KFiozfgPPPtZz3VEiKvv+9/vQ1wfcV8 4wazV6o2zDwVQ04Dp3tvzxI0WqjyG5M48Pgxr8Zk7k3mG5X58lqu60i/4T9UPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XVYdf3vRrzlWq; Fri, 18 Oct 2024 18:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49IInAYH006649; Fri, 18 Oct 2024 18:49:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49IInASV006646; Fri, 18 Oct 2024 18:49:10 GMT (envelope-from git) Date: Fri, 18 Oct 2024 18:49:10 GMT Message-Id: <202410181849.49IInASV006646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3b2cf9381ef8 - main - amd64: do not pass -z rodynamic to ld.bfd when building vdso List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b2cf9381ef86847603c3c94811f638660c417ae Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3b2cf9381ef86847603c3c94811f638660c417ae commit 3b2cf9381ef86847603c3c94811f638660c417ae Author: Konstantin Belousov AuthorDate: 2024-10-18 14:09:26 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-18 18:48:56 +0000 amd64: do not pass -z rodynamic to ld.bfd when building vdso Apparently newer versions of binutils complain instead of silently ignoring the unknown -z option. Reported by: bz Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47176 --- sys/tools/amd64_ia32_vdso.sh | 7 ++++++- sys/tools/amd64_vdso.sh | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/tools/amd64_ia32_vdso.sh b/sys/tools/amd64_ia32_vdso.sh index 59923749042f..85d2299b45d0 100644 --- a/sys/tools/amd64_ia32_vdso.sh +++ b/sys/tools/amd64_ia32_vdso.sh @@ -34,9 +34,14 @@ ${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c -m32 \ -o ia32_sigtramp.pico -I. -I"${S}" -include opt_global.h \ "${S}"/amd64/ia32/ia32_sigtramp.S +if ${LD} --version | ${AWK} '/^GNU ld/{exit 1}' ; then + RODYNAMIC="-z rodynamic" +else + RODYNAMIC="" +fi ${LD} --shared -Bsymbolic -soname="elf-vdso32.so.1" \ -T "${S}"/conf/vdso_amd64_ia32.ldscript \ - --eh-frame-hdr --no-undefined -z rodynamic -z norelro -nmagic \ + --eh-frame-hdr --no-undefined ${RODYNAMIC} -z norelro -nmagic \ --hash-style=sysv --fatal-warnings --strip-all \ -o elf-vdso32.so.1 ia32_sigtramp.pico diff --git a/sys/tools/amd64_vdso.sh b/sys/tools/amd64_vdso.sh index aec0694ebdb1..2a83ae874ab7 100644 --- a/sys/tools/amd64_vdso.sh +++ b/sys/tools/amd64_vdso.sh @@ -40,12 +40,17 @@ ${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c \ # # -z rodynamic is undocumented lld-specific option, seemingly required # for lld to avoid putting dynamic into dedicated writeable segment, -# despite ldscript placement. It is ignored by ld.bfd but ldscript +# despite ldscript placement. It is omitted for ld.bfd, but ldscript # alone is enough there. # +if ${LD} --version | ${AWK} '/^GNU ld/{exit 1}' ; then + RODYNAMIC="-z rodynamic" +else + RODYNAMIC="" +fi ${LD} --shared -Bsymbolic -soname="elf-vdso.so.1" \ -T "${S}"/conf/vdso_amd64.ldscript \ - --eh-frame-hdr --no-undefined -z rodynamic -z norelro -nmagic \ + --eh-frame-hdr --no-undefined ${RODYNAMIC} -z norelro -nmagic \ --hash-style=sysv --fatal-warnings --strip-all \ -o elf-vdso.so.1 sigtramp.pico