Using -latomic from non-default directory

Hi, got redirected here from users.rust-lang.org.

I'm doing my best to keep rust building for a few of the NetBSD ports, and try to keep our pkgsrc package of rust up to date. One of the targets I build for is 32-bit powerpc. I've just updated our rust package to 1.47.0. We used to patch away llvm's insistence on 8-byte atomics, since llvm itself didn't actually use or need it, but that patch is now gone for other reasons. So this means that at least the 32-bit powerpc ports now need the -latomic library linked. On NetBSD, the -latomic library comes from pkgsrc, so is by default stored in /usr/pkg/lib , which is of course not in cc's default library search path. The embedded LLVM inside rust finds this library just fine during the build process, but when the rustc_driver module is being built, it seems "something" has forgotten to instruct the cc invocation to search the required directory, so the build bombs out with = note: ld: cannot find -latomic . This is while trying to link build/powerpc-unknown-netbsd/stage0-rustc/powerpc-unknown-netbsd/release/deps/librustc_driver-49ee60c26d716438.so .

The question is if someone has any hints for how and where I should go about mending this problem? I'm fairly unfamiliar with both rust the language and the internals of the build setup, but can cargo-cult with the best if I'm given some direction. :slight_smile:

Anyone?

Yes, I found rustc_target/src/spec/netbsd_base.rs which could be tweaked, and inserted a "special" directory to be searched, and made a package which places symlinks to libatomic.* in that directory, so the problem is worked around.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.