From nobody Fri Dec 9 18:49:46 2022 X-Original-To: dev-commits-ports-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 4NTKnk4wB0z4jybR; Fri, 9 Dec 2022 18:49:46 +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 4NTKnk4KwKz3Qqc; Fri, 9 Dec 2022 18:49:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670611786; 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=LCmz6hqp1N8pk7oVo0BgcWVDLMzUua+3NdPVT8uObIo=; b=oyL8xmeD2dMEq3xbZqmEKUFIK7efXM52e5+6CzT9HCkN/LrOvXMqkvcGTrX2ZI/h2+Pr9L gfRc91fobV4URhklsLsZlw+8Ans2OgHEwydVVgnM2B1gMzctPgjUXaUU6qwo9wROI3nODI OgmFq84lX35YbTbWa+GeDLa/ut2BfYmOYInRyDA+8UgPztrE08F047IsHwkCt0ggr9RZck zT25JtHScECle+H46dcdRgF4bWaNGW7YyjsAD167nxMAO0KEU8MrfmiOpOyyhaPRTrDVWL GZOuBt95SCU5O2nagdQddVF7DeAL5Afb7Ct3eu3OrC9YSTM3R8ZNlo7yXyFBZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670611786; 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=LCmz6hqp1N8pk7oVo0BgcWVDLMzUua+3NdPVT8uObIo=; b=i0r0iTlvmmUwS9bfL8Yup4hGARaB394UCYUGywcLp9xPJ89T0xSy3apv+SjcwWGdFATQnM txMyVMYNwVPqnPRTTdwwyxgm8GfFslYpGBTbrAAaMekvMQCDLgls+p94RveAhpFT+ltBpK IXQ7/UHL8hVS3CpE9/bXI+yYMcKY2dXcPPdg9x1wu7+/gnUSZtDg3dAFiFbk+GXuCRxUcN xBHjHInniNCQJXRJ54prGy8TRqVuL7UsCdCPdEJIXDsqhlYq7jMqfWG7IzS5tm9q3e8i2/ 567e8iHbcxptzdTkxvYLdeYugvuIROauVLiAmDt43huWiTB1QH4qLb+mX8ychw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670611786; a=rsa-sha256; cv=none; b=hub10s9aApopareT8xLeetQ2cXOjXjKBmts84cYjwH+CfJaoOhUPnbLr2OKU69c5odQHEC 9LbQfaRh1K5LAtdY8euBuiVlosoAPqJiWiNewBnxk80IXsOXrSkCzhpdKwzCTaEPldU82l khtY08+4YvWAsziq1e6FZFYMw6SRVcF/UHcyvsps4y9dQfcqdI9DtzqiSk6P4gvdO2Xj7J MUJI4Cm+SUJ95fqnYhnGtLBwaN/JBcsjNs9swvKhn7dZNYnpFr7kEBC59PVBQ373unfhIf x9uepqqf/aavem9uLPMWVlmzp1aYsMWKRSWgMqbQZ+3no7Bhhzs+8zI/MiUfMg== 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 4NTKnk3GzYzmXy; Fri, 9 Dec 2022 18:49:46 +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 2B9Ink8F043783; Fri, 9 Dec 2022 18:49:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B9InkwU043782; Fri, 9 Dec 2022 18:49:46 GMT (envelope-from git) Date: Fri, 9 Dec 2022 18:49:46 GMT Message-Id: <202212091849.2B9InkwU043782@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Brooks Davis Subject: git: 830bbdd84a53 - main - devel/llvm1[2345]: fix build with clang 15 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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/main X-Git-Reftype: branch X-Git-Commit: 830bbdd84a53aa33b48c01ee16048d1400094e26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=830bbdd84a53aa33b48c01ee16048d1400094e26 commit 830bbdd84a53aa33b48c01ee16048d1400094e26 Author: Brooks Davis AuthorDate: 2022-12-09 18:49:40 +0000 Commit: Brooks Davis CommitDate: 2022-12-09 18:49:40 +0000 devel/llvm1[2345]: fix build with clang 15 When building llvm12 through llvm15 with clang 15 as host compiler, and when compiler-rt is enabled, there will be errors due to float16 support, similar to: In file included from /wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/extendhfsf2.c:11: In file included from /wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/fp_extend_impl.inc:38: /wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/fp_extend.h:44:9: error: _Float16 is not supported on this target typedef _Float16 src_t; ^ This is because compiler-rt's CMake infrastructure detects float16 support at configure time, while targeting 'pure' x86_64, but then builds parts of its tree also targeting i386. To work around this, modify compiler-rt's top-level CMakeLists.txt to move setting the -DCOMPILER_RT_HAS_FLOAT16 compilation flag to the arch-specific for loop, so it only gets enabled for x86_64, and not for i386. For llvm15, also add another modification that removes the bfloat16 source files from the i386_SOURCES list, so these are not built for i386. PR: 268196 Submitted by: dim --- .../patch-compiler-rt_lib_builtins_CMakeLists.txt | 22 ++++++++++ .../patch-compiler-rt_lib_builtins_CMakeLists.txt | 22 ++++++++++ .../patch-compiler-rt_lib_builtins_CMakeLists.txt | 22 ++++++++++ .../patch-compiler-rt_lib_builtins_CMakeLists.txt | 50 ++++++++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/devel/llvm12/files/patch-compiler-rt_lib_builtins_CMakeLists.txt b/devel/llvm12/files/patch-compiler-rt_lib_builtins_CMakeLists.txt new file mode 100644 index 000000000000..af02e8aa7dae --- /dev/null +++ b/devel/llvm12/files/patch-compiler-rt_lib_builtins_CMakeLists.txt @@ -0,0 +1,22 @@ +--- compiler-rt/lib/builtins/CMakeLists.txt.orig 2021-06-28 16:23:38 UTC ++++ compiler-rt/lib/builtins/CMakeLists.txt +@@ -664,8 +664,6 @@ else () + else () + set(BUILTIN_CFLAGS "") + +- append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS) +- + append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS) + + # These flags would normally be added to CMAKE_C_FLAGS by the llvm +@@ -724,6 +722,10 @@ else () + # double routines. + if("${arch}" STREQUAL "riscv32") + list(APPEND BUILTIN_CFLAGS -fforce-enable-int128) ++ endif() ++ ++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND ${arch} STREQUAL "i386")) ++ append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch}) + endif() + + add_compiler_rt_runtime(clang_rt.builtins diff --git a/devel/llvm13/files/patch-compiler-rt_lib_builtins_CMakeLists.txt b/devel/llvm13/files/patch-compiler-rt_lib_builtins_CMakeLists.txt new file mode 100644 index 000000000000..874ad38b689a --- /dev/null +++ b/devel/llvm13/files/patch-compiler-rt_lib_builtins_CMakeLists.txt @@ -0,0 +1,22 @@ +--- compiler-rt/lib/builtins/CMakeLists.txt.orig 2022-01-20 21:31:59 UTC ++++ compiler-rt/lib/builtins/CMakeLists.txt +@@ -675,8 +675,6 @@ else () + else () + set(BUILTIN_CFLAGS "") + +- append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS) +- + append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS) + + # These flags would normally be added to CMAKE_C_FLAGS by the llvm +@@ -747,6 +745,10 @@ else () + ) + + set(deps_aarch64 lse_builtin_symlinks) ++ endif() ++ ++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND ${arch} STREQUAL "i386")) ++ append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch}) + endif() + + add_compiler_rt_runtime(clang_rt.builtins diff --git a/devel/llvm14/files/patch-compiler-rt_lib_builtins_CMakeLists.txt b/devel/llvm14/files/patch-compiler-rt_lib_builtins_CMakeLists.txt new file mode 100644 index 000000000000..a1a022c059fc --- /dev/null +++ b/devel/llvm14/files/patch-compiler-rt_lib_builtins_CMakeLists.txt @@ -0,0 +1,22 @@ +--- compiler-rt/lib/builtins/CMakeLists.txt.orig 2022-06-22 16:46:24 UTC ++++ compiler-rt/lib/builtins/CMakeLists.txt +@@ -682,8 +682,6 @@ else () + append_list_if(COMPILER_RT_ENABLE_CET -fcf-protection=full BUILTIN_CFLAGS) + endif() + +- append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS) +- + append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS) + + # These flags would normally be added to CMAKE_C_FLAGS by the llvm +@@ -754,6 +752,10 @@ else () + ) + + set(deps_aarch64 lse_builtin_symlinks) ++ endif() ++ ++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND ${arch} STREQUAL "i386")) ++ append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch}) + endif() + + add_compiler_rt_runtime(clang_rt.builtins diff --git a/devel/llvm15/files/patch-compiler-rt_lib_builtins_CMakeLists.txt b/devel/llvm15/files/patch-compiler-rt_lib_builtins_CMakeLists.txt new file mode 100644 index 000000000000..e26ae7cf0634 --- /dev/null +++ b/devel/llvm15/files/patch-compiler-rt_lib_builtins_CMakeLists.txt @@ -0,0 +1,50 @@ +--- compiler-rt/lib/builtins/CMakeLists.txt.orig 2022-11-29 10:05:58 UTC ++++ compiler-rt/lib/builtins/CMakeLists.txt +@@ -183,11 +183,14 @@ if(COMPILER_RT_HAS_BFLOAT16 AND NOT APPLE) + + # Build BF16 files only when "__bf16" is available. + if(COMPILER_RT_HAS_BFLOAT16 AND NOT APPLE) +- set(GENERIC_SOURCES +- ${GENERIC_SOURCES} ++ set(GENERIC_BF_SOURCES + truncdfbf2.c + truncsfbf2.c + ) ++ set(GENERIC_SOURCES ++ ${GENERIC_SOURCES} ++ ${GENERIC_BF_SOURCES} ++ ) + endif() + + # TODO: Several "tf" files (and divtc3.c, but not multc3.c) are in +@@ -360,6 +363,10 @@ if (NOT MSVC) + i386/chkstk2.S + ) + endif() ++ ++ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") ++ list(REMOVE_ITEM i386_SOURCES ${GENERIC_BF_SOURCES}) ++ endif() + else () # MSVC + # Use C versions of functions when building on MSVC + # MSVC's assembler takes Intel syntax, not AT&T syntax. +@@ -703,8 +710,6 @@ else () + append_list_if(COMPILER_RT_ENABLE_CET -fcf-protection=full BUILTIN_CFLAGS) + endif() + +- append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS) +- + append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS) + + # These flags would normally be added to CMAKE_C_FLAGS by the llvm +@@ -775,6 +780,10 @@ else () + ) + + set(deps_aarch64 lse_builtin_symlinks) ++ endif() ++ ++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND ${arch} STREQUAL "i386")) ++ append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS) + endif() + + add_compiler_rt_runtime(clang_rt.builtins