From nobody Sun Feb 11 18:45:44 2024 X-Original-To: dev-commits-src-all@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 4TXxP44WtGz5BClP; Sun, 11 Feb 2024 18:45:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TXxP440Kqz4vv3; Sun, 11 Feb 2024 18:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707677144; 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=U/TQje91tKThaPzpIIEcxyO3vGuhbKyWABxk1fbmsIg=; b=jJThHcrdEgbPYJ0M6r8l7EhJreRgMxAfaYgtg+yXOjm2Ra3FnHbsrA2hPNxKl+oSlN1SQm VtjEVK2JHgbtpBj0eWdAwgNdGoK6jOET1/nQ5YmnN6AE9HjeOwpZkiUJGwm0dgxIXwG7bD DgIICk+tQ2hdak2QN99OI6KZ12VlZSpxCDbnal4G7VFRoAaL804MMqm+wOZn6Z4p2PEnMa Dm6YB1gvAiLGtZgMu2WUY/In6kX93FJUru1uFHIFgS4T8wsPvb+5/BvdscnGUq12nqR1NY L/Ep26qLtEw9Nf1TJO9uBI5HsM4xEa+ik8l4sKTPbHLvR/KxUPFeGlrpR4RK6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707677144; a=rsa-sha256; cv=none; b=rIawdkWnjGyoQ2FM036ld8cdtKOZCpDVdw1VPF2Pz0M4oUJGhsPiadgf/vqM0tp8jZK6cF NO8ZPVR/pTqJYLxt/diGCVxARIdb5BS+GHsDiOFu8AIrXh6YhsK7bgqstbROK19LeyRoaI nl1UCISGqI1Qvh2oLVAeL4IcPdPi1cYXiMJ2Vefbxa/H6Empd8t/ejXOvhUc0tO7eNBdn2 OANO+6mCCZ8E5k+9MrSLwUDmBXhGxcPy+2zKtNFsHH6uI85dBvMZTwQdGrWPjAXvDg2iPB jsEgqAmpWZFgmGhTPCB6vCB/YD0JVuGT1xgo9ce7pQnb/3g8KOdffomNWrx9kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707677144; 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=U/TQje91tKThaPzpIIEcxyO3vGuhbKyWABxk1fbmsIg=; b=dym08Mjuj8UguNepMa6LZun/9xnSFRGUGhWZ0IQ6nZGXF/qB2BNfnz2JWZHT628MTTt57c K567FMX3VX9tmonyOkI3igQOVLE0rYXNuutUPYWS2Mg65DyUH5YKjcV2XTAytNU0FZc+7h JHHG8ijVTsoY9utTyLAGa/0CkaKOno0LdNzM+50tkfankBGh24LO+qFMXpOWD0dGqlprnt 2NDzr3Gqf2/wy3Ia65tnpO5+2mIa0A2wuslpEs0zKBaY1I+nJGydrZ9AVb0z1pFBoKaPWt MggojbSjbT5pnMGQvTOrxe5nE6NGzR8w4Ie+0E4R8bW1+ZDJd8pk+D3N3Nz4GQ== 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 4TXxP433m8z19F5; Sun, 11 Feb 2024 18:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41BIji5q092482; Sun, 11 Feb 2024 18:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41BIjiYF092479; Sun, 11 Feb 2024 18:45:44 GMT (envelope-from git) Date: Sun, 11 Feb 2024 18:45:44 GMT Message-Id: <202402111845.41BIjiYF092479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 470f9f13de10 - main - Build clang and other llvm executables as PIE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 470f9f13de10e47e6d45721c15af6b4abe7aad55 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=470f9f13de10e47e6d45721c15af6b4abe7aad55 commit 470f9f13de10e47e6d45721c15af6b4abe7aad55 Author: Dimitry Andric AuthorDate: 2024-02-11 18:01:56 +0000 Commit: Dimitry Andric CommitDate: 2024-02-11 18:01:56 +0000 Build clang and other llvm executables as PIE There is no reason anymore to not build these as PIE. Unfortunately bsd.lib.mk does not allow for building _only_ PIE static libraries, so lib/clang/Makefile.inc needs a kludge to work around that issue. MFC after: 1 week --- lib/clang/Makefile.inc | 6 +++++- usr.bin/clang/Makefile.inc | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/clang/Makefile.inc b/lib/clang/Makefile.inc index 2dfc966726b0..5a8ead5292c6 100644 --- a/lib/clang/Makefile.inc +++ b/lib/clang/Makefile.inc @@ -2,7 +2,11 @@ .include PACKAGE= clang -MK_PIE:= no # Explicit libXXX.a references + +# Build only PIE static libraries; bsd.lib.mk does support this directly. +MK_PIE:= no +CFLAGS+= ${PIEFLAG} ${SHARED_CFLAGS} +CXXFLAGS+= ${PIEFLAG} ${SHARED_CXXFLAGS} .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only diff --git a/usr.bin/clang/Makefile.inc b/usr.bin/clang/Makefile.inc index 831cd56a8c25..8f812e24fcdb 100644 --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -3,8 +3,6 @@ WARNS?= 0 .include -MK_PIE:= no # Explicit libXXX.a references - .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only .else