From nobody Tue Aug 19 04:28:06 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 4c5c5L71zmz60HpS; Tue, 19 Aug 2025 04:28:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c5c5L5xVVz3Mrx; Tue, 19 Aug 2025 04:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755577686; 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=6ZVHaTHgK9/H0x9hIz70lVuaxHlrvgz7q3YA3JvsPO4=; b=BHl5SmiwJ5e+h7nxlyxiRqstzG3njRwDsx/cecLTzjd34evi7dNM11B1+Uk6ZgX73j6uT1 e9/FTVLAzy6Nro7sdUF2/zs42baAaBlLDHCSHMExvIRbLJKK9m8QgEBLJKs8GTkGbK2TL5 KuKxW8DBrjfKDKUxxnSqv8hVP2gP0UcdG5EpPJxC2aN3bhlcXjbaoguYLsjBDvDNO09rgG OcQY4JmA77ntZTOsXq/u24gaTZuyKh4Tt6oWNxftTrliuWlHSKBtU1Feivn9//wR7MeMip nxW4Qr/q60F/SVYBhQb3nZzsweZFC8BPRWSJAj8CJIXQS4tyDSb0FdkT9Lyohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755577686; 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=6ZVHaTHgK9/H0x9hIz70lVuaxHlrvgz7q3YA3JvsPO4=; b=FAScbdhV+TjtbpL7ljVhyPDaHIBAjyyLARFlpo09TBiH8cc25X3gQ0q2QagDirmcIO2mCl B0Z9PApnsHDLVVgqROeh3AzLKCIt6Rke//v9bxsc7A/GDRARAvaINMBga068AXs3EHYms0 WiWX0a0V3HDa9cP7LFO7qXujMQgH/pL0iser0MjnoXw+CAhu3no2x6vfn3mcuTz3YYAMLg Ftkqc1GY0oEEXIN1ANMc4gb94T0K9chsA9OJPLasocACQ/QeYM4u2r48WwwTawKrQZLUQu 4A8et0mL/EpvN/n2vwz0dqmQxwU1QdCasOQpT9tcecSKYmczEfvz3PRkXup+1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755577686; a=rsa-sha256; cv=none; b=NOwRlgGqtKL0Qsyf2k/QL4l7XCn+/up6SS/yBqBjKN/9fU420y2VOb9NWvoq80ZyWUQsiV Fxroc2BrnaUfno2maWKN+EvUBqBsXW0gxqLSfX0ER1Oevdzj95o04rOLubXF2gi4LX2Pof mrFS/Pio6xCq/dfOwWyCKyemN11WS7X3cMBxyUVRawwLf+cJpD2idaWWpVS0UjMCy48K8F zS2Dk8cEUzgHuwUlAEv434hKpmmYhyWybo34RtAsXVFmy+gtj8qbDXeVfVfS56A1OQRxwM FTZDKh+Hknz/YFxif/oO86yZtPSvjCpgStgNizmIRMiwQNskAnezfG7BypGJbg== 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 4c5c5L5P2Rz1QL2; Tue, 19 Aug 2025 04:28:06 +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 57J4S6Wl030587; Tue, 19 Aug 2025 04:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57J4S6or030584; Tue, 19 Aug 2025 04:28:06 GMT (envelope-from git) Date: Tue, 19 Aug 2025 04:28:06 GMT Message-Id: <202508190428.57J4S6or030584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: aef16fc30bb2 - main - build: remove certctl requirement for host OpenSSL libs on macOS 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aef16fc30bb2298e65a5fcc0c503d343e428c1b2 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=aef16fc30bb2298e65a5fcc0c503d343e428c1b2 commit aef16fc30bb2298e65a5fcc0c503d343e428c1b2 Author: Kyle Evans AuthorDate: 2025-08-16 18:34:30 +0000 Commit: Kyle Evans CommitDate: 2025-08-19 04:27:59 +0000 build: remove certctl requirement for host OpenSSL libs on macOS Some platforms, like macOS, do not expose headers for the system's libcrypto for public consumption. libcrypto is relatively heavy and needs to know, e.g., the host system's endianness, so we scope the build down to macOS where OpenSSL headers are known to not be present and we can be reasonably certain that most of the systems today that would be cross-building are little endian. We still don't bother if building WITHOUT_OPENSSL since the end result is expected to be used by OpenSSL, but perhaps we could revisit that independently in case one, e.g., brings their own implementation. Reported by: jrtc27 Reviewed by: jrtc27, ngie Fixes: c340ef28fd38 ("certctl: Reimplement in C") Differential Revision: https://reviews.freebsd.org/D51935 --- Makefile.inc1 | 9 ++++++++- secure/lib/libcrypto/Makefile | 5 ++++- secure/lib/libcrypto/Makefile.common | 2 +- share/mk/bsd.endian.mk | 13 ++++++++++--- tools/build/Makefile | 1 + 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 3f35dafc6441..861d368af838 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2709,8 +2709,14 @@ _basic_bootstrap_tools+=sbin/md5 _basic_bootstrap_tools+=usr.sbin/tzsetup .endif -# certctl is needed as an install tool +# certctl is needed as an install tool. libcrypto is rather heavy, so we'll +# build that alongside it only for platforms that don't expose headers for +# OpenSSL, like macOS. .if ${MK_CAROOT} != "no" && ${MK_OPENSSL} != "no" +.if ${.MAKE.OS} == "Darwin" +_bootstrap_libcrypto=secure/lib/libcrypto +${_bt}-usr.sbin/certctl: ${_bt}-secure/lib/libcrypto +.endif _certctl=usr.sbin/certctl .endif @@ -2777,6 +2783,7 @@ bootstrap-tools: ${_bt}-links .PHONY ${_strfile} \ usr.bin/dtc \ ${_cat} \ + ${_bootstrap_libcrypto} \ ${_certctl} \ ${_kbdcontrol} \ ${_elftoolchain_libs} \ diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index e7e491124241..7e2350fb33ea 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -1,7 +1,10 @@ SHLIBDIR?= /lib -.if !defined(LIBCRYPTO_WITHOUT_SUBDIRS) +.if !defined(LIBCRYPTO_WITHOUT_SUBDIRS) && !defined(BOOTSTRAPPING) SUBDIR= engines modules .endif +.ifdef BOOTSTRAPPING +CFLAGS+= -DOPENSSL_NO_SCTP +.endif .include .include diff --git a/secure/lib/libcrypto/Makefile.common b/secure/lib/libcrypto/Makefile.common index afcc2a48660c..ad48e2b434cf 100644 --- a/secure/lib/libcrypto/Makefile.common +++ b/secure/lib/libcrypto/Makefile.common @@ -6,7 +6,7 @@ CFLAGS+= -DL_ENDIAN CFLAGS+= -DB_ENDIAN .endif -.ifndef WITHOUT_AUTO_ASM +.if !defined(WITHOUT_AUTO_ASM) && !defined(BOOTSTRAPPING) .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" ASM_${MACHINE_CPUARCH}= diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk index ba662ffc7439..24da57954b5a 100644 --- a/share/mk/bsd.endian.mk +++ b/share/mk/bsd.endian.mk @@ -20,10 +20,17 @@ LOCALEDEF_ENDIAN= -b # # During bootstrapping on !FreeBSD OSes, we need to define some value. Short of # having an exhaustive list for all variants of Linux and MacOS we simply do not -# set TARGET_ENDIANNESS and poison the other variables. They should be unused -# during the bootstrap phases (apart from one place that's adequately protected -# in bsd.compiler.mk) where we're building the bootstrap tools. +# set TARGET_ENDIANNESS (on Linux) and poison the other variables. They should +# be unused during the bootstrap phases (apart from one place that's adequately +# protected in bsd.compiler.mk) where we're building the bootstrap tools. # +.if ${.MAKE.OS} == "Darwin" +# We do assume the endianness on macOS because Apple's modern hardware is all +# little-endian. This might need revisited in the far future, but for the time +# being Apple Silicon's reign of terror continues. We only set this one up +# because libcrypto is now built in bootstrap. +TARGET_ENDIANNESS= 1234 +.endif CAP_MKDB_ENDIAN= -B # Poisoned value, invalid flags for both cap_mkdb LOCALEDEF_ENDIAN= -B # and localedef. .endif diff --git a/tools/build/Makefile b/tools/build/Makefile index 83f589ce3864..3c4e07e3cfc2 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -495,6 +495,7 @@ INSTALLDIR_LIST= \ bin \ lib/geom \ usr/include/casper \ + usr/include/openssl \ usr/include/private/ucl \ usr/include/private/zstd \ usr/lib \