Hi, building the port with WITH_PIE makes it fail (configure error). Until this is fixed, the port should get PIE_UNSAFE=yes in the Makefile (this fixes the build for me). Bye, Alexander.
I have started investigating the issue, but I am unable to reproduce it for now (I am still trying). Could you please share more information about your settings? Are you using poudriere? Which FreeBSD version and which architecture are you using? Which options have you enabled? Is it possible that the issue is with some dependency of gcc12 rather than with gcc12 itself? GCC has many configure scripts: are you able to tell which one is failing? May I ask you to share your config.log file with the failure? Thanks.
(In reply to Lorenzo Salvadore from comment #1) -current poudriere stock options for gcc make.conf has: WITH_PIE=yes WITH_RELRO=yes WITH_BIND_NOW=yes OPTIONS_SET=ICONV MMX OPTIMIZED_CFLAGS SEM SIMD OPENMP CFLAGS=-O2 -pipe DEFAULT_VERSIONS=python=3.11 python3=3.11 Would the poudriere log be helpful? I could provide that in some hours. What I see (transcribed from a remote-ssh on my phone): checking for library containing strerror... configure: error: Link tests not allowed after GCC_NO_EXECUTABLES. this is in "... [Makefile:12231: configure-stage1-libiberty] Error 1" This test itself get's a "yes" after the error message.
And another one for the lto plugin, the check for a cross-compile can't run the executable result.
Yes, thanks: the poudriere log would be helpful. May I ask you to check if you can reproduce the issue with LTO_BOOTSTRAP option disabled? If the bug is specific to LTO_BOOTSTRAP enabled I will not be able to reproduce it: my machine does not have enough resources to build the port in an acceptable time with that option enabled. In that case I would just trust your report and add PIE_UNSAFE=yes as you suggest, but only when LTO_BOOTSTRAP is on.
(In reply to Lorenzo Salvadore from comment #4) I tried without LTE_BOOTSTRAP and without PIE_UNSAFE: builds ok. Do you still want the log of the failure case?
Created attachment 239422 [details] Poudriere build log, default gcc options plus WITH_PIE
Thanks Alexander. Since the error happens at the beginning of the process, I am able to reproduce it even on my machine once I enable LTO_BOOTSTRAP. I am going to study how to fix the issue. If I cannot find a fix in a few days, I will introduce PIE_UNSAFE as you suggested as a workaround.
The issue is also present with STANDARD_BOOTSTRAP enabled.
I cannot find the time to investigate the issue properly, so I am going to introduce the workaround for now. I am going to mark PIE_UNSAFE the -devel ports first, when updating them to their latest weekly snapshot; then I will modify lang/gcc11 and lang/gcc12 too. I will not close the bug report once the workaround is introduced as I believe it should be possible to do better.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d10424ba993b72ecfb07b1199b8015a4991a2a86 commit d10424ba993b72ecfb07b1199b8015a4991a2a86 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-01-21 21:00:41 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-01-22 09:09:57 +0000 lang/gcc11-devel: Mark PIE_UNSAFE if a BOOTSTRAP option is enabled Building the port with WITH_PIE fails if STANDARD_BOOTSTRAP or LTO_BOOTSTRAP option is enabled. Mark PIE_UNSAFE when such an option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc11-devel/Makefile | 3 +++ 1 file changed, 3 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=80494beb223980f77d45bc8797253d284da8acbb commit 80494beb223980f77d45bc8797253d284da8acbb Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-01-22 19:43:10 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-01-23 00:15:46 +0000 lang/gcc12-devel: Mark PIE_UNSAFE if a BOOTSTRAP option is enabled Building the port with WITH_PIE fails if STANDARD_BOOTSTRAP or LTO_BOOTSTRAP option is enabled. Mark PIE_UNSAFE when such an option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc12-devel/Makefile | 3 +++ 1 file changed, 3 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=08587f681899354917a2a8c7b6719bf0b8863b28 commit 08587f681899354917a2a8c7b6719bf0b8863b28 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-01-23 23:58:10 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-01-24 00:37:44 +0000 lang/gcc13-devel: Mark PIE_UNSAFE if a BOOTSTRAP option is enabled Building the port with WITH_PIE fails if STANDARD_BOOTSTRAP or LTO_BOOTSTRAP option is enabled. Mark PIE_UNSAFE when such an option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc13-devel/Makefile | 3 +++ 1 file changed, 3 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0b8cadc9870038fe668eae4604b1de4a55c2e6a1 commit 0b8cadc9870038fe668eae4604b1de4a55c2e6a1 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-02-03 10:28:25 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-02-03 13:01:37 +0000 lang/gcc11: Mark PIE_UNSAFE Building the port with WITH_PIE fails if STANDARD_BOOTSTRAP or LTO_BOOTSTRAP option is enabled. Mark PIE_UNSAFE when such an option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc11/Makefile | 2 ++ 1 file changed, 2 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=444f183cebf8b5e304b143a900e2f70f1e30bde4 commit 444f183cebf8b5e304b143a900e2f70f1e30bde4 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-02-03 13:03:28 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-02-03 15:11:03 +0000 lang/gcc12: Mark PIE_UNSAFE Building the port with WITH_PIE fails if STANDARD_BOOTSTRAP or LTO_BOOTSTRAP option is enabled. Mark PIE_UNSAFE when such an option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc12/Makefile | 2 ++ 1 file changed, 2 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b6a5871a0cf40dfc194217704e2dc03e2e91fb62 commit b6a5871a0cf40dfc194217704e2dc03e2e91fb62 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2023-02-03 19:12:49 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2023-02-04 09:10:55 +0000 lang/gcc10: Mark PIE_UNSAFE Building the port with WITH_PIE fails if the BOOTSTRAP option is enabled. Mark PIE_UNSAFE when this option is enabled until a better solution is found. PR: 268901 Reported by: netchild lang/gcc10/Makefile | 1 + 1 file changed, 1 insertion(+)