From nobody Fri May 23 23:48:31 2025 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 4b420v5K8Rz5wmmM; Fri, 23 May 2025 23:48:31 +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 4b420v3q30z41Y1; Fri, 23 May 2025 23:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748044111; 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=I735hNm5VJdMCvfcGBi7yjXiEJAYnrQHsMVSjUFIbLM=; b=XyB+gawlGoW+mED9dpHdIMzk0c/7lGpugH5NF9ToA0HqSMuCCY48r+gMGwwC/T3Liay4c9 xdcUnNHuGHvhoB/sj8//ReWpFRDuU/8thFKhOvR+lxSuwEvzVq0Vt1Mz6S4pacwUR+hlnq SFg3aDRsqws/Doew2OnojkkVg1pIVMvtwnVQo+jHLCGAZ87j5MvkSFlFASEuvr9GiYvYoW kCPIvBue3DlfpA5isuyb/VCPUVBggZuPOg6CnPBYYWh5F5IZNW1MHYdZaB3z9J+glma4GY t1dRxKSH4wuavqZ42GJI0qR6xllYvBVJbmaOWc2i3R4yf03MJBchrpBU9YXFsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748044111; 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=I735hNm5VJdMCvfcGBi7yjXiEJAYnrQHsMVSjUFIbLM=; b=IHbAxrWxb7q1oPlrtDoYfSQtEvq8Uw5Ktbv+OlI911AaKI+f+96GWBGWk2qYifLG348Ydp uWncaPv65B7mJgye8wBm3jD0G9Ef8Ll96t1aAKGW0tIvSJDFcA6N0M+cB9vA3LVeJhr/0r QEGAIGvsmamCeLteCtxZFJCAXebZSvpPa+DZBntUgBax0xTW5PCL8EhceLoQJSzOM9i0Sz Jp0DVUGm1XsPQOLSI/EPx4mMUPvQzU84ZhD0MizdIIjV+cDwmlsu5qboCwDGU7XX+cWPm+ vZh+gRsB2nteBvSYHJsRAxaUB5Zxl/sdj4SESKKW1tNnNYap03oCX0zGAQqGfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748044111; a=rsa-sha256; cv=none; b=V89l+5elBImT9TcysUu4KDn9Yn5sZOM9Zs08A07xNJL9tTp3l07zhS4tJZw0DZuNEBnf8V 8lij5jY11nZxwGdRoaK7eqM/crxZK1Oyw3tGmtKvtmvtyQazP1fEGJ1SJ7DjS8y/e5FOvz okGwEmAfbNsh4lAgfiYVx8N8/8p1dtt8y4VH3AlL5e83aRTFjS/Qc+g1L5AkarfcS641HS drOGMhOuawHVtygj9DDJ7jnF6G9zDjwVecHRimMLDSMBv8lU4n7NBXr8SwziChHqVMaKR7 eEphFGIaJnNjyMzwn3bB17B/zJ1OqnyI1aZoDi1v6wA9uoCztp+m4fTq/A5hgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4b420v2dqKz1QMs; Fri, 23 May 2025 23:48:31 +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 54NNmVFV046886; Fri, 23 May 2025 23:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54NNmV5G046883; Fri, 23 May 2025 23:48:31 GMT (envelope-from git) Date: Fri, 23 May 2025 23:48:31 GMT Message-Id: <202505232348.54NNmV5G046883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 9c2001036185 - main - share/mk: pass SHARED_CFLAGS to PIC and PIE from assembly 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c20010361854a6034595fdb13cd3583ea13f289 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9c20010361854a6034595fdb13cd3583ea13f289 commit 9c20010361854a6034595fdb13cd3583ea13f289 Author: Brooks Davis AuthorDate: 2025-05-23 23:35:21 +0000 Commit: Brooks Davis CommitDate: 2025-05-23 23:38:06 +0000 share/mk: pass SHARED_CFLAGS to PIC and PIE from assembly This matches what we do with C sources. Document SHARED_CFLAGS. PR: 286975 Reviewed by: jhb, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50466 --- share/mk/bsd.README | 3 +++ share/mk/bsd.suffixes-extra.mk | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.README b/share/mk/bsd.README index c2326a17f03c..4820bf12c72d 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -197,6 +197,9 @@ LIBADD Additional libraries. This is for base system libraries LIBADD.${.TARGET:T} Libraries dependent on output file name. +SHARED_CFLAGS Additional compiler flags used when creating shared or + position independent object files. + COMPILER_FEATURES A list of features that the compiler supports. Zero or more of: diff --git a/share/mk/bsd.suffixes-extra.mk b/share/mk/bsd.suffixes-extra.mk index 680abfc88eb4..e27c9ad318e6 100644 --- a/share/mk/bsd.suffixes-extra.mk +++ b/share/mk/bsd.suffixes-extra.mk @@ -60,12 +60,13 @@ PIEFLAG?=-fpie .asm.pico: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} \ + ${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.nossppico: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ + ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \ ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \ ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} @@ -73,18 +74,19 @@ PIEFLAG?=-fpie .asm.pieo: ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PIEFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} \ + ${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .S.pico: ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} \ + ${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .S.nossppico: ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC \ + ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \ ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \ ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} @@ -92,7 +94,7 @@ PIEFLAG?=-fpie .S.pieo: ${CC:N${CCACHE_BIN}} ${PIEFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} \ + ${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD}