From patchwork Tue Jul 18 10:40:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 790119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBcC31B9dz9t2M for ; Tue, 18 Jul 2017 20:41:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eVVD+YMn"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xBcC300FKzDrFs for ; Tue, 18 Jul 2017 20:41:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eVVD+YMn"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xBcBM4lySzDrFV for ; Tue, 18 Jul 2017 20:40:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eVVD+YMn"; dkim-atps=neutral Received: by mail-pf0-x243.google.com with SMTP id e199so2243149pfh.0 for ; Tue, 18 Jul 2017 03:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2WJpg3f8o0Zcc88vRTd6md3+IWGVYfaY9Geor/7Mmx0=; b=eVVD+YMnq926446ghGdAXq7MqFS1aZh/fsagauSNFFzL2p7YxiRrM1V7OCleWIPGVF wJAO2c7R7nx50mycs3+DSwFmei9rlS+0VTCQ0fawxrhfBw93oIjHfjD1VOJH5IMS5WJ+ If/U1PKD+HDLPUYkHaazPKF1+SbojMwLj/nLo89ftHTyj5dT/iV2W4yj3o5E5E5BboRR pHUDIgouMr6kogiNqFBEuR9t/uRM0wsLTYrJMNFPZMqmaEZT9aHS2e3qKiH7iXsOJsn0 yUOOaRxGHboYXIQUiDAgtW2cCgD0T3ojBErrqbLioJNDLUSWrvgnatKIAcnKlgBYJ3qL hQvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2WJpg3f8o0Zcc88vRTd6md3+IWGVYfaY9Geor/7Mmx0=; b=JhJT+dPIWAX5xBoM3pLyHuPMJqXqeCeM2LV07xgID/McSXIQ7HS7OAMAzxTQvTyZUv EhbyAPY0JRU7g9cWdOgVnFjgMiMpPvJlS5gUmOxu+8bEEKD01Iq0jS9FMdvq/42nRtE1 yV9vQdG3JyK1+z6dH86sXt1DIpxfopC7aadZdQQmTx3mKzVFFqXSWQWCkeu15rq6oJNM sCLekdm7+4sBnSkGZ2A1evWMzxDbY8yF4Ia9wvz5tI60lpJgiwO0DgFdT9I6kwfKCix0 lAyVjNVj3p4Zl+9RtBTv39k6ViTq/A7BK9gdBfYf/0Wo5kWDQfSED1B3vQTTTCimCZqA C3QA== X-Gm-Message-State: AIVw110zg4zUHIjDiDbR+D3+z5v54xqx3fM+V+1HbEneYAHcJos12MXw lelpxXuyjPjouJTl X-Received: by 10.84.232.13 with SMTP id h13mr1032225plk.168.1500374425729; Tue, 18 Jul 2017 03:40:25 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id m5sm4096982pfg.22.2017.07.18.03.40.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 03:40:24 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Tue, 18 Jul 2017 20:40:06 +1000 Message-Id: <20170718104008.9624-2-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170718104008.9624-1-npiggin@gmail.com> References: <20170718104008.9624-1-npiggin@gmail.com> Subject: [Skiboot] [RFC PATCH 1/3] build: LDFLAGS pass -pie flag explicitly to ld X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" When building with some toolchains, the gcc -pie option does not enable the linker pie without explicitly passing it to ld, resulting in a non-PIE binary that silently fails (due to relocation failure). This was observed with the powerpc64le cross compiler for Debian. Pass -Wl,-pie explicitly, which allows the powerpc64le toolchain to create a position independnet binary that boots. Signed-off-by: Nicholas Piggin --- Makefile.main | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.main b/Makefile.main index 438dcb27..c421cbc6 100644 --- a/Makefile.main +++ b/Makefile.main @@ -106,6 +106,7 @@ CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \ CFLAGS += $(CWARNS) $(OPTS) $(DBG) LDFLAGS := -m64 -static -nostdlib -pie +LDFLAGS += -Wl,-pie LDFLAGS += -Wl,-Ttext-segment,$(LD_TEXT) -Wl,-N -Wl,--build-id=none LDFLAGS += -Wl,--no-multi-toc LDFLAGS += -mbig-endian -Wl,--oformat,elf64-powerpc