Adding the .o path to the default ld (crtbeginS.o, not the .so files)

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 in / usr / local / lib / gcc / x 86_64-unknown-linux-gnu / 6.0.0 / crtbeginS.o (installed from GCC trunk, 6.0.0-trunk)

I added this directory to ldconfig and ran ldconfig, but it didn't pick up any additional directories. (I think since it is .o and not .so)

As a temporary fix, I tried to symlink to / usr / local / lib 64 / crtbeginS.o - but that gives the same error.

What should I do, so the / usr / local / lib / gcc / x86_64-unknown-linux-gnu / 6.0.0 / directory is always searched 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 the libraries: = / usr / local / lib / gcc / x86_64-unknown-linux-gnu / 6.0.0 /: ... But that 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 enabled.

I would really like to do this as a system default, so I don't have to give -L to everything. I am building bintools fine from source if needed.

+3
gcc g ++ ld binutils


source to share


No one has answered this question yet

Check out similar questions:

138
LD_LIBRARY_PATH vs LIBRARY_PATH
3
g ++ Linker error after upgrade to gcc-4.8 on Debian, libc6
2
gcc and g ++ library search paths
1
Problems with gcc on 64-bit RHEL5
0
Undefined link when linking using pjsip
0
how to compile a static library?
0
Couldn't find when gcc links to libc
0
Where does the gcc -print-file-name / gcc -print-search-dirs configuration result come from?
0
How to add directory to GCC search path (crti.o not found)
-1
build 32 exe on 64bit open suse linux gives error link



All Articles
Loading...
X
Show
Funny
Dev
Pics