Page MenuHomeFreeBSD

libsamplerate: Compile with -fPIC
AbandonedPublic

Authored by christos on Aug 31 2025, 4:05 PM.
Tags
None
Referenced Files
F153010099: D52306.diff
Sat, Apr 18, 2:53 PM
F152983175: D52306.diff
Sat, Apr 18, 11:33 AM
F152977915: D52306.id161290.diff
Sat, Apr 18, 10:56 AM
Unknown Object (File)
Fri, Apr 17, 5:19 AM
Unknown Object (File)
Thu, Apr 16, 9:31 PM
Unknown Object (File)
Thu, Apr 16, 2:23 PM
Unknown Object (File)
Wed, Apr 8, 9:44 AM
Unknown Object (File)
Sat, Apr 4, 2:19 PM
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.