Bugzilla – Bug 1080192
gcc doesn't work when bash isn't the login shell
Last modified: 2019-09-12 07:52:20 UTC
gcc fails with the below error when fish is the login shell: simon@tek-top ~/src/tmp ➤ gcc -o locale locale.c gcc: error trying to exec 'cc1': execvp: No such file or directory if I run the same command inside bash --login it compiles fine. So at a guess we are setting some environment variables in a bash only location. This issue is also in Leap 15, earlier versions of Leap and Tumbleweed did not have this issue.
You need to provide more information here. We don't have any GCC specific environment. Can you provide strace output of the failing command? Can you provide the environment contents of your fish login shell (and that in case of bash, just for completeness?).
Also, output of 'gcc -v -o locale locale.c'.
At a hunch that I still need to confirm, I suspect this is because fish doesn't load /etc/profile and as such environment variables like HOST CPU OSTYPE MACHTYPE aren't loaded. But I need to find some time to investigate this better.
GCC doesn't use those. The driver as of today looks at getenv("TERM") = "xterm" getenv("GCC_EXEC_PREFIX") = nil getenv("PATH") = "/usr/local/bin:/usr/bin:/bin" getenv("PATH") = "/usr/local/bin:/usr/bin:/bin" getenv("COMPILER_PATH") = nil getenv("LIBRARY_PATH") = nil getenv("LPATH") = nil getenv("GCC_COMPARE_DEBUG") = nil getenv("GCC_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("BINUTILS_ROOT") = nil getenv("MAKEFLAGS") = nil the error from the driver means it cannot find cc1. Maybe you have _bogus_ (GCC_EXEC_PREFIX?) environment with fish?