From patchwork Sun Dec 12 00:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 48839 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 38BC2385780F for ; Sun, 12 Dec 2021 00:12:26 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id 7AD61385780F for ; Sun, 12 Dec 2021 00:11:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AD61385780F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 796A63C1; Sun, 12 Dec 2021 01:11:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sI458uhtreHr; Sun, 12 Dec 2021 01:11:54 +0100 (CET) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E94B41B8; Sun, 12 Dec 2021 01:11:54 +0100 (CET) Received: from samy by begin with local (Exim 4.95) (envelope-from ) id 1mwCT4-001qpH-7k; Sun, 12 Dec 2021 01:11:54 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited] hurd: Add rules for static PIE build Date: Sun, 12 Dec 2021 01:11:52 +0100 Message-Id: <20211212001152.441384-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Spamd-Bar: ++++ X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Queue-Id: 796A63C1 X-Spamd-Result: default: False [4.90 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[] X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This fixes [BZ #28671]. --- csu/Makefile | 17 ++++++++++++----- sysdeps/mach/hurd/Makefile | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/csu/Makefile b/csu/Makefile index e2390e4a7d..b52a98ffda 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -71,17 +71,21 @@ else extra-objs += gmon-start.o endif +ifeq (yes,$(enable-static-pie)) +extra-objs += r$(start-installed-name) gr$(start-installed-name) +install-lib += r$(start-installed-name) gr$(start-installed-name) +endif + ifneq ($(start-installed-name),$(static-start-installed-name)) -# FIXME: Only Hurd defines static-start-installed-name. Hurd needs to -# provide special rules to support static PIE. extra-objs += $(static-start-installed-name) g$(static-start-installed-name) omit-deps += $(patsubst %.o,%,$(static-start-installed-name) \ g$(static-start-installed-name)) install-lib += $(static-start-installed-name) g$(static-start-installed-name) -else ifeq (yes,$(enable-static-pie)) -extra-objs += r$(start-installed-name) gr$(start-installed-name) -install-lib += r$(start-installed-name) gr$(start-installed-name) +extra-objs += r$(static-start-installed-name) gr$(static-start-installed-name) +omit-deps += $(patsubst %.o,%,r$(static-start-installed-name) \ + gr$(static-start-installed-name)) +install-lib += r$(static-start-installed-name) gr$(static-start-installed-name) endif endif @@ -150,6 +154,9 @@ ifneq ($(start-installed-name),$(static-start-installed-name)) $(objpfx)g$(static-start-installed-name): \ $(objpfx)g%: $(objpfx)% $(objpfx)gmon-start.o $(link-relocatable) +$(objpfx)gr$(static-start-installed-name): \ + $(objpfx)gr%: $(objpfx)r% $(objpfx)gmon-start.o + $(link-relocatable) endif else $(addprefix $(objpfx),$(sort g$(start-installed-name) \ diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile index 393e92210b..6a6a25ca1f 100644 --- a/sysdeps/mach/hurd/Makefile +++ b/sysdeps/mach/hurd/Makefile @@ -188,6 +188,8 @@ extra-objs += static-start.o # We need special startup code for statically linked binaries. $(objpfx)crt0.o: $(objpfx)static-start.o $(objpfx)abi-note.o $(objpfx)init.o $(objpfx)static-reloc.o $(link-relocatable) +$(objpfx)rcrt0.o: $(objpfx)static-start.o $(objpfx)abi-note.o $(objpfx)init.o + $(link-relocatable) endif