pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

buildlink3 vs. rust on powerpc?


the patch which previously disabled the check for 8-byte atomics
in llvm has been removed, and instead we're now relying on
devel/libatomic for supplying the required functionality on the
NetBSD/powerpc ports.

Rust 1.47.0 brings us llvm 11 internally.  I have provisionally
added this snippet to the rust Makefile:

.if (${MACHINE_ARCH} == "powerpc")
# LLVM needs libatomic for 64-bit atomics on powerpc
.include "../../devel/libatomic/"

That gets me further than before -- the internal LLVM now builds,
but the build now bombs because rust can't find where -latomic is
when it tries to link

In rust/work/.work.log I find:

<.> /usr/pkgsrc/lang/rust/work/.gcc/bin/gcc -fcommon
-Wl,--as-needed -m32 -Wl,--eh-frame-hdr
<lots of *.o files>
shared -Wl,-zrelro -Wl,-znow -Wl,-O1
<lots of -L options pointing into the build tree>
-Wl,-Bstatic -Wl,--whole-archive
(repeats lots of times with similar *.rlib files)
-Wl,--no-whole-archive -Wl,--start-group -Wl,-Bdynamic
-lstd-9d223a9ee43e47a1 -Wl,--end-group -Wl,-Bstatic
-Wl,-Bdynamic -lrt -lexecinfo -latomic -lpthread -lm -lstdc++
-lutil -lrt -lutil -lexecinfo -lpthread -lrt -lgcc_s -lc -lm -lrt
-lpthread -lutil -lrt -lutil -Wl,-rpath,/usr/pkg/lib
-D_FORTIFY_SOURCE=2 -fstack-protector

Now, you will know that -latomic can be found either in
work/.buildlink/lib/ (symlink put there by buildlink) or in
/usr/pkg/lib.  However, the gcc invocation mentiones none of
those direcotories, and of course the build aborts with

  = note: ld: cannot find -latomic

error: aborting due to previous error

Now...  The first question I have is why would not the cwrapper
layer have included the .buildlink/lib directory in the library
search path?  The second is whether anyone has any other hints
about how I should go about fixing this?  How could I convince
rustc to include e.g. -L/usr/pkg/lib in the command line before
-latomic is referenced?

Any hints welcome.


- Håvard

Home | Main Index | Thread Index | Old Index