Bug 1080192 - gcc doesn't work when bash isn't the login shell
gcc doesn't work when bash isn't the login shell
Status: NEW
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P5 - None : Major (vote)
: ---
Assigned To: Michael Matz
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-08 23:50 UTC by Simon Lees
Modified: 2019-09-12 07:52 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
rguenther: needinfo? (simonf.lees)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Lees 2018-02-08 23:50:56 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.
Comment 1 Richard Biener 2018-02-09 09:13:16 UTC
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?).
Comment 2 Michael Matz 2018-02-09 13:55:56 UTC
Also, output of 'gcc -v -o locale locale.c'.
Comment 3 Simon Lees 2019-09-12 05:50:37 UTC
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.
Comment 4 Richard Biener 2019-09-12 07:52:20 UTC
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?