You are not logged in.
Hello,
I am intending on making a package which would build and install the musl cross compiler toolchain (on multiple architectures separate packages) using the musl-cross-make makefile scripts. I am testing the make process and and have found the building to be relatively easy, but I am running into issues including library paths and having the dynamic linker find libraries like libsystemd.so.0 (just as an example).
When compiling my test c file, I would use the following command first to get an object file:
$ARCH-linux-musl-gcc -Wall -Og -c somefile.cAnd this works fine.
I didn't manage, though, to have the .o file turned into an ELF for the reason that the linker is only searching for libraries in the local directory, and including flags has only helped resolve top level dependencies.
$ARCH-linux-musl-ld somefile.o -rpath=/usr/lib -L/usr/lib -ldbus-1 $ARCH-linux-musl-gcc somefile.o -L/usr/lib -ldbus-1 Both did not work, while GNU;
$gcc somefile.o -ldbus-1 Links without a problem.
Now I suppose that I could just use GCC here to link, although I am not sure what kind of undefined behaviour I would provoke, but I am interested if anybody possibly knows how to include the library paths gcc's ld uses for musl too - note, that I've tried moving the ld-musl-$ARCH.so.1 file into /lib/ and specifying in the /etc/ld-musl-$ARCH.path file the /usr/lib path, but this did not work.
Does anyone have an idea possibly?
SOLUTION:
The solution is building the required dependencies with the musl cross compiler toolchain, because glibc libraries and musl do not mix together. This is hardware agnostic meaning the "issue" (is just expected behaviour) could persist on all platforms.
Last edited by makeshift_rephrase (2022-10-31 20:41:37)
Offline