From nobody Sat Sep 23 16:24:44 2023 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 4RtDxS2f0nz4ttPW; Sat, 23 Sep 2023 16:24:44 +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 4RtDxS2761z4RD3; Sat, 23 Sep 2023 16:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695486284; 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=GdZ9LJLnKtKAVurx/PQisC1k6KczOlcapua4jmSvrjQ=; b=xPIKGJhSu6OW53D6jupcS5S0wCOiMjfydRVcQy35mX6XZexUM5Gw5RS8iWUP4u4cP/Aqza B4NwiE7X6tDIaWRmlgRRS3v1gMWusWPcNOS04xw9ZcSygg6hwgdQMtlrh2B4g0BnXOpdwf DwO00X/hifj7NCaaJizSUUs/cN43FvM2LZ/U8qc1tkUYuXHG8IG2Az08Bhb5huZpixhb7w f2RlaLuS1f4pzgR5bWkKPDSkUtICOs6dUtSJrVXuknN2VwiqanhM5neLJsHFt3Pu6Sv3os OH8pOiKrMTUCrlwfN4LEURhRreDKe3+2RxMMK9yNqRypFzCZq5WnQPZfV462eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695486284; a=rsa-sha256; cv=none; b=BTpF9ccAz/KSSuLUzbcLJkOtFngEa5nyzrNDLXQINoexG+oWFCUlrhkDyR4fUj805tecTh e4GTztYZNUNcCVGok1pJio+cB+0SWv+HZNOERFWTFG9VcD/Q0gdyVQVE93ANRsEg5ctR3B OW6axM4A/mghQX+fq9tEp/J1WZb9jCpyZWa8VT3F1u1HCx6StIe58T2rcScCeuqkHOajjm a6aA8X8UqRxvjGRRuKg+jNbn1kCAP/CVQ4C25Wa965UQ84XZpkEPNyoMpPFm/ilP8jwrPW XOWG3UxgUaUKfcf9qBB+s8rUBHJg+zendKHout4hZTPH1gZcl3LqYh4wKeoTjA== 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=1695486284; 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=GdZ9LJLnKtKAVurx/PQisC1k6KczOlcapua4jmSvrjQ=; b=QOIf6o+nMLqW2OCjJnq7TlyTbLTjw7oFxveTBT1yN6tHSNyBbq2d38bdPUJIsDSm7voxnh 6X0hQNUxA2xUXX8kKDptMfDcXH91JYWgk7xDsGq0YNw1aIzaG6jlGwzmW5DNS/Lhh2K8RP WRTrzHYkD0rdPaFhNhXAj1yD0RP+21zBCS77v54Pmj8GpQancYUQ5LlxAlVrYVDBW3XLW3 YI+o+UayFvOeQ8tc3XNmqQUgEuSkbyUSIHhm5g5NFJb9/a/XQowcqPExKlpkREvW1PtYhb JZyLVzS9SV8p/ZIXRjghXo4j1dSHBgspNJPmd33QODSWWBoTepzHuL1o65PkSA== 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 4RtDxS1B80z19ml; Sat, 23 Sep 2023 16:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38NGOigC004175; Sat, 23 Sep 2023 16:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38NGOiY0004172; Sat, 23 Sep 2023 16:24:44 GMT (envelope-from git) Date: Sat, 23 Sep 2023 16:24:44 GMT Message-Id: <202309231624.38NGOiY0004172@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: 9673ad933c7b - main - devel/aarch64-none-elf-gcc: fix build with libc++ 17 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: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9673ad933c7b1615b46dec15686b1b58d35ef88b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=9673ad933c7b1615b46dec15686b1b58d35ef88b commit 9673ad933c7b1615b46dec15686b1b58d35ef88b Author: Dimitry Andric AuthorDate: 2023-09-21 19:08:51 +0000 Commit: Dimitry Andric CommitDate: 2023-09-23 16:23:45 +0000 devel/aarch64-none-elf-gcc: fix build with libc++ 17 When building relatively recent gcc ports (with C++ in them) against libc++ 17, you get errors similar to: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/cp/module.cc:208: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/system.h:239: In file included from /usr/include/c++/v1/vector:321: In file included from /usr/include/c++/v1/__format/formatter_bool.h:20: In file included from /usr/include/c++/v1/__format/formatter_integral.h:32: In file included from /usr/include/c++/v1/locale:202: /usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces 546 | _LIBCPP_INLINE_VISIBILITY | ^ /usr/include/c++/v1/__config:813:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY' 813 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI | ^ /usr/include/c++/v1/__config:792:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI' 792 | __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER)))) | ^ In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/cp/module.cc:208: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/system.h:239: In file included from /usr/include/c++/v1/vector:321: In file included from /usr/include/c++/v1/__format/formatter_bool.h:20: In file included from /usr/include/c++/v1/__format/formatter_integral.h:32: In file included from /usr/include/c++/v1/locale:202: /usr/include/c++/v1/__locale:547:37: error: expected ';' at end of declaration list 547 | char_type toupper(char_type __c) const | ^ /usr/include/c++/v1/__locale:553:48: error: too many arguments provided to function-like macro invocation 553 | const char_type* toupper(char_type* __low, const char_type* __high) const | ^ /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/../include/safe-ctype.h:146:9: note: macro 'toupper' defined here 146 | #define toupper(c) do_not_use_toupper_with_safe_ctype | ^ This is because gcc/system.h includes safe-ctype.h which redefines ctype macros such as toupper, tolower, etc to "poison" them. However, it should only include the safe-ctype.h header *after* any C++ headers, such as , , , etc, otherwise these might transitively include internal ctype headers (such as with libc++ 17), causing the above conflicts. This commit moves the safe-ctype.h inclusion to later in gcc/system.h, which solves this issue, and makes it possible to build against libc++ 17. PR: 274040 Approved by: manu (maintainer) MFH: 2023Q3 --- .../aarch64-none-elf-gcc/files/patch-gcc_system.h | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/devel/aarch64-none-elf-gcc/files/patch-gcc_system.h b/devel/aarch64-none-elf-gcc/files/patch-gcc_system.h new file mode 100644 index 000000000000..87259b346ecc --- /dev/null +++ b/devel/aarch64-none-elf-gcc/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2022-04-21 07:58:53 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -242,6 +229,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather