Summary: | security/gnutls fails to build | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Bjoern A. Zeeb <bz> |
Component: | Individual Port(s) | Assignee: | Tijl Coosemans <tijl> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | bz, dim, mikael, toolchain |
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(tijl) |
Version: | Latest | ||
Hardware: | arm64 | ||
OS: | Any |
Description
Bjoern A. Zeeb
2021-11-27 16:46:07 UTC
I can reproduce this. The issue is that clang doesn't support "-Wa,-march=all" (at least for aarch64), but it segfaults on it instead of producing a more regular error message. I will take the segfault upstream, since that seems to be a case of dodgy command line parameter parsing. But to work around this, you could attempt removing the -Wa,-march=all from the compilation command line, in ${WRKSRC}/lib/accelerated/aarch64/Makefile.am. I can confirm that this change locally makes gnutls build for me. It's probably not the proper way to fix this in ports. Thanks a lot @dim for your quick diagnose and reply! diff --git a/security/gnutls/Makefile b/security/gnutls/Makefile index 1ed334f7ca95..cebb0d6016c3 100644 --- a/security/gnutls/Makefile +++ b/security/gnutls/Makefile @@ -17,7 +19,7 @@ LIB_DEPENDS= libgmp.so:math/gmp \ libunistring.so:devel/libunistring RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss -USES= compiler:c11 cpe gmake iconv libtool localbase makeinfo \ +USES= compiler:c11 cpe gmake iconv autoreconf libtool localbase makeinfo \ pkgconfig tar:xz USE_LDCONFIG= yes diff --git a/security/gnutls/files/patch-aarch64-clang-fix-PR260078 b/security/gnutls/files/patch-aarch64-clang-fix-PR260078 new file mode 100644 index 000000000000..672c41da6065 --- /dev/null +++ b/security/gnutls/files/patch-aarch64-clang-fix-PR260078 @@ -0,0 +1,11 @@ +--- lib/accelerated/aarch64/Makefile.am.orig 2021-04-19 07:28:28.000000000 +0000 ++++ lib/accelerated/aarch64/Makefile.am 2021-11-28 16:02:10.613775000 +0000 +@@ -34,7 +34,7 @@ AM_CPPFLAGS += -I$(srcdir)/../../minitasn1 + endif + + #ensure that we have all aarch64 instruction sets enabled for the assembler +-AM_CCASFLAGS = -Wa,-march=all ++#AM_CCASFLAGS = -Wa,-march=all + + EXTRA_DIST = README + A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7f765b2b68c15dae2d53461ed68e4516457ae496 commit 7f765b2b68c15dae2d53461ed68e4516457ae496 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2021-11-28 19:33:56 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2021-11-28 20:21:54 +0000 security/gnutls: Remove -Wa,-march=all for clang on aarch64 PR: 260078 security/gnutls/Makefile | 3 +++ 1 file changed, 3 insertions(+) Fixed upstream in https://github.com/llvm/llvm-project/commit/df08b2fe8b35cb63dfb3b49738a3494b9b4e6f8e . I will pull this revision into our version, after it has baked for a while. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a9cd5c30d64e213c537c76c2a261f7a222f348bf commit a9cd5c30d64e213c537c76c2a261f7a222f348bf Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-12-05 17:54:13 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-12-05 17:54:13 +0000 Apply fix for clang crashing on invalid -Wa,-march= values Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric): [AArch64] Avoid crashing on invalid -Wa,-march= values As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles pass -Wa,-march=all to compile a number of assembly files. Clang does not support this -march value, but because of a mistake in handling the arguments, an unitialized Arg pointer is dereferenced, which can cause a segfault. Work around this by adding a check if the local WaMArch variable is initialized, and if so, using its value in the diagnostic message. Reviewed By: tschuett Differential Revision: https://reviews.llvm.org/D114677 PR: 260078 Reported by: bz MFC after: 3 days .../clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e4bde9c969cc1d079403850e964d9548316968a1 commit e4bde9c969cc1d079403850e964d9548316968a1 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-12-05 17:54:13 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-12-10 21:28:56 +0000 Apply fix for clang crashing on invalid -Wa,-march= values Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric): [AArch64] Avoid crashing on invalid -Wa,-march= values As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles pass -Wa,-march=all to compile a number of assembly files. Clang does not support this -march value, but because of a mistake in handling the arguments, an unitialized Arg pointer is dereferenced, which can cause a segfault. Work around this by adding a check if the local WaMArch variable is initialized, and if so, using its value in the diagnostic message. Reviewed By: tschuett Differential Revision: https://reviews.llvm.org/D114677 PR: 260078 Reported by: bz MFC after: 3 days (cherry picked from commit a9cd5c30d64e213c537c76c2a261f7a222f348bf) .../clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=367dea5f853f1193fd1cc722f85e132f323c22db commit 367dea5f853f1193fd1cc722f85e132f323c22db Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-12-05 17:54:13 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-12-25 11:51:42 +0000 Apply fix for clang crashing on invalid -Wa,-march= values Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric): [AArch64] Avoid crashing on invalid -Wa,-march= values As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles pass -Wa,-march=all to compile a number of assembly files. Clang does not support this -march value, but because of a mistake in handling the arguments, an unitialized Arg pointer is dereferenced, which can cause a segfault. Work around this by adding a check if the local WaMArch variable is initialized, and if so, using its value in the diagnostic message. Reviewed By: tschuett Differential Revision: https://reviews.llvm.org/D114677 PR: 260078 Reported by: bz MFC after: 3 days (cherry picked from commit a9cd5c30d64e213c537c76c2a261f7a222f348bf) .../clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) |