Date: Tue, 17 Sep 2024 20:19:54 -0700 From: Mark Millard <marklmi@yahoo.com> To: Dimitry Andric <dim@FreeBSD.org> Cc: FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD Mailing List <freebsd-ports@freebsd.org>, Lorenzo Salvadore <developer@lorenzosalvadore.it>, Brooks Davis <brooks@FreeBSD.org>, fuz@freebsd.org Subject: Re: official lang/gcc14 package builds are broken, at least for armv7: "error: attempt to use a poisoned identifier" and more Message-ID: <DA981CE7-C2BF-40CC-8EFE-DA854BA00A36@yahoo.com> In-Reply-To: <F590BEBD-8A97-4A58-889C-6B1A87D316AA@FreeBSD.org> References: <44F55AB3-D1C3-4171-9EE7-C852EBF2055C.ref@yahoo.com> <44F55AB3-D1C3-4171-9EE7-C852EBF2055C@yahoo.com> <F590BEBD-8A97-4A58-889C-6B1A87D316AA@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 17, 2024, at 11:40, Dimitry Andric <dim@FreeBSD.org> wrote: > This is because of gcc's weird identifier poisoning system, and them = not correctly marking all used standard C++ headers for inclusion before = the poisoning takes place. >=20 > Try the attached patch, which I have been using for a long time now = (months, at least since the bootstrap options were deleted, but which I = reverted locally). >=20 > -Dimitry >=20 > <lang__gcc14-devel-fix-plugins-1.diff> >=20 >> On 17 Sep 2024, at 16:24, Mark Millard <marklmi@yahoo.com> wrote: >>=20 >> Also: no member named 'fancy_abort' in namespace 'std' >>=20 >> Such is associated with not using STANDARD_BOOTSTRAP for armv7, given = GCC's historic lack of keeping builds of everything working for just = direct use of clang++/libc++ or the like. >>=20 >> The specific change that got back into this issue was: >>=20 >> -LANGUAGES:=3D c,c++,objc,fortran >> +LANGUAGES:=3D c,c++,objc,fortran,jit >>=20 >> It is the jit part of the build that fails to build as stands. >>=20 >> See: >>=20 >> = https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/p13f486017d= 78_s3df987c99/logs/errors/gcc14-14.2.0_1.log >>=20 >> Example: >>=20 >> In file included from = /wrkdirs/usr/ports/lang/gcc14/work/gcc-14.2.0/gcc/jit/dummy-frontend.cc:23= : >> In file included from = /wrkdirs/usr/ports/lang/gcc14/work/gcc-14.2.0/gcc/jit/jit-playback.h:24: >> In file included from /usr/include/c++/v1/string:594: >> In file included from = /usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:20: >> In file included from /usr/include/c++/v1/tuple:1455: >> In file included from /usr/include/c++/v1/exception:82: >> /usr/include/c++/v1/__exception/exception_ptr.h:111:3: error: no = member named 'fancy_abort' in namespace 'std'; did you mean simply = 'fancy_abort'? >> 111 | std::abort(); >> | ^~~~~ >> /wrkdirs/usr/ports/lang/gcc14/work/gcc-14.2.0/gcc/system.h:808:13: = note: 'fancy_abort' declared here >> 808 | extern void fancy_abort (const char *, int, const char *) >> | ^ >> In file included from = /wrkdirs/usr/ports/lang/gcc14/work/gcc-14.2.0/gcc/jit/dummy-frontend.cc:23= : >> In file included from = /wrkdirs/usr/ports/lang/gcc14/work/gcc-14.2.0/gcc/jit/jit-playback.h:26: >> In file included from /usr/include/c++/v1/vector:325: >> 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:35: >> /usr/include/c++/v1/locale:288:32: error: attempt to use a poisoned = identifier >> 288 | __status =3D (unsigned char*)malloc(__nkw); >> | ^ >> /usr/include/c++/v1/locale:1385:24: error: attempt to use a poisoned = identifier >> 1385 | __ob =3D (char_type*)malloc(2 * static_cast<size_t>(__nc) * = sizeof(char_type)); >> | ^ >> /usr/include/c++/v1/locale:2429:31: error: attempt to use a poisoned = identifier >> 2429 | _Tp* __t =3D (_Tp*)std::realloc(__owns ? __b.get() : 0, = __new_cap); >> | ^ >> /usr/include/c++/v1/locale:2632:24: error: attempt to use a poisoned = identifier >> 2632 | __h.reset((char*)malloc(static_cast<size_t>(__wn - __wb.get() = + 2))); >> | ^ >> /usr/include/c++/v1/locale:2910:28: error: attempt to use a poisoned = identifier >> 2910 | __hd.reset((char_type*)malloc(static_cast<size_t>(__n) * = sizeof(char_type))); >> | ^ >> /usr/include/c++/v1/locale:2936:28: error: attempt to use a poisoned = identifier >> 2936 | __hw.reset((char_type*)malloc(__exn * sizeof(char_type))); >> | ^ >> /usr/include/c++/v1/locale:2974:27: error: attempt to use a poisoned = identifier >> 2974 | __h.reset((char_type*)malloc(__exn * sizeof(char_type))); >> | ^ >>=20 In my environment (that somewhat predates the change that made the ampere2 based build fail), I set up a poudriere-devel test for lang/gcc14 ( not lang/gcc14-devel ): # poudriere ports -l PORTSTREE METHOD TIMESTAMP PATH default null 2021-04-18 02:05:47 /usr/ports # ~/fbsd-based-on-what-commit.sh -C /usr/ports/ d13cce06daa6 (HEAD -> main, freebsd/main, freebsd/HEAD) = graphics/gmic-qt: Update to 3.4.1 Author: Jason E. Hale <jhale@FreeBSD.org> Commit: Jason E. Hale <jhale@FreeBSD.org> CommitDate: 2024-09-02 04:05:53 +0000 branch: main merge-base: d13cce06daa6361cdbd6b97b768ab80aa60b8677 merge-base: CommitDate: 2024-09-02 04:05:53 +0000 n675562 (--first-parent --count for merge-base) (Note: I've made no commits.) # git -C /usr/ports/ status lang/gcc14 On branch main Your branch is up to date with 'freebsd/main'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: lang/gcc14/Makefile Untracked files: (use "git add <file>..." to include in what will be committed) lang/gcc14/files/patch-gcc_jit_dummy-frontend.cc lang/gcc14/files/patch-gcc_jit_jit-builtins.cc lang/gcc14/files/patch-gcc_jit_jit-playback.cc lang/gcc14/files/patch-gcc_jit_jit-recording.cc lang/gcc14/files/patch-gcc_jit_libgccjit.cc no changes added to commit (use "git add" and/or "git commit -a") (Note, below the whitespace details might not be preserved, so the text is only suggestive.) # git -C /usr/ports/ diff lang/gcc14 diff --git a/lang/gcc14/Makefile b/lang/gcc14/Makefile index 53bac89a7f14..17029847fa7c 100644 --- a/lang/gcc14/Makefile +++ b/lang/gcc14/Makefile @@ -73,7 +73,7 @@ CONFIGURE_TARGET=3D = x86_64-portbld-${OPSYS:tl}${OSREL} CONFIGURE_ARGS+=3D --with-abi=3Delfv2 .endif =20 -LANGUAGES:=3D c,c++,objc,fortran +LANGUAGES:=3D c,c++,objc,fortran,jit TARGLIB=3D ${PREFIX}/lib/gcc${SUFFIX} TARGLIB32=3D ${PREFIX}/lib32 # The version information is added = later LIBEXEC=3D ${PREFIX}/libexec/gcc${SUFFIX} And, from the content of your patch: # head -30 /usr/ports/lang/gcc14/files/patch-gcc_jit_*.cc =3D=3D> /usr/ports/lang/gcc14/files/patch-gcc_jit_dummy-frontend.cc <=3D=3D= --- gcc/jit/dummy-frontend.cc.orig 2024-01-14 22:32:46 UTC +++ gcc/jit/dummy-frontend.cc @@ -18,6 +18,8 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ =20 #include "config.h" +#define INCLUDE_STRING +#define INCLUDE_VECTOR #include "system.h" =3D=3D> /usr/ports/lang/gcc14/files/patch-gcc_jit_jit-builtins.cc <=3D=3D --- gcc/jit/jit-builtins.cc.orig 2024-01-14 22:32:46 UTC +++ gcc/jit/jit-builtins.cc @@ -18,6 +18,8 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ =20 #include "config.h" +#define INCLUDE_STRING +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "target.h" =3D=3D> /usr/ports/lang/gcc14/files/patch-gcc_jit_jit-playback.cc <=3D=3D --- gcc/jit/jit-playback.cc.orig 2024-01-14 22:32:46 UTC +++ gcc/jit/jit-playback.cc @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see =20 #include "config.h" #define INCLUDE_MUTEX +#define INCLUDE_STRING +#define INCLUDE_VECTOR #include "libgccjit.h" #include "system.h" #include "coretypes.h" =3D=3D> /usr/ports/lang/gcc14/files/patch-gcc_jit_jit-recording.cc <=3D=3D= --- gcc/jit/jit-recording.cc.orig 2024-01-14 22:32:46 UTC +++ gcc/jit/jit-recording.cc @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see =20 #include "config.h" #define INCLUDE_SSTREAM +#define INCLUDE_STRING +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "tm.h" =3D=3D> /usr/ports/lang/gcc14/files/patch-gcc_jit_libgccjit.cc <=3D=3D /jit/libgccjit.cc.orig 2024-01-14 22:32:46 UTC +++ gcc/jit/libgccjit.cc @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see =20 #include "config.h" #define INCLUDE_MUTEX +#define INCLUDE_STRING +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "timevar.h" The result for poudriere bulk lang/gcc14 was: [00:06:55] [01] [00:00:00] Building lang/gcc14 | gcc14-14.2.0 [00:28:00] [01] [00:21:05] Finished lang/gcc14 | gcc14-14.2.0: Success = ending TMPFS: 1.61 GiB So it looks like adding your files/patch-gcc_jit_*.cc files to lang/gcc14 would allow the ampere2 builds of lang/gcc14 for armv7 to work without use of STANDARD_BOOTSTRAP (at least for now). ( The "ending TMPFS: . . . GiB" is something I add to poudirere for helping to find packages that I might want to add to TMPFS_BLACKLIST .) The context has: # poudriere jail -jmain-armv7 -i Jail name: main-armv7 Jail version: 15.0-CURRENT Jail arch: armv7 Jail method: pkgbase Jail mount: /usr/local/poudriere/jails/main-armv7-poud Jail fs: Jail updated: 2024-08-27 21:47:56 Jail pkgbase: disabled The pkgbase system for the jail is from the official materials at the time it was last updated. It is not my personal world build at all. Thanks, Mark =3D=3D=3D Mark Millard marklmi at yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DA981CE7-C2BF-40CC-8EFE-DA854BA00A36>