From nobody Mon Jun 27 14:22:56 2022 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 3C81F87FADE; Mon, 27 Jun 2022 14:22:57 +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 4LWqh10s63z3tSf; Mon, 27 Jun 2022 14:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656339777; 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=z6E7AeVQgQAx8nzZs3njQXDVocL6CtlHRdzxKEMidi0=; b=wTQ3KOhxQRMiMjVCEjnT3MWaFhuRWNvX9ZfRVyXkDVyiP3drR2xnJPTNE/PabIr0JzS86G Vtpy6eCm7GQzGKTxSf5pmQhxQhxxzhZcL5jXCmVMazRA3zaYpKIOO4dw8jJLqmmgQv2SKX dkKiVuIBzs6qeHAxx4cY9Ht8fPWRE0YQlVYsl9VvplwOojl6vA67MzGwF47aVztBks/YJF 2kLDIK9giAvcDcptrHYVneCztssAQDHus2nd9EOiXm5gi3j2KN8rlGO14uGMnBC+usXZ6Q sPxUf00RY9/bJ7yi89LAxofzMFD1XVguysKfQpAU7fjYjKZ8g1oTcJloPy3bTw== 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 F1B811E8A; Mon, 27 Jun 2022 14:22:56 +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 25REMuuG096638; Mon, 27 Jun 2022 14:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25REMuWS096637; Mon, 27 Jun 2022 14:22:56 GMT (envelope-from git) Date: Mon, 27 Jun 2022 14:22:56 GMT Message-Id: <202206271422.25REMuWS096637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7927452ac4e9 - main - Fix cross-builds from 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 7927452ac4e98309bd832d55526cc98438fba8a5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656339777; 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=z6E7AeVQgQAx8nzZs3njQXDVocL6CtlHRdzxKEMidi0=; b=siNqnxxCxWsQKGw4HIgnk5tlW10uh/4AmI3kKU1FVHhh4vqwp4QnqJkGNERSjypKEAbTWp P/Kr+K6wPXyzogo+LW9f0TxL16FHIuCqaDHrOJ86uYq9THg7U/IWmnbhR59LIxG/y29A0C h1DyDvumGh6R6lEjN76+dwK61uON5DMDmpAWF1bniEV/UIn/++db98mFg5nwxBZNkKxUqH /YdCPvGqeUGlyw6YknQcfj/9OfgACLj3byrBtru0SG+B+KapgNzOLRWA5zeRbJxKLe1l+b DyiKinRw+qjKYs7ihXKHxl0SYf9rwcwle8dyzJ9J5SyIVN9+kxIbqBy23n40Jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656339777; a=rsa-sha256; cv=none; b=l8a3+i7Ey4JOWZFnyd4s2/npNzHB12Tvc9Xd5+oWhbr2WTGPctG3bRHr/CNl/46xkVERph FPWHLxiQ1hccxc5cDyTFhckpJrBPJT0cYFcXsdI2ZidrU9/swVg131utZAZCPYm9ZOn1jk gbYpizKmZoLN9g5icSw7989yX+wfcGiqxR00E7dKcgPuGXGc6QonHTY/F3s5+gfrE8K1AF JmbIudv1h8hsAz3QfBLs9bx4jIPLy9162+kSUw2/O/VQnj3jqlJJy6240vaGJHRbLwpWS/ /IOAXhYX2MXpUJtYTVhOwqPDjdW7/K90BQyHkGBrwPWQRNpvOt0nX623J70Hfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7927452ac4e98309bd832d55526cc98438fba8a5 commit 7927452ac4e98309bd832d55526cc98438fba8a5 Author: Ed Maste AuthorDate: 2022-06-26 17:23:39 +0000 Commit: Ed Maste CommitDate: 2022-06-27 14:22:12 +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 --- 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 9ba08a7ca619..8fa23f6da9bf 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -79,11 +79,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 eed7d652fad1..c53ecd8a4dc2 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"