Is there a way to inhibit the default library path search with gcc? -nostdinc does this for the include path search, but -nostdlib, either by omission or by design, only inhibits the -lc -lgcc etc. but not the library search paths.
Is there a way to inhibit the default library path search with gcc? -nostdinc
Share
You should be able to do this with spec files (although fiddling with these seems like something of a dark art to me…).
If you look at the output of
gcc -dumpspecs, thelink_commandspec is the one that builds the actual command that is invoked. Digging through some of the other specs it references, thelink_libgccspec, which is usually defined (for native compilers at least) as:is the culprit:
You can override it by creating a file (e.g.
my.specs) which substitutes paths of your choice:and then passing
-specs=my.specstogcc.