From nobody Thu Jul 27 17:11:22 2023 X-Original-To: dev-commits-src-branches@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 4RBck25FDMz4pZxn; Thu, 27 Jul 2023 17:11:22 +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 4RBck24mrDz3Lk9; Thu, 27 Jul 2023 17:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690477882; 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=PM17g7+VyNYlXk+kpUm1EAAqDUmdEu7HyTMEPC3Un34=; b=fgay3JBrazrju555wpQD+yCjc+cv766zxsS27IcfZC3XMwkP4xgSuQlmDojlq3Fr3KzTnS PmffZ6ZdfWT6UROrhxSolhLLUl/wlLSVTPD/Vrq2cyDYNKHVZlaVxyluhplYMuNGo2ygNZ vYbAD+/MJX14EY2xqOV1h7yE4GfOG080o/QVOFSkdTqb8vkuZBFFnmdZJzu48x4PtOABYF S1fITNg5tldepkUVyOt3VZo2/2x2yN4u/C5BpX86cSahk696piFMoR2tebANcY6hRQQ3v/ 5qxaMXbN09Bf0hLva3+C544mZTlqRhvoYLok90iEqvsE++xwYOJOTcAJ69ivcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690477882; 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=PM17g7+VyNYlXk+kpUm1EAAqDUmdEu7HyTMEPC3Un34=; b=Fsgwn2DXyYN5u5sAYUuOcSKsCPVXsMtRm958m4ErEnhShs+pOas/rt82QCfJWWEDAWio5C lPAlzcpruZ7oyhxQS41YcW7SXY7vL8tn497d9sFfDF58R0rRVATXqEj89Venwh9OHp1Dlg znlPbOgzS33sZLy3CA2eNblmaZKbI7NMZCqxekFnWuOroMTxVy2/haWESiILdo5XkF15d3 NYvb0ZpimjOYVXbPT2ekqf6UeMUgXMcpPL8fL/vekFND2grOZQ4fxeHToBDWUXa1iEbZot 5McfbAPq7lVuRShrswwRcfJwovJQkKU5HMzjaxS8psyxhDeGm1KOvYRX12G+rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690477882; a=rsa-sha256; cv=none; b=InBqE4Vyg+xgkcO7tsnGl8gTMT+t18qCncTgBPpjG9FBgboz+8haXxoc/SX4R4K756eQtd JCxJWW7b8FYs5NIXoivH/NOkqbmHHBZsOGTf7ZuVOsfYp7za1vNNRJf7xdNBTSmiJkb0BM irGqLcOB/ynD99x8Gqig0OFKoWyPrNim4DhD7pvbvQlaMW0Oc4XKfwZhtDmfOhipBePqF+ MJTPygC0v6jQeiz6a9HCbEiY67JUDc77iuM8YvAL8+jJAbs9aj9jdnshOqbVOCPDWN4PZX 4nXzRAoesOxYXLcZjvMpolq+XcDhFmHfZcMg7NkByUjoIWt62a5GtM/m4b9Idg== 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 4RBck23szGzJ9X; Thu, 27 Jul 2023 17:11:22 +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 36RHBMfA082858; Thu, 27 Jul 2023 17:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36RHBMW8082857; Thu, 27 Jul 2023 17:11:22 GMT (envelope-from git) Date: Thu, 27 Jul 2023 17:11:22 GMT Message-Id: <202307271711.36RHBMW8082857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f629a82680ea - stable/13 - Fix cross-builds from macOS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f629a82680ea9abbd646e43bdc684ed3fb49eaff Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f629a82680ea9abbd646e43bdc684ed3fb49eaff commit f629a82680ea9abbd646e43bdc684ed3fb49eaff Author: Ed Maste AuthorDate: 2022-06-26 17:23:39 +0000 Commit: Ed Maste CommitDate: 2023-07-27 17:10:23 +0000 Fix cross-builds from macOS The macOS linker does not support -zrelro/-znorelro. Since it is only used to for build tools that run on the host, and WITH_RELRO or WITHOUT_RELRO does not matter there, just skip the option. Reviewed by: markj Fixes: 2f3a961487c9 ("Add RELRO build knob, default to enabled") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35589 (cherry picked from commit 7927452ac4e98309bd832d55526cc98438fba8a5) --- share/mk/bsd.lib.mk | 2 ++ share/mk/bsd.prog.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 5cd5663e1ca7..900bc00f0f03 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -77,11 +77,13 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .if ${MK_BIND_NOW} != "no" LDFLAGS+= -Wl,-znow .endif +.if ${LINKER_TYPE} != "macos" .if ${MK_RELRO} == "no" LDFLAGS+= -Wl,-znorelro .else LDFLAGS+= -Wl,-zrelro .endif +.endif .if ${MK_RETPOLINE} != "no" .if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline} CFLAGS+= -mretpoline diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 3b9b3277a241..d044fed0aeb7 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -41,11 +41,13 @@ MK_DEBUG_FILES= no .if ${MK_BIND_NOW} != "no" LDFLAGS+= -Wl,-znow .endif +.if ${LINKER_TYPE} != "macos" .if ${MK_RELRO} == "no" LDFLAGS+= -Wl,-znorelro .else LDFLAGS+= -Wl,-zrelro .endif +.endif .if ${MK_PIE} != "no" # Static PIE is not yet supported/tested. .if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"