summaryrefslogtreecommitdiffstats
path: root/libasm
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-02-17 16:11:28 +0100
committerMark Wielaard <mark@klomp.org>2017-07-24 11:01:09 +0200
commit8abf0b5b580094af36b9dc4ed6748379caa32a0e (patch)
treebca019b54b6bd1441b2eb68acf7c50c52a4c27a9 /libasm
parent1dd301b7c302b9df980946e2d04ca99748754991 (diff)
Unify linking of libasm, libelf, libdw, backends
Link them all with -z,defs,-z,relro,--no-undefined, provide complete dependencies for the link steps, and add libeu.a to each one. libeu.a contains useful library functionality that each of them might use. The linker will strip unneeded symbols, so linking it in won't hurt even if none of the functions are used. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'libasm')
-rw-r--r--libasm/ChangeLog11
-rw-r--r--libasm/Makefile.am14
2 files changed, 19 insertions, 6 deletions
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index d2bc4086..262d2a92 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,14 @@
+2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add libasm_so_DEPS to specify external libraries
+ that have to be linked in, and libasm_so_LIBS to specify the
+ archives libasm consists of. The dependencies include libeu.a.
+ (libasm_so_LDLIBS): Add $(libasm_so_DEPS).
+ (libasm_so$(EXEEXT): Use $(libasm_so_LIBS),
+ add --no-undefined,-z,defs,-z,relro,
+ drop the manual enumeration of dependencies,
+ specify the correct path for libasm.map.
+
2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
* asm_end.c (binary_end): Fix nesting of braces.
diff --git a/libasm/Makefile.am b/libasm/Makefile.am
index 8094b05c..9effa6c5 100644
--- a/libasm/Makefile.am
+++ b/libasm/Makefile.am
@@ -55,17 +55,19 @@ libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
libasm_pic_a_SOURCES =
am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
-libasm_so_LDLIBS =
+libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so
+libasm_so_LDLIBS = $(libasm_so_DEPS)
if USE_LOCKS
libasm_so_LDLIBS += -lpthread
endif
+libasm_so_LIBS = libasm_pic.a
libasm_so_SOURCES =
-libasm.so$(EXEEXT): libasm_pic.a libasm.map
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so \
+libasm.so$(EXEEXT): $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS)
+ $(AM_V_CCLD)$(LINK) -shared -o $@ \
+ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \
$(libasm_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)