Linker problems with clang /usr/local/lib

Johannes Lundberg johalun0 at gmail.com
Sun Jan 22 20:29:05 UTC 2017


Hi

How can I make 'cc' (/usr/bin/ld) look for libraries in /usr/local/lib
without having to specify environment or command line variables?

I got "/usr/local/lib" in /etc/ld.so.conf and /var/run/ld-elf.so.hints.

/sbin/ldconfig -l xxx can find library xxx in /usr/local/lib

/usr/bin/ld can not.

This is a problem when building Rust crates with Cargo which does not care
about env variables like LDFLAGS. I can however override the linker and use
'gcc' which solves the problem but I assume it should be possible to get
clang (cc) to look in /usr/local/lib as well.

Anyone got any ideas?


More information about the freebsd-current mailing list