From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50803 invoked by alias); 6 Jul 2019 00:35:18 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 50687 invoked by uid 89); 6 Jul 2019 00:35:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=sk:maintai X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mail-pg1-f193.google.com Received: from mail-pg1-f193.google.com (HELO mail-pg1-f193.google.com) (209.85.215.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 06 Jul 2019 00:35:16 +0000 Received: by mail-pg1-f193.google.com with SMTP id p10so4937954pgn.1 for ; Fri, 05 Jul 2019 17:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4QI2MJlP7jgK5qFZHaKanzZMfHl290Mgv+MmC6HcOCc=; b=xtBbA2cqnyj9WRUmSdhQV3K3z8PvHUn+TmF+apbkzwtguk2W3z2Xbkryu33DqMAkJt eb9TStbqv+sL+IO9GnMmkbHJY3MUp2GZss3Hf+c2SqGWH4HCAYVRZ8BT35P6mxaG9qLv y8nqql0Qu6yzl1HYkrOzNupvuWHYi85UULDfjWlYN4P16dh819A7DxiUyJvLJdgE/hzp yIP6gcWXmMbFkWBkx0sFdPJmU0etpHOvgcyQ+anwKrR69zR+B1rwxEg1tNJ3IWg+wcxH MgxvRz2UBsbswn8eHdLD24wkWKvsg0sdhb+8atpz18UkWnPbdapJDXQDvIqXzlpwV0Qg wUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4QI2MJlP7jgK5qFZHaKanzZMfHl290Mgv+MmC6HcOCc=; b=ujG13WGtn9zxv4qERb79Ou0b+urBFablI+J4hF5ZkQIMNQ7P40NjlyMZmljYWnrjFo kmYNxKeARsmUKxqlJq5/4QkzMCoNg2rZ1USN90F43DsmBJV/Bvc5L0riURUSHu+wwAlU K2rGCjOHsSw3VFrTgiqtMESrP4XcMOM0VLAuoWrHGTTfFBSSn8D8SMBctffDw4zXOvtl nUYOcsKiyZmht9yzK9iD13rFTuRbsdzeMgV2uQNKzcC4uFO7cRmb9OJUIZxDskFgEZ9W NxGyD/elWcdHwIl7x4QlPwGxLmPTkZtHs02o/3DNrZTyJpfdZzCOq5car6f/nvqVljqZ hncA== X-Gm-Message-State: APjAAAVZIYugn5x4g6F+O7gpMv4qfunCKLE7H2aReesrgaDLid22G+fW LvsrfFrsrXz8uXecg7KmyvkEw80Ju7A= X-Google-Smtp-Source: APXvYqxjaP5ySkPbLANNc6oPZDpawjKxuqt4TYwDOO+D6rm/acpUvzufQH/cSS5JIUkorYsDXlIv9A== X-Received: by 2002:a63:62c5:: with SMTP id w188mr8079523pgb.129.1562373314280; Fri, 05 Jul 2019 17:35:14 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:33cc]) by smtp.gmail.com with ESMTPSA id v10sm10787640pfe.163.2019.07.05.17.35.13 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 17:35:13 -0700 (PDT) From: Omar Sandoval To: elfutils-devel@sourceware.org Subject: [PATCH 3/5] Add PIC and non-PIC variants of libcpu and libebl Date: Sat, 06 Jul 2019 00:35:00 -0000 Message-Id: <0df77b9f6b5ad217f0ad70ef7ac3f113e78d2adf.1562372641.git.osandov@fb.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-q3/txt/msg00021.txt.bz2 From: Omar Sandoval 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 --- backends/ChangeLog | 1 + backends/Makefile.am | 2 +- libcpu/ChangeLog | 2 ++ libcpu/Makefile.am | 18 +++++++++++++----- libdw/ChangeLog | 4 ++++ libdw/Makefile.am | 2 +- libebl/ChangeLog | 4 +++- libebl/Makefile.am | 8 +++++++- 8 files changed, 32 insertions(+), 9 deletions(-) diff --git a/backends/ChangeLog b/backends/ChangeLog index 219e0702..d631417f 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,6 +1,7 @@ 2019-07-05 Omar Sandoval * Makefile.am: Replace libcpu_{i386,x86_64,bpf}.a with libcpu.a. + Replace libcpu.a with libcpu_pic.a. 2019-04-14 Mark Wielaard diff --git a/backends/Makefile.am b/backends/Makefile.am index 0307da07..d1275206 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -43,7 +43,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 diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index c0ea72ec..883896a2 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLog @@ -1,6 +1,8 @@ 2019-07-05 Omar Sandoval * 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 diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am index a7d9f6fd..88717361 100644 --- a/libcpu/Makefile.am +++ b/libcpu/Makefile.am @@ -30,15 +30,22 @@ 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$( + + * Makefile.am (libdw_so_LIBS): Replace libebl.a with libebl_pic.a. + 2019-05-16 Mark Wielaard * dwarf.h: Add DW_AT_GNU_numerator, DW_AT_GNU_denominator and diff --git a/libdw/Makefile.am b/libdw/Makefile.am index 7a3d5322..7dc4cec0 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -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 = diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 9510f9d5..6fd83471 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,6 +1,8 @@ 2019-07-05 Omar Sandoval - * Makefile.am (gen_SOURCES): Remove. + * Makefile.am: Make libebl.a non-PIC by default. + Add libebl_pic.a. + (gen_SOURCES): Remove. 2019-05-30 Mark Wielaard diff --git a/libebl/Makefile.am b/libebl/Makefile.am index ccc1a31a..b85ead01 100644 --- a/libebl/Makefile.am +++ b/libebl/Makefile.am @@ -28,12 +28,15 @@ ## not, see . ## 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) -- 2.22.0