When using GCC to compile most things, I get this error:
/..//bin/ld: cannot find crtbeginS.o: No such file or directory
crtbeginS.o exists at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/crtbeginS.o (Installed from GCC trunk, 6.0.0-trunk)
I added that directory to ldconfig and ran ldconfig, but it didn't pick up any additional directories. (I'm thinking since it's a .o rather than .so)
As a temporary fix, I tried making a symlink to /usr/local/lib64/crtbeginS.o - but that gives the same error.
What can I do, so the /usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/ directory is always looked at to find the library?
If I run gcc -print-search-dirs|grep "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0"
, it shows libraries: =/usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/:... But, this is of course gcc not ld.
If I run ld --verbose | grep SEARCH_DIR
, I see /usr/local/lib/gcc_x86_64-unknown-linux-gnu/6.0.0 is NOT included.
I'd really like to do this as a system-wide default, so I don't have to give -L to everything. I'm fine building bintools from source, if that's necessary.