Skip to content

Move -ldl -lm and $(USE_LOG) from LDFLAGS to *_LIBADD#288

Merged
ekanshibu merged 1 commit intoqualcomm:developmentfrom
quic-parihar:makefile_fix
Feb 3, 2026
Merged

Move -ldl -lm and $(USE_LOG) from LDFLAGS to *_LIBADD#288
ekanshibu merged 1 commit intoqualcomm:developmentfrom
quic-parihar:makefile_fix

Conversation

@quic-parihar
Copy link
Contributor

Autotools expects library dependencies to be specified via *_LIBADD, not LDFLAGS. Placing -ldl -lm and $(USE_LOG) in *_LIBADD ensures libtool orders them after objects and before dependent libs, and prevents it from treating dependent libs as linker flags.

This fixes a non-Android link failure on aarch64 where libtool tried to load a .la for BSD and errored with:
libtool: error: '/usr/aarch64-linux-gnu/lib/libbsd.la' is not a valid libtool archive

By moving these flags into lib{adsp,cdsp,sdsp,gdsp}rpc_la_LIBADD and keeping LDFLAGS limited to versioning, the link completes cleanly across targets.

Autotools expects library dependencies to be specified via *_LIBADD,
not LDFLAGS. Placing -ldl -lm and $(USE_LOG) in *_LIBADD ensures
libtool orders them after objects and before dependent libs, and
prevents it from treating dependent libs as linker flags.

This fixes a non-Android link failure on aarch64 where libtool tried
to load a .la for BSD and errored with:
  libtool:   error: '/usr/aarch64-linux-gnu/lib/libbsd.la' is not a
  valid libtool archive

By moving these flags into lib{adsp,cdsp,sdsp,gdsp}rpc_la_LIBADD and
keeping LDFLAGS limited to versioning, the link completes cleanly
across targets.

Signed-off-by: Abhinav Parihar <parihar@qti.qualcomm.com>
@ekanshibu ekanshibu merged commit 7c7c72e into qualcomm:development Feb 3, 2026
18 of 22 checks passed
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.

4 participants

Comments