]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add PIC and non-PIC variants of libcpu and libebl
authorOmar Sandoval <osandov@fb.com>
Mon, 26 Aug 2019 17:51:45 +0000 (10:51 -0700)
committerMark Wielaard <mark@klomp.org>
Wed, 28 Aug 2019 19:45:26 +0000 (21:45 +0200)
Currently, libcpu and libebl are always compiled as PIC. An upcoming
change will add the objects from libcpu.a and libebl.a to libdw.a, which
should not be PIC unless configured that way. So, make libcpu.a and
libebl.a non-PIC and add libcpu_pic.a and libebl_pic.a.

Signed-off-by: Omar Sandoval <osandov@fb.com>
backends/ChangeLog
backends/Makefile.am
libcpu/ChangeLog
libcpu/Makefile.am
libdw/ChangeLog
libdw/Makefile.am
libebl/ChangeLog
libebl/Makefile.am

index 91790bb917521550fe0dcb8788e5e37cfb281f48..3faee13ea44036e8cc976fb3a03c809cbfed77bf 100644 (file)
@@ -1,6 +1,7 @@
 2019-07-05  Omar Sandoval  <osandov@fb.com>
 
        * Makefile.am: Replace libcpu_{i386,x86_64,bpf}.a with libcpu.a.
+       Replace libcpu.a with libcpu_pic.a.
 
 2019-07-13 Mao Han <han_mao@c-sky.com>
 
index 6470a31397abf3cf0d453887ada9432d5cfbe088..be470528059a53087e9cc4ce859a93998401ec71 100644 (file)
@@ -44,7 +44,7 @@ noinst_LIBRARIES = $(libebl_pic)
 noinst_DATA = $(libebl_pic:_pic.a=.so)
 
 
-libcpu = ../libcpu/libcpu.a
+libcpu = ../libcpu/libcpu_pic.a
 libelf = ../libelf/libelf.so
 libdw = ../libdw/libdw.so
 libeu = ../lib/libeu.a
index c0ea72ecaf86d300a3db1490017b78626a6dd292..883896a2ee588406a6be8ff7f0769187b6c090eb 100644 (file)
@@ -1,6 +1,8 @@
 2019-07-05  Omar Sandoval  <osandov@fb.com>
 
        * Makefile.am: Combine libcpu_{i386,x86_64,bpf}.a into libcpu.a.
+       Make libcpu.a non-PIC by default.
+       Add libcpu_pic.a.
 
 2018-11-04  Mark Wielaard  <mark@klomp.org>
 
index a7d9f6fdeaad27b5ed95f3d37012fb2245a5110c..88717361381ee751ba61f2cc92a8d8c486d93cc6 100644 (file)
 include $(top_srcdir)/config/eu.am
 AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
            -I$(srcdir)/../libdw -I$(srcdir)/../libasm
-AM_CFLAGS += $(fpic_CFLAGS) -fdollars-in-identifiers
+if BUILD_STATIC
+AM_CFLAGS += $(fpic_CFLAGS)
+endif
+AM_CFLAGS += -fdollars-in-identifiers
 LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
 AM_YFLAGS = -p$(<F:parse.y=)
 
-noinst_LIBRARIES = libcpu.a
+noinst_LIBRARIES = libcpu.a libcpu_pic.a
+
+noinst_HEADERS = i386_dis.h x86_64_dis.h
+
+libcpu_a_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c
 
-libcpu_a_SOURCES = i386_disasm.c i386_dis.h x86_64_disasm.c x86_64_dis.h \
-                  bpf_disasm.c
+libcpu_pic_a_SOURCES =
+am_libcpu_pic_a_OBJECTS = $(libcpu_a_SOURCES:.c=.os)
 
 i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
 
@@ -50,7 +57,7 @@ x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
        $(AM_V_at)mv -f $@T $@
 
 if MAINTAINER_MODE
-noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
+noinst_HEADERS += memory-access.h i386_parse.h i386_data.h
 
 noinst_PROGRAMS = i386_gendis$(EXEEXT)
 
@@ -86,5 +93,6 @@ bpf_disasm_CFLAGS = -Wno-format-nonliteral
 
 EXTRA_DIST = defs/i386
 
+MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS)
 CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
 MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)
index 1d3586f07e3fd2f6a22728ecd05959abab8eb77a..a68778e6eee2ab5a258b293cff197ded26ea63c9 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-05  Omar Sandoval  <osandov@fb.com>
+
+       * Makefile.am (libdw_so_LIBS): Replace libebl.a with libebl_pic.a.
+
 2019-08-25  Jonathon Anderson  <jma14@rice.edu>
 
        * dwarf_getcfi.c (dwarf_getcfi): Set default_same_value to false.
index 7a3d53227a483786eac04d1061c25349532fcd55..7dc4cec01715be260de70a562a6eea2cebcae55c 100644 (file)
@@ -106,7 +106,7 @@ libdw_pic_a_SOURCES =
 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
 
 libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
-         ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+         ../libdwfl/libdwfl_pic.a ../libebl/libebl_pic.a
 libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
 libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
 libdw_so_SOURCES =
index a772ffa3541250cff55d6476422d6112a05c9f4d..3a836c895636d014ec3a2f1dfdcb367f0bef93e4 100644 (file)
@@ -1,6 +1,8 @@
 2019-07-05  Omar Sandoval  <osandov@fb.com>
 
-       * Makefile.am (gen_SOURCES): Remove.
+       * Makefile.am: Make libebl.a non-PIC by default.
+       Add libebl_pic.a.
+       (gen_SOURCES): Remove.
 
 2019-04-29 Mao Han <han_mao@c-sky.com>
 
index ccc1a31acef4febea13842d928ab723ce10eb055..b85ead0142d02aa669e4252d59ee197cf8bf0b76 100644 (file)
 ## not, see <http://www.gnu.org/licenses/>.
 ##
 include $(top_srcdir)/config/eu.am
+if BUILD_STATIC
 AM_CFLAGS += $(fpic_CFLAGS)
+endif
 AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm
 VERSION = 1
 LIBEBL_SUBDIR = @LIBEBL_SUBDIR@
 
 lib_LIBRARIES = libebl.a
+noinst_LIBRARIES = libebl_pic.a
 
 pkginclude_HEADERS = libebl.h
 
@@ -57,6 +60,9 @@ libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
                   eblresolvesym.c eblcheckreloctargettype.c \
                   ebl_data_marker_symbol.c
 
+libebl_pic_a_SOURCES =
+am_libebl_pic_a_OBJECTS = $(libebl_a_SOURCES:.c=.os)
+
 noinst_HEADERS = libeblP.h ebl-hooks.h
 
-CLEANFILES += $(am_libebl_pic_a_OBJECTS)
+MOSTLYCLEANFILES = $(am_libebl_pic_a_OBJECTS)