http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50470
Bug #: 50470
Summary: gcc does not respect -nostdlib with regard to search
paths
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: driver
AssignedTo: [email protected]
ReportedBy: [email protected]
Even with -nostdlib, gcc leaves the default library paths in the search path,
including /usr/lib (in the form of /usr/lib/gcc/targetstring/version/../../..).
This makes -nostdlib basically useless for its only foreseeable purpose,
building programs against a completely alternate library ecosystem(*). The only
workaround I've found is installing a wrapper script with -wrapper to remove
the unwanted paths.
(*) Leaving default paths in the search path after the custom ones is not
acceptable because configure scripts will find and attempt to use libraries in
the default paths if the corresponding library does not exist in the custom
path.