error: linking with `cc` failed: exit code: 1
[...]
note: /usr/bin/ld: /path/to/md/libmd.a(acosh.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/path/to/md/libmd.a(acosh.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: aborting due to previous error
I don't understand why rustc tries making a shared object. Changing the argument to -l dylib does not make any difference.
The text was updated successfully, but these errors were encountered:
This is actually working as intended because rustc produces position-independent output by default (even for executables, not just for dynamic libraries). You'll need to add -fPIC to your makefiles for the native library or use a build dependency like gcc to build native code.
When trying to link to a static C library called
mdit fails:
I don't understand why rustc tries making a shared object. Changing the argument to
-l dylibdoes not make any difference.The text was updated successfully, but these errors were encountered: