public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/106429] New: Building GCC is Inhibited on old Linux Distributions due to the use of "#!/bin/bash"
@ 2022-07-24 22:48 martin.vahi at softf1 dot com
  2022-07-24 23:04 ` [Bug other/106429] " pinskia at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: martin.vahi at softf1 dot com @ 2022-07-24 22:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106429

            Bug ID: 106429
           Summary: Building GCC is Inhibited on old Linux Distributions
                    due to the use of "#!/bin/bash"
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: martin.vahi at softf1 dot com
  Target Milestone: ---

Some newer version of C++_compiler is
needed to build applications that use some 
newer C++ standard. By default old Linux distributions have
too old GCC versions, so a newer version of GCC needs to be
built before the applications that use newer C++ standard
can be built. Old Linux distributions are needed for
old hardware, because newer Linux distributions
do not always contain all the drivers for old hardware.
For example, in the case of openSUSE Linux, drivers 
for old hardware are literally removed from the 
package repositories of newer versions of the openSUSE Linux.
The paths at a "dependency graph" are:

    the_use_of_old_hardware
    --depends-on->
    the_availability_of_drivers_for_that_old_hardware
    --depends-on->
    the_use_of_old_operating_system_distributions
    --depends-on->
    possibility_to_backport_applications_to_those_old_distributions

    apps_that_use_newer_Cpp_standard 
    --depend-on->
    some_newer_Cpp_compiler === GCC 
    --depends-during-buildtime-on->
    availability_of_some_newer_version_of_Bash_on_PATH
    --depends-on->
    GCC_code_changes_that_are_described_in_this_bug_report

To build a newer version of GCC, some
newer version of Bash is at least sometimes required, because
the building of GCC, for example, version 11.2.0, includes 
the execution of some Bash scripts. The default Bash 
implementation tends to reside at the path "/bin/bash", but
one needs the newer version of the Bash on PATH only during 
the building of the GCC. The classical solution in that
scenario is 

    export PATH="/path/to/the/newer/Bash/version/bin:$PATH"

which means that the new version of the Bash gets found before
the system default "/bin/bash" is found. However, if the GCC 
build related Bash scripts start with

    #!/bin/bash

in stead of 

    #!/usr/bin/env bash

then that kind of PATH based Bash executable override
does not work. The suggested and tested (GCC v. 11.2.0)
workaround is to use grep to find all Bash files that
start with the "#!/bin/bash" and replace the 
"#!/bin/bash" with the "#!/usr/bin/env bash", except the file

    gcc/contrib/repro_fail

because, for some nice amount of luck, leaving that one 
to its "#!/bin/bash -eu" did not break anything.
The version of Bash that turned out to be too old 
for building the GCC v.11.2.0 was 

    4.3.48(1)-release (x86_64-suse-linux-gnu)

and the version of Bash that was sufficiently new for building
GCC v.11.2.0 was Bash v.5.1

Thank You for reading this bug_report/comment.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-06-05  4:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-24 22:48 [Bug other/106429] New: Building GCC is Inhibited on old Linux Distributions due to the use of "#!/bin/bash" martin.vahi at softf1 dot com
2022-07-24 23:04 ` [Bug other/106429] " pinskia at gcc dot gnu.org
2022-07-24 23:07 ` pinskia at gcc dot gnu.org
2022-07-24 23:10 ` pinskia at gcc dot gnu.org
2022-07-25  9:35 ` redi at gcc dot gnu.org
2022-07-30  1:38 ` martin.vahi at softf1 dot com
2022-07-30  1:45 ` martin.vahi at softf1 dot com
2022-07-30  1:51 ` pinskia at gcc dot gnu.org
2022-07-30  2:27 ` martin.vahi at softf1 dot com
2022-07-30  5:25 ` [Bug other/106429] make clean in libgcc fails pinskia at gcc dot gnu.org
2022-07-30  5:27 ` pinskia at gcc dot gnu.org
2022-07-31  9:45 ` martin.vahi at softf1 dot com
2022-07-31  9:49 ` martin.vahi at softf1 dot com
2022-07-31 10:33 ` redi at gcc dot gnu.org
2022-07-31 10:36 ` redi at gcc dot gnu.org
2022-07-31 14:32 ` egallager at gcc dot gnu.org
2023-06-05  4:08 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).