Skip to content
Snippets Groups Projects
Commit aebf115f authored by Simon McVittie's avatar Simon McVittie
Browse files

Separate LDFLAGS from LDADD/LIBADD


This affects the order of the linker command line in ways that matter
if you have a linker that defaults to --as-needed, like Ubuntu's, or
if you are linking statically. Dependency libraries (LDADD/LIBADD)
must appear last on the link line (so that they can satisfy
unresolved symbols of earlier items on the link line), while LDFLAGS
appear first.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent ed65d382
Branches
Tags
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
......@@ -33,7 +33,7 @@ dist_doc_DATA = $(foreach doc,$(static_docs),doc/$(doc).txt)
noinst_PROGRAMS = elf-dump
elf_dump_SOURCES = utils/elf-dump.c
elf_dump_LDFLAGS = -ldl
elf_dump_LDADD = -ldl
elf_dump_SOURCES += utils/utils.h
# now the rules for building our installables:
......@@ -45,7 +45,7 @@ capsule_symbols_SOURCES += \
utils/utils.h \
utils/ld-cache.h \
utils/ld-libs.h
capsule_symbols_LDFLAGS = -ldl -lelf
capsule_symbols_LDADD = -ldl -lelf
# this looks like a no-op but it gives capsule_symbols its own target
# so that libtool doesn't get bent out of shape about using an object
# (ld-cache.o, ld-libs.o) as both part of a library and a standalone
......@@ -60,7 +60,7 @@ capsule_version_SOURCES += \
utils/utils.h \
utils/ld-cache.h \
utils/ld-libs.h
capsule_version_LDFLAGS = -ldl -lelf
capsule_version_LDADD = -ldl -lelf
capsule_version_CFLAGS = $(AM_CFLAGS)
......@@ -73,7 +73,8 @@ libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \
utils/mmap-info.c \
utils/ld-cache.c \
utils/ld-libs.c
libcapsule_la_LDFLAGS = -lelf -version-number 0:1 \
libcapsule_la_LDFLAGS = -version-number 0:1
libcapsule_la_LIBADD = -lelf
libcapsule_la_SOURCES += utils/utils.h \
utils/dump.h \
utils/process-pt-dynamic.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment