100-portability.patch 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -20,6 +20,7 @@ dnl You should have received a copy of
  4. dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
  5. AC_INIT([elfutils],[0.189],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/])
  6. +AC_CONFIG_MACRO_DIRS([m4])
  7. dnl Workaround for older autoconf < 2.64
  8. m4_ifndef([AC_PACKAGE_URL],
  9. [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"],
  10. @@ -43,16 +44,17 @@ elif test "x$program_prefix" = "x"; then
  11. fi
  12. AC_CONFIG_AUX_DIR([config])
  13. -AC_CONFIG_FILES([config/Makefile])
  14. +AC_CONFIG_FILES([config/Makefile libgnu/Makefile])
  15. AC_COPYRIGHT([Copyright (C) 1996-2023 The elfutils developers.])
  16. -AC_PREREQ(2.63) dnl Minimum Autoconf version required.
  17. +AC_PREREQ(2.64) dnl Minimum Autoconf version required.
  18. dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
  19. AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
  20. AM_MAINTAINER_MODE
  21. AM_SILENT_RULES([yes])
  22. +AC_USE_SYSTEM_EXTENSIONS()
  23. AC_CONFIG_SRCDIR([libelf/libelf.h])
  24. AC_CONFIG_FILES([Makefile])
  25. @@ -89,12 +91,14 @@ AS_IF([test "$use_locks" = yes],
  26. AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
  27. m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
  28. +gl_EARLY
  29. +gl_INIT
  30. AC_PROG_CXX
  31. -AC_PROG_RANLIB
  32. AC_PROG_YACC
  33. AC_PROG_LEX([noyywrap])
  34. # Only available since automake 1.12
  35. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  36. +LT_INIT()
  37. AC_CHECK_TOOL([READELF], [readelf])
  38. AC_CHECK_TOOL([NM], [nm])
  39. @@ -195,7 +199,6 @@ AC_CACHE_CHECK([whether the compiler gen
  40. AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))])
  41. if test "$ac_cv_buildid" = "no"; then
  42. AC_MSG_WARN([compiler doesn't generate build-id by default])
  43. - LDFLAGS="$LDFLAGS -Wl,--build-id"
  44. fi
  45. ZRELRO_LDFLAGS="-Wl,-z,relro"
  46. @@ -635,36 +638,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
  47. CFLAGS="$old_CFLAGS"])
  48. AS_IF([test "x$ac_cv_fno_addrsig" = "xyes"], CFLAGS="$CFLAGS -fno-addrsig")
  49. -saved_LIBS="$LIBS"
  50. -AC_SEARCH_LIBS([argp_parse], [argp])
  51. -LIBS="$saved_LIBS"
  52. -case "$ac_cv_search_argp_parse" in
  53. - no) AC_MSG_FAILURE([failed to find argp_parse]) ;;
  54. - -l*) argp_LDADD="$ac_cv_search_argp_parse" ;;
  55. - *) argp_LDADD= ;;
  56. -esac
  57. -AC_SUBST([argp_LDADD])
  58. -
  59. -saved_LIBS="$LIBS"
  60. -AC_SEARCH_LIBS([fts_close], [fts])
  61. -LIBS="$saved_LIBS"
  62. -case "$ac_cv_search_fts_close" in
  63. - no) AC_MSG_FAILURE([failed to find fts_close]) ;;
  64. - -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
  65. - *) fts_LIBS= ;;
  66. -esac
  67. -AC_SUBST([fts_LIBS])
  68. -
  69. -saved_LIBS="$LIBS"
  70. -AC_SEARCH_LIBS([_obstack_free], [obstack])
  71. -LIBS="$saved_LIBS"
  72. -case "$ac_cv_search__obstack_free" in
  73. - no) AC_MSG_FAILURE([failed to find _obstack_free]) ;;
  74. - -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
  75. - *) obstack_LIBS= ;;
  76. -esac
  77. -AC_SUBST([obstack_LIBS])
  78. -
  79. dnl The directories with content.
  80. dnl Documentation.
  81. --- a/Makefile.am
  82. +++ b/Makefile.am
  83. @@ -26,11 +26,11 @@ AM_MAKEFLAGS = --no-print-directory
  84. pkginclude_HEADERS = version.h
  85. -SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
  86. - libasm debuginfod src po doc tests
  87. +SUBDIRS = libgnu config lib libelf libcpu backends libebl libdwelf libdwfl libdw
  88. EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
  89. - COPYING COPYING-GPLV2 COPYING-LGPLV3
  90. + COPYING COPYING-GPLV2 COPYING-LGPLV3 \
  91. + m4/gnulib-cache.m4
  92. # Make sure the test install uses lib64 when $LIB will yield lib64.
  93. # Make sure the test build uses the same compiler, which on e.g. ppc64
  94. --- a/libelf/elf_update.c
  95. +++ b/libelf/elf_update.c
  96. @@ -37,6 +37,33 @@
  97. #include "libelfP.h"
  98. +#include "elf_fill.c"
  99. +
  100. +#ifdef __APPLE__
  101. +static int posix_fallocate(int fd, off_t offset, off_t len)
  102. +{
  103. + off_t c_test;
  104. + int ret;
  105. + if (!__builtin_saddll_overflow(offset, len, &c_test)) {
  106. + fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, offset + len, 0};
  107. + // Try to get a continuous chunk of disk space
  108. + ret = fcntl(fd, F_PREALLOCATE, &store);
  109. + if (ret < 0) {
  110. + // OK, perhaps we are too fragmented, allocate non-continuous
  111. + store.fst_flags = F_ALLOCATEALL;
  112. + ret = fcntl(fd, F_PREALLOCATE, &store);
  113. + if (ret < 0) {
  114. + return ret;
  115. + }
  116. + }
  117. + ret = ftruncate(fd, offset + len);
  118. + } else {
  119. + // offset+len would overflow.
  120. + ret = -1;
  121. + }
  122. + return ret;
  123. +}
  124. +#endif
  125. static int64_t
  126. write_file (Elf *elf, int64_t size, int change_bo, size_t shnum)
  127. --- a/lib/eu-config.h
  128. +++ b/lib/eu-config.h
  129. @@ -52,14 +52,18 @@
  130. # define rwlock_unlock(lock) ((void) (lock))
  131. #endif /* USE_LOCKS */
  132. -#include <libintl.h>
  133. +#include <gettext.h>
  134. /* gettext helper macros. */
  135. #define N_(Str) Str
  136. #define _(Str) dgettext ("elfutils", Str)
  137. /* Compiler-specific definitions. */
  138. +#ifdef __APPLE__
  139. +#define strong_alias(name, aliasname)
  140. +#else
  141. #define strong_alias(name, aliasname) \
  142. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  143. +#endif
  144. #ifdef __i386__
  145. # define internal_function __attribute__ ((regparm (3), stdcall))
  146. @@ -70,12 +74,7 @@
  147. #define internal_strong_alias(name, aliasname) \
  148. extern __typeof (name) aliasname __attribute__ ((alias (#name))) internal_function;
  149. -#ifdef HAVE_VISIBILITY
  150. -#define attribute_hidden \
  151. - __attribute__ ((visibility ("hidden")))
  152. -#else
  153. #define attribute_hidden /* empty */
  154. -#endif
  155. #ifdef HAVE_GCC_STRUCT
  156. #define attribute_packed \
  157. @@ -159,7 +158,7 @@ asm (".section predict_data, \"aw\"; .pr
  158. #endif
  159. /* Avoid PLT entries. */
  160. -#ifdef PIC
  161. +#if defined(PIC) && !defined(__APPLE__)
  162. # define INTUSE(name) _INTUSE(name)
  163. # define _INTUSE(name) __##name##_internal
  164. # define INTDEF(name) _INTDEF(name)
  165. --- a/config/eu.am
  166. +++ b/config/eu.am
  167. @@ -31,7 +31,7 @@
  168. ##
  169. DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
  170. -AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
  171. +AM_CPPFLAGS = -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
  172. # Drop the 'u' flag that automake adds by default. It is incompatible
  173. # with deterministic archives.
  174. --- a/libelf/Makefile.am
  175. +++ b/libelf/Makefile.am
  176. @@ -34,9 +34,7 @@ endif
  177. VERSION = 1
  178. -lib_LIBRARIES = libelf.a
  179. -noinst_LIBRARIES = libelf_pic.a
  180. -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
  181. +lib_LTLIBRARIES = libelf.la
  182. include_HEADERS = libelf.h gelf.h nlist.h
  183. noinst_HEADERS = abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
  184. @@ -51,7 +49,8 @@ endif
  185. pkginclude_HEADERS = elf-knowledge.h
  186. -libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
  187. +libelf_la_LIBADD = ../libgnu/libgnu.la ../lib/libeu.la -lz $(zstd_LIBS) -lpthread
  188. +libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \
  189. elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \
  190. gelf_getclass.c elf_getbase.c elf_getident.c \
  191. elf32_fsize.c elf64_fsize.c gelf_fsize.c \
  192. @@ -102,37 +101,9 @@ libelf_a_SOURCES = elf_version.c elf_has
  193. elf32_getchdr.c elf64_getchdr.c gelf_getchdr.c \
  194. elf_compress.c elf_compress_gnu.c
  195. -libelf_pic_a_SOURCES =
  196. -am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
  197. -
  198. -libelf_so_DEPS = ../lib/libeu.a
  199. -libelf_so_LDLIBS = $(libelf_so_DEPS) -lz $(zstd_LIBS)
  200. -if USE_LOCKS
  201. -libelf_so_LDLIBS += -lpthread
  202. -endif
  203. -
  204. -libelf_so_LIBS = libelf_pic.a
  205. -libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
  206. - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
  207. - -Wl,--soname,$@.$(VERSION) \
  208. - -Wl,--version-script,$< \
  209. - $(NO_UNDEFINED) \
  210. - -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \
  211. - $(libelf_so_LDLIBS)
  212. - @$(textrel_check)
  213. - $(AM_V_at)ln -fs $@ $@.$(VERSION)
  214. -
  215. -install: install-am libelf.so
  216. +install: install-am
  217. $(mkinstalldirs) $(DESTDIR)$(libdir)
  218. - $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
  219. - ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
  220. - ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so
  221. uninstall: uninstall-am
  222. - rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
  223. - rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
  224. - rm -f $(DESTDIR)$(libdir)/libelf.so
  225. EXTRA_DIST = libelf.map
  226. -
  227. -CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so libelf.so.$(VERSION)
  228. --- a/backends/i386_auxv.c
  229. +++ b/backends/i386_auxv.c
  230. @@ -48,5 +48,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c
  231. return 1;
  232. }
  233. -__typeof (i386_auxv_info) x86_64_auxv_info
  234. - __attribute__ ((alias ("i386_auxv_info")));
  235. +auxv_info_alias(x86_64)
  236. --- a/backends/ppc_regs.c
  237. +++ b/backends/ppc_regs.c
  238. @@ -204,5 +204,11 @@ ppc_register_info (Ebl *ebl __attribute_
  239. return namelen;
  240. }
  241. -__typeof (ppc_register_info)
  242. - ppc64_register_info __attribute__ ((alias ("ppc_register_info")));
  243. +ssize_t
  244. +ppc64_register_info (Ebl *ebl,
  245. + int regno, char *name, size_t namelen,
  246. + const char **prefix, const char **setname,
  247. + int *bits, int *type)
  248. +{
  249. + return ppc_register_info(ebl, regno, name, namelen, prefix, setname, bits, type);
  250. +}
  251. --- a/backends/libebl_CPU.h
  252. +++ b/backends/libebl_CPU.h
  253. @@ -97,4 +97,10 @@ dwarf_is_pointer (int tag)
  254. case DW_TAG_reference_type: \
  255. case DW_TAG_rvalue_reference_type
  256. +#define auxv_info_alias(arch) \
  257. + int EBLHOOK_1(arch, auxv_info) (GElf_Xword a_type, const char **name, const char **format) \
  258. + { \
  259. + return EBLHOOK(auxv_info)(a_type, name, format); \
  260. + }
  261. +
  262. #endif /* libebl_CPU.h */
  263. --- a/backends/ppc_auxv.c
  264. +++ b/backends/ppc_auxv.c
  265. @@ -51,5 +51,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c
  266. return 1;
  267. }
  268. -__typeof (ppc_auxv_info) ppc64_auxv_info
  269. - __attribute__ ((alias ("ppc_auxv_info")));
  270. +auxv_info_alias(ppc64)
  271. --- a/backends/ppc_cfi.c
  272. +++ b/backends/ppc_cfi.c
  273. @@ -72,6 +72,7 @@ ppc_abi_cfi (Ebl *ebl __attribute__ ((un
  274. return 0;
  275. }
  276. -__typeof (ppc_abi_cfi)
  277. - ppc64_abi_cfi
  278. - __attribute__ ((alias ("ppc_abi_cfi")));
  279. +int ppc64_abi_cfi(Ebl *ebl, Dwarf_CIE *abi_info)
  280. +{
  281. + return ppc_abi_cfi(ebl, abi_info);
  282. +}
  283. --- a/backends/ppc_initreg.c
  284. +++ b/backends/ppc_initreg.c
  285. @@ -68,9 +68,10 @@ ppc_dwarf_to_regno (Ebl *ebl __attribute
  286. abort ();
  287. }
  288. -__typeof (ppc_dwarf_to_regno)
  289. - ppc64_dwarf_to_regno
  290. - __attribute__ ((alias ("ppc_dwarf_to_regno")));
  291. +bool ppc64_dwarf_to_regno (Ebl *ebl, unsigned *regno)
  292. +{
  293. + return ppc_dwarf_to_regno(ebl, regno);
  294. +}
  295. bool
  296. ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
  297. @@ -127,6 +128,7 @@ ppc_set_initial_registers_tid (pid_t tid
  298. #endif /* __powerpc__ */
  299. }
  300. -__typeof (ppc_set_initial_registers_tid)
  301. - ppc64_set_initial_registers_tid
  302. - __attribute__ ((alias ("ppc_set_initial_registers_tid")));
  303. +bool ppc64_set_initial_registers_tid(pid_t tid, ebl_tid_registers_t *setfunc, void *arg)
  304. +{
  305. + return ppc_set_initial_registers_tid(tid, setfunc, arg);
  306. +}
  307. --- a/backends/ppc_attrs.c
  308. +++ b/backends/ppc_attrs.c
  309. @@ -81,6 +81,9 @@ ppc_check_object_attribute (Ebl *ebl __a
  310. return false;
  311. }
  312. -__typeof (ppc_check_object_attribute)
  313. - ppc64_check_object_attribute
  314. - __attribute__ ((alias ("ppc_check_object_attribute")));
  315. +bool ppc64_check_object_attribute(Ebl *ebl,
  316. + const char *vendor, int tag, uint64_t value,
  317. + const char **tag_name, const char **value_name)
  318. +{
  319. + return ppc_check_object_attribute(ebl, vendor, tag, value, tag_name, value_name);
  320. +}
  321. --- a/lib/libeu.h
  322. +++ b/lib/libeu.h
  323. @@ -45,4 +45,11 @@ extern char *xasprintf(const char *fmt,
  324. extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
  325. extern int crc32_file (int fd, uint32_t *resp);
  326. +#ifdef __APPLE__
  327. +static inline void tdestroy(void *root __attribute__ ((unused)),
  328. + void (*freekey)(void *) __attribute__ ((unused)))
  329. +{
  330. +}
  331. +#endif
  332. +
  333. #endif
  334. --- a/libdwfl/libdwflP.h
  335. +++ b/libdwfl/libdwflP.h
  336. @@ -31,6 +31,8 @@
  337. #include <libdwfl.h>
  338. #include <libebl.h>
  339. +#include <libeu.h>
  340. +#include <libgen.h>
  341. #include <assert.h>
  342. #include <dirent.h>
  343. #include <errno.h>
  344. --- /dev/null
  345. +++ b/lib/stdio_ext.h
  346. @@ -0,0 +1,6 @@
  347. +#include <stdio.h>
  348. +#ifndef __APPLE__
  349. +#include_next <stdio_ext.h>
  350. +#else
  351. +#define __fsetlocking(...) 0
  352. +#endif
  353. --- a/libdw/libdwP.h
  354. +++ b/libdw/libdwP.h
  355. @@ -32,8 +32,10 @@
  356. #include <stdbool.h>
  357. #include <pthread.h>
  358. +#include <libeu.h>
  359. #include <libdw.h>
  360. #include <dwarf.h>
  361. +#include <libgen.h>
  362. /* Known location expressions already decoded. */
  363. --- a/libdw/Makefile.am
  364. +++ b/libdw/Makefile.am
  365. @@ -34,14 +34,12 @@ endif
  366. AM_CPPFLAGS += -I$(srcdir)/../libebl -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf -pthread
  367. VERSION = 1
  368. -lib_LIBRARIES = libdw.a
  369. -noinst_LIBRARIES = libdw_pic.a
  370. -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
  371. +lib_LTLIBRARIES = libdw.la
  372. include_HEADERS = dwarf.h
  373. pkginclude_HEADERS = libdw.h known-dwarf.h
  374. -libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
  375. +libdw_la_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
  376. dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \
  377. dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \
  378. dwarf_attr.c dwarf_formstring.c \
  379. @@ -103,50 +101,12 @@ $(srcdir)/known-dwarf.h: $(top_srcdir)/c
  380. mv -f [email protected] $@
  381. endif
  382. -libdw_pic_a_SOURCES =
  383. -am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
  384. -
  385. -libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
  386. - ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
  387. - ../libdwfl/libdwfl_pic.a
  388. -libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
  389. -libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread
  390. -libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
  391. - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
  392. - -Wl,--soname,$@.$(VERSION),--enable-new-dtags \
  393. - -Wl,--version-script,$< \
  394. - $(NO_UNDEFINED) \
  395. - -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \
  396. - $(libdw_so_LDLIBS)
  397. - @$(textrel_check)
  398. - $(AM_V_at)ln -fs $@ $@.$(VERSION)
  399. -
  400. -install: install-am libdw.so
  401. - $(mkinstalldirs) $(DESTDIR)$(libdir)
  402. - $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
  403. - ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
  404. - ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so
  405. -
  406. -uninstall: uninstall-am
  407. - rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
  408. - rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
  409. - rm -f $(DESTDIR)$(libdir)/libdw.so
  410. - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
  411. -
  412. -libdwfl_objects = $(shell $(AR) t ../libdwfl/libdwfl.a)
  413. -libdw_a_LIBADD = $(addprefix ../libdwfl/,$(libdwfl_objects))
  414. -
  415. -libdwelf_objects = $(shell $(AR) t ../libdwelf/libdwelf.a)
  416. -libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects))
  417. -
  418. -libebl_objects = $(shell $(AR) t ../libebl/libebl.a)
  419. -libdw_a_LIBADD += $(addprefix ../libebl/,$(libebl_objects))
  420. -
  421. -backends_objects = $(shell $(AR) t ../backends/libebl_backends.a)
  422. -libdw_a_LIBADD += $(addprefix ../backends/,$(backends_objects))
  423. -
  424. -libcpu_objects = $(shell $(AR) t ../libcpu/libcpu.a)
  425. -libdw_a_LIBADD += $(addprefix ../libcpu/,$(libcpu_objects))
  426. +libdw_la_LIBADD = \
  427. + ../libdwfl/libdwfl.la \
  428. + ../libdwelf/libdwelf.la \
  429. + ../libebl/libebl.la \
  430. + ../backends/libebl_backends.la \
  431. + ../libcpu/libcpu.la
  432. noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
  433. dwarf_sig8_hash.h cfi.h encoded-value.h
  434. --- a/libasm/Makefile.am
  435. +++ b/libasm/Makefile.am
  436. @@ -32,12 +32,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/libelf -I
  437. VERSION = 1
  438. -lib_LIBRARIES = libasm.a
  439. -noinst_LIBRARIES = libasm_pic.a
  440. -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
  441. +lib_LTLIBRARIES = libasm.la
  442. pkginclude_HEADERS = libasm.h
  443. -libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
  444. +libasm_la_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
  445. asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
  446. asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
  447. asm_newabssym.c \
  448. @@ -51,38 +49,6 @@ libasm_a_SOURCES = asm_begin.c asm_abort
  449. disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
  450. symbolhash.c
  451. -libasm_pic_a_SOURCES =
  452. -am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
  453. -
  454. -libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl_pic.a ../libelf/libelf.so ../libdw/libdw.so
  455. -libasm_so_LDLIBS = $(libasm_so_DEPS)
  456. -if USE_LOCKS
  457. -libasm_so_LDLIBS += -lpthread
  458. -endif
  459. -
  460. -libasm_so_LIBS = libasm_pic.a
  461. -libasm.so: $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS)
  462. - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
  463. - -Wl,--soname,$@.$(VERSION) \
  464. - -Wl,--version-script,$< \
  465. - $(NO_UNDEFINED) \
  466. - -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \
  467. - $(libasm_so_LDLIBS)
  468. - @$(textrel_check)
  469. - $(AM_V_at)ln -fs $@ $@.$(VERSION)
  470. -
  471. -install: install-am libasm.so
  472. - $(mkinstalldirs) $(DESTDIR)$(libdir)
  473. - $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
  474. - ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
  475. - ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so
  476. -
  477. -uninstall: uninstall-am
  478. - rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
  479. - rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
  480. - rm -f $(DESTDIR)$(libdir)/libasm.so
  481. - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
  482. -
  483. noinst_HEADERS = libasmP.h symbolhash.h
  484. EXTRA_DIST = libasm.map
  485. --- a/libdwfl/Makefile.am
  486. +++ b/libdwfl/Makefile.am
  487. @@ -34,13 +34,11 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/.
  488. -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf -I$(builddir)/../debuginfod
  489. VERSION = 1
  490. -noinst_LIBRARIES = libdwfl.a
  491. -noinst_LIBRARIES += libdwfl_pic.a
  492. +noinst_LTLIBRARIES = libdwfl.la
  493. pkginclude_HEADERS = libdwfl.h
  494. -
  495. -libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
  496. +libdwfl_la_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
  497. dwfl_module.c dwfl_report_elf.c relocate.c \
  498. dwfl_module_build_id.c dwfl_module_report_build_id.c \
  499. derelocate.c offline.c segment.c \
  500. @@ -73,24 +71,14 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
  501. gzip.c debuginfod-client.c
  502. if BZLIB
  503. -libdwfl_a_SOURCES += bzip2.c
  504. +libdwfl_la_SOURCES += bzip2.c
  505. endif
  506. if LZMA
  507. -libdwfl_a_SOURCES += lzma.c
  508. +libdwfl_la_SOURCES += lzma.c
  509. endif
  510. if ZSTD
  511. -libdwfl_a_SOURCES += zstd.c
  512. +libdwfl_la_SOURCES += zstd.c
  513. endif
  514. -libdwfl = $(libdw)
  515. -libdw = ../libdw/libdw.so
  516. -libelf = ../libelf/libelf.so
  517. -libebl = ../libebl/libebl.a
  518. -libeu = ../lib/libeu.a
  519. -
  520. -libdwfl_pic_a_SOURCES =
  521. -am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
  522. -
  523. noinst_HEADERS = libdwflP.h
  524. -CLEANFILES += $(am_libdwfl_pic_a_OBJECTS)
  525. --- a/backends/Makefile.am
  526. +++ b/backends/Makefile.am
  527. @@ -34,7 +34,7 @@ endif
  528. AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
  529. -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
  530. -noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
  531. +noinst_LTLIBRARIES = libebl_backends.la
  532. modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
  533. m68k bpf riscv csky loongarch arc
  534. @@ -100,17 +100,13 @@ loongarch_SRCS = loongarch_init.c loonga
  535. arc_SRCS = arc_init.c arc_symbol.c
  536. -libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
  537. +libebl_backends_la_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
  538. $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
  539. $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
  540. $(ppc64_SRCS) $(s390_SRCS) \
  541. $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \
  542. $(loongarch_SRCS) $(arc_SRCS)
  543. -libebl_backends_pic_a_SOURCES =
  544. -am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
  545. noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
  546. EXTRA_DIST = $(modules:=_reloc.def)
  547. -
  548. -MOSTLYCLEANFILES = $(am_libebl_backends_pic_a_OBJECTS)
  549. --- a/libdwelf/Makefile.am
  550. +++ b/libdwelf/Makefile.am
  551. @@ -34,24 +34,12 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$
  552. -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl
  553. VERSION = 1
  554. -noinst_LIBRARIES = libdwelf.a libdwelf_pic.a
  555. +noinst_LTLIBRARIES = libdwelf.la
  556. pkginclude_HEADERS = libdwelf.h
  557. noinst_HEADERS = libdwelfP.h
  558. -libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \
  559. +libdwelf_la_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \
  560. dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \
  561. dwelf_strtab.c dwelf_elf_begin.c \
  562. dwelf_elf_e_machine_string.c
  563. -
  564. -libdwelf = $(libdw)
  565. -
  566. -libdw = ../libdw/libdw.so
  567. -libelf = ../libelf/libelf.so
  568. -libebl = ../libebl/libebl.a
  569. -libeu = ../lib/libeu.a
  570. -
  571. -libdwelf_pic_a_SOURCES =
  572. -am_libdwelf_pic_a_OBJECTS = $(libdwelf_a_SOURCES:.c=.os)
  573. -
  574. -CLEANFILES += $(am_libdwelf_pic_a_OBJECTS)
  575. --- a/libebl/Makefile.am
  576. +++ b/libebl/Makefile.am
  577. @@ -34,9 +34,9 @@ endif
  578. AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm
  579. VERSION = 1
  580. -noinst_LIBRARIES = libebl.a libebl_pic.a
  581. +noinst_LTLIBRARIES = libebl.la
  582. -libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
  583. +libebl_la_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
  584. eblsegmenttypename.c eblsectiontypename.c \
  585. eblmachineflagname.c eblsymboltypename.c \
  586. ebldynamictagname.c eblsectionname.c \
  587. @@ -56,9 +56,4 @@ libebl_a_SOURCES = eblopenbackend.c eblc
  588. eblresolvesym.c eblcheckreloctargettype.c \
  589. ebl_data_marker_symbol.c
  590. -libebl_pic_a_SOURCES =
  591. -am_libebl_pic_a_OBJECTS = $(libebl_a_SOURCES:.c=.os)
  592. -
  593. noinst_HEADERS = libebl.h libeblP.h ebl-hooks.h
  594. -
  595. -MOSTLYCLEANFILES = $(am_libebl_pic_a_OBJECTS)
  596. --- a/debuginfod/Makefile.am
  597. +++ b/debuginfod/Makefile.am
  598. @@ -40,23 +40,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/.
  599. program_prefix=
  600. program_transform_name = s,x,x,
  601. -if BUILD_STATIC
  602. -libasm = ../libasm/libasm.a
  603. -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
  604. -libelf = ../libelf/libelf.a -lz
  605. -if DUMMY_LIBDEBUGINFOD
  606. -libdebuginfod = ./libdebuginfod.a
  607. -else
  608. -libdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS)
  609. -endif
  610. -else
  611. -libasm = ../libasm/libasm.so
  612. -libdw = ../libdw/libdw.so
  613. -libelf = ../libelf/libelf.so
  614. -libdebuginfod = ./libdebuginfod.so
  615. -endif
  616. -libebl = ../libebl/libebl.a
  617. -libeu = ../lib/libeu.a
  618. +libasm = ../libasm/libasm.la
  619. +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
  620. +libelf = ../libelf/libelf.la
  621. +libdebuginfod = ./libdebuginfod.la
  622. +libebl = ../libebl/libebl.la
  623. +libeu = ../lib/libeu.la
  624. AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:.
  625. @@ -76,14 +65,10 @@ debuginfod_find_SOURCES = debuginfod-fin
  626. debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
  627. if LIBDEBUGINFOD
  628. -noinst_LIBRARIES = libdebuginfod.a
  629. -noinst_LIBRARIES += libdebuginfod_pic.a
  630. +libdebuginfod_la_SOURCES = debuginfod-client.c
  631. +noinst_LTLIBRARIES = libdebuginfod.la
  632. endif
  633. -libdebuginfod_a_SOURCES = debuginfod-client.c
  634. -libdebuginfod_pic_a_SOURCES = debuginfod-client.c
  635. -am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os)
  636. -
  637. if DUMMY_LIBDEBUGINFOD
  638. AM_CPPFLAGS += -Wno-unused-parameter
  639. endif
  640. @@ -92,42 +77,7 @@ if LIBDEBUGINFOD
  641. pkginclude_HEADERS = debuginfod.h
  642. endif
  643. -if LIBDEBUGINFOD
  644. -libdebuginfod_so_LIBS = libdebuginfod_pic.a
  645. -if DUMMY_LIBDEBUGINFOD
  646. -libdebuginfod_so_LDLIBS =
  647. -else
  648. -libdebuginfod_so_LDLIBS = -lpthread $(libcurl_LIBS) $(fts_LIBS) $(libelf)
  649. -endif
  650. -$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
  651. - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
  652. - -Wl,--soname,$(LIBDEBUGINFOD_SONAME) \
  653. - -Wl,--version-script,$< \
  654. - $(NO_UNDEFINED) \
  655. - -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
  656. - $(libdebuginfod_so_LDLIBS)
  657. - @$(textrel_check)
  658. -
  659. -libdebuginfod.so: $(LIBDEBUGINFOD_SONAME)
  660. - ln -fs $< $@
  661. -
  662. -install: install-am libdebuginfod.so
  663. - $(mkinstalldirs) $(DESTDIR)$(libdir)
  664. - $(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \
  665. - $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
  666. - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
  667. - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so
  668. -
  669. -uninstall: uninstall-am
  670. - rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
  671. - rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
  672. - rm -f $(DESTDIR)$(libdir)/libdebuginfod.so
  673. - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
  674. -endif
  675. -
  676. EXTRA_DIST = libdebuginfod.map
  677. -MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME)
  678. -CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so
  679. # automake std-options override: arrange to pass LD_LIBRARY_PATH
  680. installcheck-binPROGRAMS: $(bin_PROGRAMS)
  681. --- a/lib/Makefile.am
  682. +++ b/lib/Makefile.am
  683. @@ -31,9 +31,9 @@ include $(top_srcdir)/config/eu.am
  684. AM_CFLAGS += $(fpic_CFLAGS)
  685. AM_CPPFLAGS += -I$(srcdir)/../libelf
  686. -noinst_LIBRARIES = libeu.a
  687. +noinst_LTLIBRARIES = libeu.la
  688. -libeu_a_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \
  689. +libeu_la_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \
  690. crc32.c crc32_file.c \
  691. color.c error.c printversion.c
  692. --- a/src/Makefile.am
  693. +++ b/src/Makefile.am
  694. @@ -29,9 +29,9 @@ bin_PROGRAMS = readelf nm size strip elf
  695. elfcmp objdump ranlib strings ar unstrip stack elfcompress \
  696. elfclassify
  697. -noinst_LIBRARIES = libar.a
  698. +noinst_LTLIBRARIES = libar.la
  699. -libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c
  700. +libar_la_SOURCES = arlib.c arlib2.c arlib-argp.c
  701. EXTRA_DIST = arlib.h debugpred.h
  702. @@ -39,17 +39,11 @@ bin_SCRIPTS = make-debug-archive
  703. EXTRA_DIST += make-debug-archive.in
  704. CLEANFILES += make-debug-archive
  705. -if BUILD_STATIC
  706. -libasm = ../libasm/libasm.a
  707. -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
  708. -libelf = ../libelf/libelf.a -lz
  709. -else
  710. -libasm = ../libasm/libasm.so
  711. -libdw = ../libdw/libdw.so
  712. -libelf = ../libelf/libelf.so
  713. -endif
  714. -libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
  715. -libeu = ../lib/libeu.a
  716. +libasm = ../libasm/libasm.la
  717. +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) -ldl -lpthread
  718. +libelf = ../libelf/libelf.la
  719. +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la
  720. +libeu = ../lib/libeu.la
  721. if DEMANGLE
  722. demanglelib = -lstdc++
  723. @@ -77,9 +71,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $
  724. addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
  725. elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
  726. objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
  727. -ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
  728. +ranlib_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
  729. strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
  730. -ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
  731. +ar_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
  732. unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
  733. stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
  734. elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
  735. --- a/tests/Makefile.am
  736. +++ b/tests/Makefile.am
  737. @@ -662,17 +662,11 @@ installcheck-local:
  738. TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \
  739. LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS
  740. -if BUILD_STATIC
  741. -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
  742. -libelf = ../libelf/libelf.a -lz
  743. -libasm = ../libasm/libasm.a
  744. -else
  745. -libdw = ../libdw/libdw.so
  746. -libelf = ../libelf/libelf.so
  747. -libasm = ../libasm/libasm.so
  748. -endif
  749. -libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
  750. -libeu = ../lib/libeu.a
  751. +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
  752. +libelf = ../libelf/libelf.la
  753. +libasm = ../libasm/libasm.la
  754. +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la
  755. +libeu = ../lib/libeu.la
  756. arextract_LDADD = $(libelf)
  757. arsymtest_LDADD = $(libelf)
  758. --- a/libcpu/Makefile.am
  759. +++ b/libcpu/Makefile.am
  760. @@ -38,19 +38,16 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAG
  761. LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
  762. AM_YFLAGS = -p$(<F:parse.y=)
  763. -noinst_LIBRARIES = libcpu.a libcpu_pic.a
  764. +noinst_LTLIBRARIES = libcpu.la
  765. noinst_HEADERS = i386_dis.h i386_mne.h x86_64_dis.h
  766. -libcpu_a_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c riscv_disasm.c
  767. -
  768. -libcpu_pic_a_SOURCES =
  769. -am_libcpu_pic_a_OBJECTS = $(libcpu_a_SOURCES:.c=.os)
  770. +libcpu_la_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c riscv_disasm.c
  771. i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
  772. -i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
  773. -x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
  774. +$(libcpu_la_OBJECTS): i386.mnemonics $(srcdir)/i386_dis.h
  775. +$(libcpu_la_OBJECTS): x86_64.mnemonics $(srcdir)/x86_64_dis.h
  776. %_defs: $(srcdir)/defs/i386
  777. $(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
  778. @@ -87,20 +84,15 @@ endif
  779. i386_lex_no_Werror = yes
  780. -libeu = ../lib/libeu.a
  781. +libeu = ../lib/libeu.la
  782. i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \
  783. -Wno-implicit-fallthrough
  784. -i386_parse.o: i386_parse.c i386.mnemonics
  785. -i386_lex.o: i386_parse.h
  786. i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS)
  787. -i386_parse.h: i386_parse.c ;
  788. -
  789. bpf_disasm_CFLAGS = -Wno-format-nonliteral
  790. EXTRA_DIST = defs/i386
  791. -MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS)
  792. CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
  793. MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)
  794. --- a/config/libelf.pc.in
  795. +++ b/config/libelf.pc.in
  796. @@ -8,7 +8,7 @@ Description: elfutils libelf library to
  797. Version: @VERSION@
  798. URL: http://elfutils.org/
  799. -Libs: -L${libdir} -lelf
  800. +Libs: -L${libdir} -lelf -lz
  801. Cflags: -I${includedir}
  802. Requires.private: zlib @LIBZSTD@