Page MenuHomeFreeBSD

libsamplerate: Compile with -fPIC
AbandonedPublic

Authored by christos on Aug 31 2025, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 26, 2:40 AM
Unknown Object (File)
Sun, Jan 25, 9:19 AM
Unknown Object (File)
Thu, Jan 22, 1:58 PM
Unknown Object (File)
Sun, Jan 18, 2:56 PM
Unknown Object (File)
Sun, Jan 18, 1:50 PM
Unknown Object (File)
Sat, Jan 10, 2:23 PM
Unknown Object (File)
Dec 31 2025, 3:33 PM
Unknown Object (File)
Dec 13 2025, 12:52 AM
Subscribers

Details

Reviewers
fuz
kevans
Summary

Fixes the following warnings:

ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC

defined in /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a(samplerate.o)
referenced by samplerate.c:498 (/usr/src/contrib/libsamplerate/samplerate.c:498)

samplerate.o:(src_new) in archive /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 66714
Build 63597: arc lint + arc unit

Event Timeline

The problem here is that we made libsamplerate an internal library, which means it's a static library. However, various virtual_oss plugins (which are shared objects) link libsamplerate, so an attempt is made to link a static library into a shared object.

The correct fix is probably to turn this from an internal library into a private library, which means it's a shared object. It's also conceivable to just link it statically into the various plugins, but at 1.5 MB for the library, that's quite the wasted space.