From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 922E2C4338F for ; Sat, 14 Aug 2021 11:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67B2860ED5 for ; Sat, 14 Aug 2021 11:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238350AbhHNMAP (ORCPT ); Sat, 14 Aug 2021 08:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238064AbhHNMAO (ORCPT ); Sat, 14 Aug 2021 08:00:14 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A384C061764 for ; Sat, 14 Aug 2021 04:59:46 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4GmzW15xPNz9sWS; Sat, 14 Aug 2021 21:59:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1628942382; bh=g2G5hFPZF1lKhi3yGSAgG83UWIDupBfi4QPY+qfq8Ks=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FQidGTPhoSPHk+7MUkS1XOt7q1mfSsaWmyfom77eiQuSbVMsn6TqP69Id9NYkwwPW nduK249GoXidT8AYETQWmqCbcQKJvMyKrTQl6GskubYpekRwOjZlkmBRhkUFEL1Mi2 8qWUtBPx3WI6SO9WgTdID53BPzo316jWb0bQxuU3E5Isb52IVpStcBWm4h824hT8Fu LGhm34VNFBBWLNyp+gztGESFnSBB3zjGoSpvQrcUC88bm8v9dLbP+At5kBbq/22icG mQ2J1rt2Y6nXJVwwsceAGkjwc2qBogmj9TeLU1XDSTp501O9L95w6rjZSEZkYYJR1z Isf1s9ZkWN7yg== From: Michael Ellerman To: Bill Wendling , Daniel Axtens , Fangrui Song Cc: Benjamin Herrenschmidt , Paul Mackerras , Nathan Chancellor , Nick Desaulniers , linuxppc-dev@lists.ozlabs.org, LKML , clang-built-linux Subject: Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic In-Reply-To: References: <20210812204951.1551782-1-morbo@google.com> <87sfzde8lk.fsf@linkitivity.dja.id.au> Date: Sat, 14 Aug 2021 21:59:40 +1000 Message-ID: <87a6lkme37.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bill Wendling writes: > On Fri, Aug 13, 2021 at 7:13 AM Daniel Axtens wrote: >> Bill Wendling writes: ... >> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile >> > index 6505d66f1193..17a9fbf9b789 100644 >> > --- a/arch/powerpc/Makefile >> > +++ b/arch/powerpc/Makefile >> > @@ -122,6 +122,7 @@ endif >> > >> > LDFLAGS_vmlinux-y := -Bstatic >> > LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie >> > +LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) += -z notext ... > > Unrelated question: Should the "-pie" flag be added with "+= -pie" > (note the plus sign)? I noticed that too. It's been like that since the original relocatable support was added in 2008, commit 549e8152de80 ("powerpc: Make the 64-bit kernel as a position-independent executable"), which did: -LDFLAGS_vmlinux := -Bstatic +LDFLAGS_vmlinux-yy := -Bstatic +LDFLAGS_vmlinux-$(CONFIG_PPC64)$(CONFIG_RELOCATABLE) := -pie +LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-yy) There's no mention of those flags in the change log. But the way it's written suggests the intention was to not pass -Bstatic for relocatable builds, otherwise it could have been more simply: +LDFLAGS_vmlinux-$(CONFIG_PPC64)$(CONFIG_RELOCATABLE) := -pie +LDFLAGS_vmlinux := -Bstatic $(LDFLAGS_vmlinux-yy) So I think it was deliberate to not use +=, but whether that's actually correct I can't say. Maybe in the past -Bstatic and -pie were incompatible? cheers