From owner-dev-commits-ports-main@freebsd.org Sat May 29 14:08:52 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5CC864171C; Sat, 29 May 2021 14:08:52 +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 4Fsk1c30phz3Fhr; Sat, 29 May 2021 14:08:52 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2FD383907; Sat, 29 May 2021 14:08:52 +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 14TE8quX091234; Sat, 29 May 2021 14:08:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14TE8q0r091233; Sat, 29 May 2021 14:08:52 GMT (envelope-from git) Date: Sat, 29 May 2021 14:08:52 GMT Message-Id: <202105291408.14TE8q0r091233@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 0d25df4a1889 - main - devel/aws-c-common: detect -moutline-atomics correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d25df4a18898c9434f2c7c7f06c833f602ae3fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2021 14:08:53 -0000 The branch main has been updated by dim (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=0d25df4a18898c9434f2c7c7f06c833f602ae3fc commit 0d25df4a18898c9434f2c7c7f06c833f602ae3fc Author: Dimitry Andric AuthorDate: 2021-05-15 19:41:55 +0000 Commit: Dimitry Andric CommitDate: 2021-05-29 14:08:19 +0000 devel/aws-c-common: detect -moutline-atomics correctly During an exp-run for llvm 12 (see bug 255570), it turned out that security/aws-c-cal does not build with clang 12.0.0, at least not on amd64: -- The C compiler identification is Clang 12.0.0 [...] -- Performing Test HAS_MOUTLINE_ATOMICS -- Performing Test HAS_MOUTLINE_ATOMICS - Success [...] FAILED: CMakeFiles/aws-c-cal.dir/source/der.c.o /usr/bin/cc -DAWS_CAL_EXPORTS -DAWS_CAL_USE_IMPORT_EXPORT -DAWS_COMMON_USE_IMPORT_EXPORT -DHAVE_SYSCONF -Daws_c_cal_EXPORTS -I/wrkdirs/usr/ports/security/aws-c-cal/work/aws-c-cal-0.4.5/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -Wall -Werror -Wstrict-prototypes -fno-omit-frame-pointer -pedantic -Wno-long-long -fPIC -moutline-atomics -Wgnu -Wno-gnu-zero-variadic-macro-arguments -fvisibility=hidden -std=gnu99 -MD -MT CMakeFiles/aws-c-cal.dir/source/der.c.o -MF CMakeFiles/aws-c-cal.dir/source/der.c.o.d -o CMakeFiles/aws-c-cal.dir/source/der.c.o -c /wrkdirs/usr/ports/security/aws-c-cal/work/aws-c-cal-0.4.5/source/der.c cc: error: The 'x86_64' architecture does not support -moutline-atomics; flag ignored [-Werror,-Woption-ignored] This port uses /usr/local/lib/cmake/AwsCFlags.cmake to detect the -moutline-atomics flag, but it does so by checking if the compiler prints an *error* when using the flag. It could be debated that CMake's check_c_compiler_flag() functionality is rather broken in that sense, as it does not exhaustively scan for warnings from the compiler. On the other hand, security/aws-c-cal compiles with -Werror, so then you get an error for such warnings. Instead of hacking around it in security/aws-c-cal, fix it in devel/aws-c-common instead, simply by adding -Werror to the HAS_MOUTLINE_ATOMICS check. This will ensure that it does *not* get enabled on x86, where it is not functional, and will still get enabled on e.g. aarch64, for which this flag is meant. Approved by: maintainer timeout (2 weeks) PR: 255913 MFH: 2021Q2 --- devel/aws-c-common/files/patch-cmake_AwsCFlags.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devel/aws-c-common/files/patch-cmake_AwsCFlags.cmake b/devel/aws-c-common/files/patch-cmake_AwsCFlags.cmake new file mode 100644 index 000000000000..1c72b98b3fdf --- /dev/null +++ b/devel/aws-c-common/files/patch-cmake_AwsCFlags.cmake @@ -0,0 +1,11 @@ +--- cmake/AwsCFlags.cmake.orig 2020-12-30 21:06:26 UTC ++++ cmake/AwsCFlags.cmake +@@ -73,7 +73,7 @@ function(aws_set_common_properties target) + + # -moutline-atomics generates code for both older load/store exclusive atomics and also + # Arm's Large System Extensions (LSE) which scale substantially better on large core count systems +- check_c_compiler_flag(-moutline-atomics HAS_MOUTLINE_ATOMICS) ++ check_c_compiler_flag("-moutline-atomics -Werror" HAS_MOUTLINE_ATOMICS) + if (HAS_MOUTLINE_ATOMICS) + list(APPEND AWS_C_FLAGS -moutline-atomics) + endif()