From nobody Wed Dec 15 22:35:57 2021 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 28E3418E4535; Wed, 15 Dec 2021 22:35:58 +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 4JDqpP5rvYz4lhW; Wed, 15 Dec 2021 22:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9BAE424731; Wed, 15 Dec 2021 22:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BFMZvbe094240; Wed, 15 Dec 2021 22:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BFMZv0i094239; Wed, 15 Dec 2021 22:35:57 GMT (envelope-from git) Date: Wed, 15 Dec 2021 22:35:57 GMT Message-Id: <202112152235.1BFMZv0i094239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7a171e30836d - main - test-includes: Build a library instead of a binary 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a171e30836d1aa9870489e692f0ed56fbd45756 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639607757; 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=styh7IzCYiBDKmGvxUWflVi63skinRpT9To5+2LKXtk=; b=vRscdKz83zoIQJY4c9ox6vB68gw1GfaD72ObSj8dE502003FFWjXdNarJlSRmwniqx7ZiX JmRLqAxEdHkBymqQ3HOD1WGO56OopjImWapCVT9VkZ/KSektRjpjNvdlMtfnxyCGzPxYVg MQU26YX4VxnViXUeOoH8mpJK23xZtsnFwRML0fASg3RXbz8HyKbq1o0Zppfc248YAH+nkr PS9g4hcg+2folIBM6IvDbjPhz8TSni8ahJESQ77JXWJHyH3XfBtlT4FlFxvp9Cb3aD0v96 CKe7yNvhMfGd0GrLY5S3sSPCwEmWKN3tVIaMRwxjjkZn+6jTrdY0BBNtXmEXnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639607757; a=rsa-sha256; cv=none; b=B//VW1o+MWhcy/0UC/4/GqZbTGaYGAYmDafpEcTM8GRd1YjTTi/PmxuUB4iVP8CCy/RzuQ zNjhFOqIdn5uzSKXLtEbF6kF9sATs4k48lyckYCIxuuFjlxGP8US4ahok4fogtQTkjpT5n EKkgboh/fiJNv1/vTiU5kKUH3OmABlYFDhwf3CkCpS1XBKenH0jvI5kJg39a91SPgUrHi6 K3wDmYZGsTY4zkA3BHMDiZGSUQXTMNUx8Rs7jHU2WwxN3FjhXu8pTeRZe1L5jjxugsZLqi jyqSWDrdqYAKG7SUsQFBabzUFNDBxRSxeKN65Db/TOgljyKYg1Res34SCd38MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a171e30836d1aa9870489e692f0ed56fbd45756 commit 7a171e30836d1aa9870489e692f0ed56fbd45756 Author: Warner Losh AuthorDate: 2021-12-15 22:34:47 +0000 Commit: Warner Losh CommitDate: 2021-12-15 22:35:24 +0000 test-includes: Build a library instead of a binary We need to build the .o's, but don't need to link. Build a static library instead of a binary to accmoplish this. This removes the need to have all the libc and crt stuff built, which is required for a binary. In addition, trying to build a non-standard binary runs into trouble with undefined symbols on arm related to EABI, even when using a simplified startup with -nostdlib -e start. Turn back on testing includes, now that it works. Sponsored by: Netflix Reviewed by: brooks, markj (prior version) Differential Revision: https://reviews.freebsd.org/D33452 --- Makefile.inc1 | 1 + tools/build/test-includes/Makefile | 10 ++++++---- tools/build/test-includes/test-includes.c | 7 ------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index e03588511954..963ffac7d09b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1128,6 +1128,7 @@ _includes: .if !empty(SUBDIR_OVERRIDE) && make(buildworld) ${_+_}cd ${.CURDIR}; ${WMAKE} MK_INCLUDES=yes SHARED=symlinks includes .endif + ${_+_}cd ${.CURDIR}; ${WMAKE} test-includes _libraries: @echo @echo "--------------------------------------------------------------" diff --git a/tools/build/test-includes/Makefile b/tools/build/test-includes/Makefile index b42497e0397d..b1e5023663af 100644 --- a/tools/build/test-includes/Makefile +++ b/tools/build/test-includes/Makefile @@ -13,11 +13,11 @@ # programs to detect FreeBSD has different headers, omitting internal # headers cuts down on the noise w/o causing problems for the goal. # -PROG= test-includes -SRCS= test-includes.c -INTERNALPROG= This is a compile-only test +LIB= test-includes +INTERNALLIB= This is a compile-only test MAN= HDRS!= (cd ${SRCTOP}/sys; ls sys/[^_]*.h net*/[^_]*.h) +NO_PIC= yes # Some files have to be clean for extra defines too... CFLAGS.event.c= -D_WANT_KEVENT32 -D_WANT_FREEBSD11_KEVENT @@ -33,6 +33,8 @@ ${h:R}.c: .endif .endfor +test-includes: lib${LIB}.a .PHONY + # # Target to make the current known bad list. In general, this list should only # ever shrink and never grow. @@ -49,4 +51,4 @@ badfiles.inc: done; \ echo) > ${.CURDIR}/badfiles.inc -.include +.include diff --git a/tools/build/test-includes/test-includes.c b/tools/build/test-includes/test-includes.c deleted file mode 100644 index 5518813d8f18..000000000000 --- a/tools/build/test-includes/test-includes.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Public domain */ - -int -main(void) -{ - return 0; -}