From eb68e45a484604c43408add312ab5e2fe5f1b5e7 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 6 Sep 2012 21:56:49 +0200 Subject: [PATCH] Build installable libraries with -fpic, -fvisibility=hidden The test case has to be changed to look for files with different names. That because per-target rules cause file renaming in autoconf. Signed-off-by: Mark Wielaard --- libasm/Makefile.am | 1 + libdw/Makefile.am | 1 + libdwelf/Makefile.am | 1 + libdwfl/Makefile.am | 1 + libebl/Makefile.am | 1 + libelf/Makefile.am | 1 + tests/run-arextract.sh | 2 +- 7 files changed, 7 insertions(+), 1 deletions(-) diff --git a/libasm/Makefile.am b/libasm/Makefile.am index 3d6a2e5..89be3e9 100644 --- a/libasm/Makefile.am +++ b/libasm/Makefile.am @@ -38,6 +38,7 @@ noinst_LIBRARIES = libasm_pic.a noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) pkginclude_HEADERS = libasm.h +libasm_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS) libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \ asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \ asm_newsubscn.c asm_newsym.c asm_newcomsym.c \ diff --git a/libdw/Makefile.am b/libdw/Makefile.am index f33ee7f..2b60b8a 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -41,6 +41,7 @@ noinst_PROGRAMS = libdw.so include_HEADERS = dwarf.h pkginclude_HEADERS = libdw.h +libdw_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS) libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ diff --git a/libdwelf/Makefile.am b/libdwelf/Makefile.am index cd4b7dd..4f3727c 100644 --- a/libdwelf/Makefile.am +++ b/libdwelf/Makefile.am @@ -39,6 +39,7 @@ noinst_LIBRARIES = libdwelf.a libdwelf_pic.a pkginclude_HEADERS = libdwelf.h noinst_HEADERS = libdwelfP.h +libdwelf_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS) libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \ dwelf_elf_gnu_build_id.c diff --git a/libdwfl/Makefile.am b/libdwfl/Makefile.am index 72c980b..705bd7b 100644 --- a/libdwfl/Makefile.am +++ b/libdwfl/Makefile.am @@ -39,6 +39,7 @@ noinst_LIBRARIES += libdwfl_pic.a pkginclude_HEADERS = libdwfl.h +libdwfl_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS) libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ dwfl_module.c dwfl_report_elf.c relocate.c \ dwfl_module_build_id.c dwfl_module_report_build_id.c \ diff --git a/libebl/Makefile.am b/libebl/Makefile.am index ec4477b..2e2bf83 100644 --- a/libebl/Makefile.am +++ b/libebl/Makefile.am @@ -57,6 +57,7 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \ eblunwind.c eblresolvesym.c eblcheckreloctargettype.c +libebl_a_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) libebl_a_SOURCES = $(gen_SOURCES) noinst_HEADERS = libeblP.h ebl-hooks.h diff --git a/libelf/Makefile.am b/libelf/Makefile.am index 493e4ec..31fa8a4 100644 --- a/libelf/Makefile.am +++ b/libelf/Makefile.am @@ -41,6 +41,7 @@ include_HEADERS = libelf.h gelf.h nlist.h pkginclude_HEADERS = elf-knowledge.h +libelf_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS) libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ gelf_getclass.c elf_getbase.c elf_getident.c \ diff --git a/tests/run-arextract.sh b/tests/run-arextract.sh index 44f4a52..0532952 100755 --- a/tests/run-arextract.sh +++ b/tests/run-arextract.sh @@ -26,7 +26,7 @@ if test -f $archive; then echo -n "Extracting symbols... $ac_c" # The files we are looking at. - for f in ${abs_top_builddir}/libelf/*.o; do + for f in ${abs_top_builddir}/libelf/libelf_a-*.o; do testrun ${abs_builddir}/arextract $archive `basename $f` arextract.test || exit 1 cmp $f arextract.test || { echo "Extraction of $1 failed" -- 1.7.1