From nobody Wed Apr 23 15:44:11 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 4ZjNgv1wJZz5tYKy; Wed, 23 Apr 2025 15:44:11 +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 4ZjNgv1Jbmz3rZx; Wed, 23 Apr 2025 15:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745423051; 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=3xIv9dt2fI+k+3+MvUjvN3jV8QolAKgnGvctTntONXc=; b=qMQ8gzW9bGFi29pHEcnQL3fa6Xhqraai8SK54YpvcGMQ9yLcQPhKNKvY2RrZgceThW/K3d lTMe1T6cwstn/0klHy+ulm0TikFZH7OzzMFi5GErxqG9xT2imsXJ7TiP8HuBISYH4bd7Pz pbtOvEiZb2FZzi5txH5m/j4j90hGMZGYH0PDJVWthZ6acl+zCWrsSiHdmGGrL4F//Z/ifQ vajhB9d+IWO2hKz5LAy8ES2Uy0geywCPYZXuAVCvjdZkzMSh49iaeD2qvQVydlc7WjRXMa pSsYjDh+Mzue1ktZyXOWf8LK6yGS10jS9Yxe6jGjBPuGm3SV2LCJ7uLtGFX9Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745423051; a=rsa-sha256; cv=none; b=VhQzTmsdu4Z7g2lLATD8Uux7nL909uKz8GMJKV9FqZXTH/S/yONJuPtbVz4p49y2CWWgSX rSlUWkrfYa3pEjIqSe63xtGzcSSceUdFPPEuvub12TbtpayYj3kYx5B9/N2qL2aOzgJNLk NDwri8x6omGHimORs+5rrRlu0b1Ttu3Q4S7pCN7amVe8XG//TvM96JcGSDMiasUP6/CHd0 nlelszmeTEOYmTPVFkk9ng9meFAwX7B/Rn8WHtQVBoaHPnir8oJCLkwgD+/i/VS+OSXGWI uJVZ05/195J1yJv1UdVp5BBBeXPjA3exdfObqcJaeIypgk6rpBNj/df2YAyM/w== 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=1745423051; 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=3xIv9dt2fI+k+3+MvUjvN3jV8QolAKgnGvctTntONXc=; b=gPAO6VzDb1rrDDuwhJF3cNzBRmAx90+tRHx0eByWLTzhbRyphfzjgcZYmSTpunX7y0WDgm fp8L+Juo9w767wGPgsgY304zo+4jnZ+osG9YoNquuQJ7jDieM0oDnj9SwdpvDzugMB1z9V eyqHaCEOg44/bnhclv2dRZMaF6ygYDGtsR3TnPyULoBzMiD46W1senqsqnsRP80yIPgmV2 a/E1f19AdHdYyFxq8gJkB3ApFcABrrb5C4b2yKI4xutd6IBf6XT1zfJhJxgIhZzoD6codm AxqpcUWYHZjFSSjkvfmAGegpeXXaQRngYfU/nzCh0lLbNlPFaKQcgYVoYG2J7g== 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 4ZjNgv0vgMz18ql; Wed, 23 Apr 2025 15:44:11 +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 53NFiBBu006282; Wed, 23 Apr 2025 15:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53NFiB2v006279; Wed, 23 Apr 2025 15:44:11 GMT (envelope-from git) Date: Wed, 23 Apr 2025 15:44:11 GMT Message-Id: <202504231544.53NFiB2v006279@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: 9c4f1497dae7 - main - Move extra suffix-transformation rules into bsd.suffixes-extra.mk 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c4f1497dae7832e2727682e9161ca9572e56dfe Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9c4f1497dae7832e2727682e9161ca9572e56dfe commit 9c4f1497dae7832e2727682e9161ca9572e56dfe Author: Dimitry Andric AuthorDate: 2025-04-22 18:26:56 +0000 Commit: Dimitry Andric CommitDate: 2025-04-23 15:42:22 +0000 Move extra suffix-transformation rules into bsd.suffixes-extra.mk To make it possible to use the .SUFFIXES list and suffix-transformation rules from bsd.lib.mk in other places, move them to a separate file, bsd.suffixes-extra.mk. Note that we cannot add the list and rules to bsd.suffixes.mk, since that file also gets included by sys.mk, which applies to non-source builds. That would require a whole ports exp-run. No functional change intended. Reviewed by: brooks, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49965 --- share/mk/Makefile | 1 + share/mk/bsd.lib.mk | 74 +--------------------------------------- share/mk/bsd.suffixes-extra.mk | 76 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 73 deletions(-) diff --git a/share/mk/Makefile b/share/mk/Makefile index ec9af16d24c3..29de04f89670 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -50,6 +50,7 @@ FILES= \ bsd.progs.mk \ bsd.snmpmod.mk \ bsd.subdir.mk \ + bsd.suffixes-extra.mk \ bsd.suffixes-posix.mk \ bsd.suffixes.mk \ bsd.symver.mk \ diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index b33366604b4c..01dd979af155 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -148,79 +148,7 @@ CFLAGS += -mno-relax .include -# prefer .s to a .c, remove stuff not used in the BSD libraries -# .pico used for PIC object files -# .nossppico used for NOSSP PIC object files -# .pieo used for PIE object files -.SUFFIXES: .out .o .bc .ll .pico .nossppico .pieo .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln - -.if !defined(PICFLAG) -PICFLAG=-fpic -PIEFLAG=-fpie -.endif - -.c.pico: - ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.c.nossppico: - ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.c.pieo: - ${CC} ${PIEFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.cc.pico .C.pico .cpp.pico .cxx.pico: - ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} - -.cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico: - ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} - -.cc.pieo .C.pieo .cpp.pieo .cxx.pieo: - ${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} - -.f.pico: - ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} - ${CTFCONVERT_CMD} - -.f.nossppico: - ${FC} ${PICFLAG} -DPIC ${FFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} -o ${.TARGET} -c ${.IMPSRC} - ${CTFCONVERT_CMD} - -.s.pico .s.nossppico .s.pieo: - ${CC:N${CCACHE_BIN}} -x assembler ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.asm.pico: - ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.asm.nossppico: - ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ - ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.asm.pieo: - ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PIEFLAG} -DPIC \ - ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.S.pico: - ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.S.nossppico: - ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.S.pieo: - ${CC:N${CCACHE_BIN}} ${PIEFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} +.include _LIBDIR:=${LIBDIR} _SHLIBDIR:=${SHLIBDIR} diff --git a/share/mk/bsd.suffixes-extra.mk b/share/mk/bsd.suffixes-extra.mk new file mode 100644 index 000000000000..629c3177cec7 --- /dev/null +++ b/share/mk/bsd.suffixes-extra.mk @@ -0,0 +1,76 @@ +.if !target(____) +____: .NOTMAIN + +# prefer .s to a .c, remove stuff not used in the BSD libraries +# .pico used for PIC object files +# .nossppico used for NOSSP PIC object files +# .pieo used for PIE object files +.SUFFIXES: .out .o .bc .ll .pico .nossppico .pieo .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln + +PICFLAG?=-fpic +PIEFLAG?=-fpie + +.c.pico: + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.c.nossppico: + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.c.pieo: + ${CC} ${PIEFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.cc.pico .C.pico .cpp.pico .cxx.pico: + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico: + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} + +.cc.pieo .C.pieo .cpp.pieo .cxx.pieo: + ${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.f.pico: + ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} + ${CTFCONVERT_CMD} + +.f.nossppico: + ${FC} ${PICFLAG} -DPIC ${FFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} -o ${.TARGET} -c ${.IMPSRC} + ${CTFCONVERT_CMD} + +.s.pico .s.nossppico .s.pieo: + ${CC:N${CCACHE_BIN}} -x assembler ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.asm.pico: + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ + ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.asm.nossppico: + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ + ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.asm.pieo: + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PIEFLAG} -DPIC \ + ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.S.pico: + ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ + -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.S.nossppico: + ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} ${ACFLAGS} \ + -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.S.pieo: + ${CC:N${CCACHE_BIN}} ${PIEFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ + -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.endif # !target(____)