summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-02-23 17:22:41 +0100
committerUlf Hermann <[email protected]>2017-04-27 15:56:33 +0000
commit121d248c1da7f2130a2edde6d158f116c89ed407 (patch)
treead7a348a88db648da6e2df366d89fcb7b7436a1c /tests
parentf10810fff6fda147f9c07fea0e1b33a7c4d79ad1 (diff)
Add gnulib modules to replace missing libc functionality
This enables us to build a fully featured elfutils package on systems with reduced C libraries, such as windows. All the modules are built into libgnu.a, which is then linked into all binaries if --enable-gnulib is given on the configure line. Change-Id: I743fd22172bc85d9f10dcc3dad8eb921f462b554 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/Makefile.am187
2 files changed, 102 insertions, 89 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 74d7c9a1..fddf3522 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-21 Ulf Hermann <[email protected]>
+
+ * Makefile.am: Link test programs agaist libgnu.a if requested.
+
2017-04-20 Ulf Hermann <[email protected]>
* run-dwfl-addr-sect.sh: Expect section with alphabetically smaller
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f6d8b0d8..53762508 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -396,109 +396,118 @@ endif
libebl = ../libebl/libebl.a
libeu = ../lib/libeu.a
endif !STANDALONE
+if USE_GNULIB
+libgnu = ../libgnu/libgnu.a
+else
+libgnu =
+endif
-arextract_LDADD = $(libelf)
-arsymtest_LDADD = $(libelf)
-newfile_LDADD = $(libelf)
-saridx_LDADD = $(libelf)
-scnnames_LDADD = $(libelf)
-sectiondump_LDADD = $(libelf)
-showptable_LDADD = $(libelf)
-hash_LDADD = $(libelf)
-test_nlist_LDADD = $(libelf)
-msg_tst_LDADD = $(libelf)
-newscn_LDADD = $(libelf)
-early_offscn_LDADD = $(libelf)
-ecp_LDADD = $(libelf)
-update1_LDADD = $(libelf)
-update2_LDADD = $(libelf)
-update3_LDADD = $(libdw) $(libelf)
-update4_LDADD = $(libdw) $(libelf)
-show_die_info_LDADD = $(libdw) $(libelf)
-get_pubnames_LDADD = $(libdw) $(libelf)
-show_abbrev_LDADD = $(libdw) $(libelf)
-get_lines_LDADD = $(libdw) $(libelf)
-get_files_LDADD = $(libdw) $(libelf)
-get_aranges_LDADD = $(libdw) $(libelf)
-allfcts_LDADD = $(libdw) $(libelf)
-line2addr_LDADD = $(libdw) $(argp_LDADD)
-addrscopes_LDADD = $(libdw) $(argp_LDADD)
-funcscopes_LDADD = $(libdw) $(argp_LDADD)
-funcretval_LDADD = $(libdw) $(argp_LDADD)
-allregs_LDADD = $(libdw) $(argp_LDADD)
-find_prologues_LDADD = $(libdw) $(argp_LDADD)
+arextract_LDADD = $(libelf) $(libgnu)
+arsymtest_LDADD = $(libelf) $(libgnu)
+newfile_LDADD = $(libelf) $(libgnu)
+saridx_LDADD = $(libelf) $(libgnu)
+scnnames_LDADD = $(libelf) $(libgnu)
+sectiondump_LDADD = $(libelf) $(libgnu)
+showptable_LDADD = $(libelf) $(libgnu)
+hash_LDADD = $(libelf) $(libgnu)
+test_nlist_LDADD = $(libelf) $(libgnu)
+msg_tst_LDADD = $(libelf) $(libgnu)
+newscn_LDADD = $(libelf) $(libgnu)
+early_offscn_LDADD = $(libelf) $(libgnu)
+ecp_LDADD = $(libelf) $(libgnu)
+update1_LDADD = $(libelf) $(libgnu)
+update2_LDADD = $(libelf) $(libgnu)
+update3_LDADD = $(libdw) $(libelf) $(libgnu)
+update4_LDADD = $(libdw) $(libelf) $(libgnu)
+show_die_info_LDADD = $(libdw) $(libelf) $(libgnu)
+get_pubnames_LDADD = $(libdw) $(libelf) $(libgnu)
+show_abbrev_LDADD = $(libdw) $(libelf) $(libgnu)
+get_lines_LDADD = $(libdw) $(libelf) $(libgnu)
+get_files_LDADD = $(libdw) $(libelf) $(libgnu)
+get_aranges_LDADD = $(libdw) $(libelf) $(libgnu)
+allfcts_LDADD = $(libdw) $(libelf) $(libgnu)
+line2addr_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
+addrscopes_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
+funcscopes_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
+funcretval_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
+allregs_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
+find_prologues_LDADD = $(libdw) $(libgnu) $(argp_LDADD)
#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
-asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
-dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
-rdwrmmap_LDADD = $(libelf)
-dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) -ldl
-arls_LDADD = $(libelf)
-dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) -ldl
-dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) -ldl
-dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) -ldl
-dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
-dwarf_getmacros_LDADD = $(libdw)
-dwarf_ranges_LDADD = $(libdw)
-dwarf_getstring_LDADD = $(libdw)
-addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
-test_flag_nobits_LDADD = $(libelf)
-rerequest_tag_LDADD = $(libdw)
-alldts_LDADD = $(libdw) $(libelf)
-md5_sha1_test_LDADD = $(libeu)
-typeiter_LDADD = $(libdw) $(libelf)
-typeiter2_LDADD = $(libdw) $(libelf)
-low_high_pc_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-test_elf_cntl_gelf_getshdr_LDADD = $(libelf)
-dwflsyms_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-dwfllines_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-dwfl_report_elf_align_LDADD = $(libdw)
-varlocs_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-backtrace_LDADD = $(libdw) $(libelf) $(argp_LDADD)
+asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) $(libgnu) -ldl
+dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) $(argp_LDADD) -ldl
+rdwrmmap_LDADD = $(libelf) $(libgnu)
+dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) -ldl
+arls_LDADD = $(libelf) $(libgnu)
+dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) -ldl
+dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) -ldl
+dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) -ldl
+dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) $(argp_LDADD) -ldl
+dwarf_getmacros_LDADD = $(libdw) $(libgnu)
+dwarf_ranges_LDADD = $(libdw) $(libgnu)
+dwarf_getstring_LDADD = $(libdw) $(libgnu)
+addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libgnu) $(argp_LDADD) -ldl
+test_flag_nobits_LDADD = $(libelf) $(libgnu)
+rerequest_tag_LDADD = $(libdw) $(libgnu)
+alldts_LDADD = $(libdw) $(libelf) $(libgnu)
+md5_sha1_test_LDADD = $(libeu) $(libgnu)
+typeiter_LDADD = $(libdw) $(libelf) $(libgnu)
+typeiter2_LDADD = $(libdw) $(libelf) $(libgnu)
+low_high_pc_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libgnu)
+dwflsyms_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+dwfllines_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+dwfl_report_elf_align_LDADD = $(libdw) $(libgnu)
+varlocs_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+backtrace_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
# backtrace-child-biarch also uses those *_CFLAGS and *_LDLAGS variables:
backtrace_child_CFLAGS = -fPIE
backtrace_child_LDFLAGS = -pie -pthread
backtrace_child_biarch_SOURCES = backtrace-child.c
-backtrace_data_LDADD = $(libdw) $(libelf)
+backtrace_data_LDADD = $(libdw) $(libelf) $(libgnu)
backtrace_dwarf_CFLAGS = -Wno-unused-parameter
-backtrace_dwarf_LDADD = $(libdw) $(libelf)
-debuglink_LDADD = $(libdw) $(libelf)
-debugaltlink_LDADD = $(libdw) $(libelf)
-buildid_LDADD = $(libdw) $(libelf)
-deleted_LDADD = ./deleted-lib.so
+backtrace_dwarf_LDADD = $(libdw) $(libelf) $(libgnu)
+debuglink_LDADD = $(libdw) $(libelf) $(libgnu)
+debugaltlink_LDADD = $(libdw) $(libelf) $(libgnu)
+buildid_LDADD = $(libdw) $(libelf) $(libgnu)
+deleted_LDADD = ./deleted-lib.so $(libgnu)
deleted_lib_so_LDFLAGS = -shared -rdynamic
deleted_lib_so_CFLAGS = -fPIC -fasynchronous-unwind-tables
-aggregate_size_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-peel_type_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-vdsosyms_LDADD = $(libdw) $(libelf)
-getsrc_die_LDADD = $(libdw) $(libelf)
-strptr_LDADD = $(libelf)
-newdata_LDADD = $(libelf)
-elfstrtab_LDADD = $(libelf)
-dwfl_proc_attach_LDADD = $(libdw)
+deleted_lib_so_LDADD = $(libgnu)
+aggregate_size_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+peel_type_LDADD = $(libdw) $(libelf) $(libgnu) $(argp_LDADD)
+vdsosyms_LDADD = $(libdw) $(libelf) $(libgnu)
+getsrc_die_LDADD = $(libdw) $(libelf) $(libgnu)
+strptr_LDADD = $(libelf) $(libgnu)
+newdata_LDADD = $(libelf) $(libgnu)
+elfstrtab_LDADD = $(libelf) $(libgnu)
+dwfl_proc_attach_LDADD = $(libdw) $(libgnu)
dwfl_proc_attach_LDFLAGS = -pthread $(AM_LDFLAGS)
-elfshphehdr_LDADD =$(libelf)
-elfstrmerge_LDADD = $(libdw) $(libelf)
-dwelfgnucompressed_LDADD = $(libelf) $(libdw)
-elfgetchdr_LDADD = $(libelf) $(libdw)
-elfgetzdata_LDADD = $(libelf)
-elfputzdata_LDADD = $(libelf)
-zstrptr_LDADD = $(libelf)
-emptyfile_LDADD = $(libelf)
-vendorelf_LDADD = $(libelf)
-fillfile_LDADD = $(libelf)
+elfshphehdr_LDADD =$(libelf) $(libgnu)
+elfstrmerge_LDADD = $(libdw) $(libelf) $(libgnu)
+dwelfgnucompressed_LDADD = $(libelf) $(libdw) $(libgnu)
+elfgetchdr_LDADD = $(libelf) $(libdw) $(libgnu)
+elfgetzdata_LDADD = $(libelf) $(libgnu)
+elfputzdata_LDADD = $(libelf) $(libgnu)
+zstrptr_LDADD = $(libelf) $(libgnu)
+emptyfile_LDADD = $(libelf) $(libgnu)
+vendorelf_LDADD = $(libelf) $(libgnu)
+fillfile_LDADD = $(libelf) $(libgnu)
# We want to test the libelf header against the system elf.h header.
# Don't include any -I CPPFLAGS.
system_elf_libelf_test_CPPFLAGS =
-system_elf_libelf_test_LDADD = $(libelf)
+if USE_GNULIB
+system_elf_libelf_test_CPPFLAGS += -I$(top_srcdir)/libgnu -I$(top_builddir)/libgnu
+endif
+system_elf_libelf_test_LDADD = $(libelf) $(libgnu)
if GCOV
check: check-am coverage