Skip to content

Conversation

@wardviaene
Copy link

@wardviaene wardviaene commented Dec 15, 2025

Related to #84

The downloaded asset sqlite-vec-0.1.6-loadable-linux-x86_64.tar.gz has this output from ldd:

	linux-vdso.so.1 (0x00007ffff81f4000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000079df72200000)
	/lib64/ld-linux-x86-64.so.2 (0x000079df724b5000)

The -lm flag needs to be moved to the end. After the change, the ldd output is:

	linux-vdso.so.1 (0x00007ffcfbf8d000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000706bf3b42000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000706bf3800000)
	/lib64/ld-linux-x86-64.so.2 (0x0000706bf3c56000)

Fixing the dependency on libm, and removing any undefined symbol: sqrtf errors when downloading the shared library file

vlasky added a commit to vlasky/sqlite-vec that referenced this pull request Dec 29, 2025
Move the -lm flag from CFLAGS to a new LDLIBS variable and place it
at the end of the linker command. This ensures libm is properly linked
on Linux systems.

The linker processes arguments left-to-right, so library flags must
come after source files that reference their symbols. Previously,
-lm appeared before the source file, causing "undefined symbol: sqrtf"
errors on some Linux distributions.

Cherry-picked from upstream PR asg017#252

Co-Authored-By: wardviaene <ward.viaene@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant