From nobody Thu Jul 25 22:54:30 2024 X-Original-To: dev-commits-ports-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 4WVR5y5P7Kz5RTZ2; Thu, 25 Jul 2024 22:54:30 +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 4WVR5y4X3qz4SjK; Thu, 25 Jul 2024 22:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721948070; 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=RX10UFwb4hF+3Xqt2+Tk8wIbZdIgGfKERP/htFkCEyA=; b=IuwzoZ6RObFHfWTvek52DARYh9I0D0SP3HSJVM6Lp/2kckKDV9lTg55BD9xQjMVZoNKIWC 4xts3X8mIMjTqzfg6X37huhXWscTrSAshfdjvFt2Vk+mquxm6K5EMrqMw52kyesDFM4Y4q VheLPwY9LbPk7VxTFgm3CDSUbHFEIUQUjtRQ0TMUgjncqyDkIDUJ4O+1mIeKxQVStf9h4P FuBQ1OMvx8Gf/LnLYX7adWobgldRRdKQl0ppRjgP5h1JFD0Fx3CqwGCaM0MZeI/4ssWsxd tC+La78eTqtHlWTUXkYDK8iTTsRZWhm4NOZrJIz30KcGQL62jqxcq43Jk+PYpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721948070; a=rsa-sha256; cv=none; b=JhS3a5BhFnhkdNX4AAU2DVllHKTun5zEHWJif8dUxuPvok8Tjlet4CTxwJmA4TbTXZc8h8 U4evAS7w4aBLJRb1s5tzmV829lMZOaMKHKpdjp//hGjg/vDUcKHx6DxMSs+/9l3mpY8BS8 Xy7fUz7Dm5QmnE10o/Qw+kD6mJcI48B36chlbntBh8wF72VIi7OCdmjnlSvuuJWpqw5xqL OAqvKcp7PZil+WPfvbKHHnjxUrF/UeTE16nkgkVOj8vb7QdbpwMKkSTlmoIvYPQgShOPPT yKM9xn6h5KzeRZZh5I0ZhCAK4W7QujQLGxWGB61+ftkkvDLdmjvBWmJHUTOJ3A== 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=1721948070; 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=RX10UFwb4hF+3Xqt2+Tk8wIbZdIgGfKERP/htFkCEyA=; b=ioC0HWxrPRhaCrU68sRovAkPz9OOPj9VhZXjuV6ZH3bgSfRdQp/tVaIcM3Fd9dIBCh03iS NzfbJano+/Gg0bl0j4Grygbyl6uyIZnRnOYdOicd4DOizRQIIUmiGegsmveWkWoF09XsTw +KH4p753aE78QzVbhlnTSotZQV4W88iBGI7uap0a6hKmSRdFX39FpAqhan8Tww+3xh2Z1o o2EBYqnS+vxKIOLd+6egmVq+M0tElXFev21MdFQQ8o+ckkdiXFWWbGFkAu/wInMJynkPdI IyNt51TadkTGmSDOcqfraqIIfklL+76OoWsmOOZ6165Nzw25TYEiy4RUwj6n/A== 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 4WVR5y48bLz1DHJ; Thu, 25 Jul 2024 22:54:30 +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 46PMsUng080088; Thu, 25 Jul 2024 22:54:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PMsUGj080085; Thu, 25 Jul 2024 22:54:30 GMT (envelope-from git) Date: Thu, 25 Jul 2024 22:54:30 GMT Message-Id: <202407252254.46PMsUGj080085@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Brooks Davis Subject: git: 1a76ace6f32b - 2024Q3 - devel/llvm18: Backport __stack_chk_guard fix List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-branches@freebsd.org Sender: owner-dev-commits-ports-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/2024Q3 X-Git-Reftype: branch X-Git-Commit: 1a76ace6f32b1d5b91a4d4054814d125b9ba3a5b Auto-Submitted: auto-generated The branch 2024Q3 has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=1a76ace6f32b1d5b91a4d4054814d125b9ba3a5b commit 1a76ace6f32b1d5b91a4d4054814d125b9ba3a5b Author: Brooks Davis AuthorDate: 2024-07-15 21:50:48 +0000 Commit: Brooks Davis CommitDate: 2024-07-25 22:29:34 +0000 devel/llvm18: Backport __stack_chk_guard fix Backport upstream commit commit 26464f2662d1 which marks __stack_chk_guard dso_local except for PPC64 to fix loading an x86 kernel build with --fstack-protector. Also update to 18.1.8. From a packaging perspective this only bumps the version number since it only touchs libc++ which we don't ship. As such, I'd waited to bundle this bump with a functional change. Drop releases.llvm.org, the LLVM project seems to nonlonger update it. Co-authored by: Ahmad Khalifa Pull Request: https://github.com/freebsd/freebsd-ports/pull/283 (cherry picked from commit 772e9ff110df8a8485f4e417c648b626dd829e9e) --- devel/llvm18/Makefile | 5 +- devel/llvm18/distinfo | 6 +-- devel/llvm18/files/patch-backport-26464f2662d1 | 70 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 6 deletions(-) diff --git a/devel/llvm18/Makefile b/devel/llvm18/Makefile index 1b1f759ba50e..5148732975be 100644 --- a/devel/llvm18/Makefile +++ b/devel/llvm18/Makefile @@ -1,9 +1,8 @@ PORTNAME= llvm -DISTVERSION= 18.1.7 +DISTVERSION= 18.1.8 PORTREVISION= 0 CATEGORIES= devel lang -MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ - https://${PRE_}releases.llvm.org/${LLVM_RELEASE}${RCDIR}/ +MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ PKGNAMESUFFIX= ${LLVM_SUFFIX} DISTNAME= llvm-project-${DISTVERSION}.src DISTFILES= llvm-project-${DISTVERSION}.src${EXTRACT_SUFX} diff --git a/devel/llvm18/distinfo b/devel/llvm18/distinfo index 990cb1881098..f7c8f9816f75 100644 --- a/devel/llvm18/distinfo +++ b/devel/llvm18/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1717778597 -SHA256 (llvm-project-18.1.7.src.tar.xz) = 74446ab6943f686391954cbda0d77ae92e8a60c432eff437b8666e121d748ec4 -SIZE (llvm-project-18.1.7.src.tar.xz) = 132063384 +TIMESTAMP = 1719009196 +SHA256 (llvm-project-18.1.8.src.tar.xz) = 0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a +SIZE (llvm-project-18.1.8.src.tar.xz) = 132067260 diff --git a/devel/llvm18/files/patch-backport-26464f2662d1 b/devel/llvm18/files/patch-backport-26464f2662d1 new file mode 100644 index 000000000000..94fb0c94e94f --- /dev/null +++ b/devel/llvm18/files/patch-backport-26464f2662d1 @@ -0,0 +1,70 @@ +From 26464f2662d13c7c6ef9f8180b1653c046cd60a7 Mon Sep 17 00:00:00 2001 +From: Justin Cady +Date: Wed, 27 Mar 2024 09:03:46 -0400 +Subject: [PATCH] [FreeBSD] Mark __stack_chk_guard dso_local except for PPC64 + (#86665) + +Adjust logic of 1cb9f37a17ab to match freebsd/freebsd-src@9a4d48a645a7a. + +D113443 is the original attempt to bring this FreeBSD patch to +llvm-project, +but it never landed. This change is required to build FreeBSD kernel +modules +with -fstack-protector using a standard LLVM toolchain. The FreeBSD +kernel +loader does not handle R_X86_64_REX_GOTPCRELX relocations. + +Fixes #50932. +--- + llvm/lib/CodeGen/TargetLoweringBase.cpp | 3 ++- + llvm/test/CodeGen/X86/stack-protector.ll | 9 +++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git llvm/lib/CodeGen/TargetLoweringBase.cpp llvm/lib/CodeGen/TargetLoweringBase.cpp +index 9990556f89ed8..b16e78daf5861 100644 +--- llvm/lib/CodeGen/TargetLoweringBase.cpp ++++ llvm/lib/CodeGen/TargetLoweringBase.cpp +@@ -2073,7 +2073,8 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const { + // FreeBSD has "__stack_chk_guard" defined externally on libc.so + if (M.getDirectAccessExternalData() && + !TM.getTargetTriple().isWindowsGNUEnvironment() && +- !TM.getTargetTriple().isOSFreeBSD() && ++ !(TM.getTargetTriple().isPPC64() && ++ TM.getTargetTriple().isOSFreeBSD()) && + (!TM.getTargetTriple().isOSDarwin() || + TM.getRelocationModel() == Reloc::Static)) + GV->setDSOLocal(true); +diff --git llvm/test/CodeGen/X86/stack-protector.ll llvm/test/CodeGen/X86/stack-protector.ll +index a277f9f862ab2..f4f3ae4f55f2e 100644 +--- llvm/test/CodeGen/X86/stack-protector.ll ++++ llvm/test/CodeGen/X86/stack-protector.ll +@@ -1,6 +1,7 @@ + ; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-I386 %s + ; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-X64 %s + ; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-KERNEL-X64 %s ++; RUN: llc -code-model=kernel -mtriple=x86_64-unknown-freebsd < %s -o - | FileCheck --check-prefix=FREEBSD-KERNEL-X64 %s + ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | FileCheck --check-prefix=DARWIN-X64 %s + ; RUN: llc -mtriple=amd64-pc-openbsd < %s -o - | FileCheck --check-prefix=OPENBSD-AMD64 %s + ; RUN: llc -mtriple=i386-pc-windows-msvc < %s -o - | FileCheck -check-prefix=MSVC-I386 %s +@@ -75,6 +76,10 @@ entry: + ; LINUX-X64: mov{{l|q}} %fs: + ; LINUX-X64: callq __stack_chk_fail + ++; FREEBSD-KERNEL-X64-LABEL: test1b: ++; FREEBSD-KERNEL-X64-NOT: mov{{l|q}} __stack_chk_guard@GOTPCREL ++; FREEBSD-KERNEL-X64: callq __stack_chk_fail ++ + ; LINUX-KERNEL-X64-LABEL: test1b: + ; LINUX-KERNEL-X64: mov{{l|q}} %gs: + ; LINUX-KERNEL-X64: callq __stack_chk_fail +@@ -118,6 +123,10 @@ entry: + ; LINUX-X64: mov{{l|q}} %fs: + ; LINUX-X64: callq __stack_chk_fail + ++; FREEBSD-KERNEL-X64-LABEL: test1c: ++; FREEBSD-KERNEL-X64: mov{{l|q}} __stack_chk_guard(%rip) ++; FREEBSD-KERNEL-X64: callq __stack_chk_fail ++ + ; LINUX-KERNEL-X64-LABEL: test1c: + ; LINUX-KERNEL-X64: mov{{l|q}} %gs: + ; LINUX-KERNEL-X64: callq __stack_chk_fail