* (app-shells/bash-2.05b_p13:2.05b/2.05b::gentoo, ebuild scheduled for merge), Log file: * '/var/log/portage/app-shells:bash-2.05b_p13:20230206-210446.log' * (app-shells/bash-3.0_p22:3.0/3.0::gentoo, ebuild scheduled for merge), Log file: * '/var/log/portage/app-shells:bash-3.0_p22:20230206-210446.log' * (app-shells/bash-3.1_p23:3.1/3.1::gentoo, ebuild scheduled for merge), Log file: * '/var/log/portage/app-shells:bash-3.1_p23:20230206-214058.log' * (app-shells/bash-3.2_p57:3.2/3.2::gentoo, ebuild scheduled for merge), Log file: * '/var/log/portage/app-shells:bash-3.2_p57:20230206-214058.log' I suspect that the solution is to use contemporary toolchains, not fix old bash versions. Log files are not attached but can be provided on request.
This bug report contains no useful information. Please attach the logs.
Created attachment 850528 [details] app-shells:bash-2.05b_p13:20230206-210446.log
Created attachment 850530 [details] app-shells:bash-3.0_p22:20230206-210446.log
Created attachment 850532 [details] app-shells:bash-3.1_p23:20230206-214058.log
Created attachment 850534 [details] app-shells:bash-3.2_p57:20230206-214058.log
My apologies for the presumption that there would be no interest in keeping these old version of bash alive.
Taking 3.1 as a random example here: execute_cmd.c:3905:25: warning: implicit declaration of function ‘__setostype’ [-Wimplicit-function-declaration] This is actually becoming a fatal error in gcc 14, basically exactly because of the error you're getting here. Which I suspect is *precisely* that you were using LTO, and the optimizer choked when it couldn't find the definition of the function. Indeed, later on: /usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: /var/tmp/portage/app-shells/bash-3.2_p57/temp/ccCDPZns.ltrans1.ltrans.o: in function `shell_execve': <artificial>:(.text+0x4274): undefined reference to `__setostype' /usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: <artificial>:(.text+0x4298): undefined reference to `__setostype' I suspect all the issues will go away if you patch these older bash versions to include the correct headers.
Sorry, when I said "taking 3.1 as a random example" what I meant to say is, I tried compiling 3.1 and got a bunch of -Werror=implicit-function-declaration failures since I'm running the c99-porting detection *FLAGS. shell.c: In function ‘main’: shell.c:704:7: error: implicit declaration of function ‘get_tty_state’ [-Werror=implicit-function-declaration] 704 | get_tty_state (); | ^~~~~~~~~~~~~ shell.c: In function ‘shell_initialize’: shell.c:1662:3: error: implicit declaration of function ‘initialize_job_control’ [-Werror=implicit-function-declaration] 1662 | initialize_job_control (0); | ^~~~~~~~~~~~~~~~~~~~~~ ./parse.y: In function ‘shell_getc’: ./parse.y:1928:11: error: implicit declaration of function ‘cleanup_dead_jobs’ [-Werror=implicit-function-declaration] 1928 | cleanup_dead_jobs (); | ^~~~~~~~~~~~~~~~~ ./parse.y: In function ‘decode_prompt_string’: ./parse.y:4272:28: error: implicit declaration of function ‘count_all_jobs’ [-Werror=implicit-function-declaration] 4272 | temp = itos (count_all_jobs ()); | ^~~~~~~~~~~~~~ And your error matches up to: execute_cmd.c: In function ‘shell_execve’: execute_cmd.c:3813:25: error: implicit declaration of function ‘__setostype’ [-Werror=implicit-function-declaration] 3813 | # define SETOSTYPE(x) __setostype(x) | ^~~~~~~~~~~ execute_cmd.c:3844:3: note: in expansion of macro ‘SETOSTYPE’ 3844 | SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ | ^~~~~~~~~ And some more fun bits.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6eea46091ef4e2f853c746f4544858bc79f63a73 commit 6eea46091ef4e2f853c746f4544858bc79f63a73 Author: Eli Schwartz <eschwartz93@gmail.com> AuthorDate: 2024-03-11 23:54:05 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-12 00:28:41 +0000 app-shells/bash: mark as LTO-unsafe in particularly old versions Due to implicit function declarations, LTO fails to detect the availability of a function and errors out due to an undefined reference at link time. It's fixed in bash 4.0 and on, but the value of backporting the fix to versions of bash that have niche use (people interested in exploring old versions, not people who are looking for the shebang interpreter for their system scripts) is a matter of some question... Closes: https://bugs.gentoo.org/893958 Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> app-shells/bash/bash-2.05b_p13.ebuild | 8 +++++++- app-shells/bash/bash-3.0_p22.ebuild | 8 +++++++- app-shells/bash/bash-3.1_p23.ebuild | 8 +++++++- app-shells/bash/bash-3.2_p57.ebuild | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-)