Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97694C7619A for ; Wed, 5 Apr 2023 23:50:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CFF2185FEE; Thu, 6 Apr 2023 01:49:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Y/FqC5Zh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4523C85FC2; Thu, 6 Apr 2023 01:49:15 +0200 (CEST) Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A8BC285FD4 for ; Thu, 6 Apr 2023 01:49:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yb1-xb2a.google.com with SMTP id d3so16644324ybu.1 for ; Wed, 05 Apr 2023 16:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1680738548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QQF/BDuyPH+/HONb5rwc62S3Ggl1EZVpq9i8Auc57P0=; b=Y/FqC5ZhJloQsC4G8pr3obYeT7AOH5h65WBuFRQl9N8l8ozUymZgdoos3RICLhbQC4 bjIyH1QDkuSQk6K3KI858xSMPdJMOYqs1xbynmRh9K//WIhOuGxxxuZLMXaBymQK73Bb qj4meHPyRn2f+AsnO00Isvk8gUSUFRVR291es= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680738548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QQF/BDuyPH+/HONb5rwc62S3Ggl1EZVpq9i8Auc57P0=; b=zBEcM4aZkScqssqEB+18g+4EB2JIRI7p+kWMVDxr4dKHoa6xzQehTBo78kkQi1QqhV KUPLhKU1aYqa1C/+IA9I+0Z/z23zrMCuN5VI+ejD6MM+iB3Qt4iStmHq1ZjuKBAaQWo0 hYwAruLJIBH7mjjF3twdyCFCNHqRwDmCSwO/ySuOeaqcqw6rYzITVYUzVLIAOm6VuFUB FyhlXO+n8avEF+7ZFTW6pG7T1Dn9F1Dh3i/9NSUYwZ6XF/4VsjVOBjRXhAVy5zjOjk2M tESyRR5ReqCogx7o9nL21k1Uy85O+mPuBwmSrQRkj/jt6CNADk0rxGFIEQAyRUcCyX4e NsFA== X-Gm-Message-State: AAQBX9ehBUBPsURnFYQJ3f+65nsBNhsEZkylMipqT1B8d94VG78RmO6/ NZsBfiIFWuhnx18wzMTSq8d6Bn0mevo0BCtDcxKkLQ== X-Google-Smtp-Source: AKy350a4hu0epsCvKLNS/XyzUwK33EEoGM49W/KzNyTTIjN1oy5XHmDLyUi45rXylPIwBrdINexpbQ== X-Received: by 2002:a25:25cc:0:b0:b15:a0f8:8a7f with SMTP id l195-20020a2525cc000000b00b15a0f88a7fmr762698ybl.45.1680738548166; Wed, 05 Apr 2023 16:49:08 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-acff-1005-f218-7c24.res6.spectrum.com. [2603:6081:7b00:6400:acff:1005:f218:7c24]) by smtp.gmail.com with ESMTPSA id l33-20020a81ad61000000b00545a08184b1sm4215448ywk.65.2023.04.05.16.49.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 16:49:07 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 4/9] arm: Centralize fixed register logic Date: Wed, 5 Apr 2023 19:48:54 -0400 Message-Id: <20230405234859.1446811-5-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230405234859.1446811-1-trini@konsulko.com> References: <20230405234859.1446811-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When building for ARM64, we need to pass -ffixed-x18 and otherwise pass -ffixed-r9. Rather than having this logic in two places, we can do this once in arch/arm/config.mk. Further, while gcc will ignore being passed both -ffixed-r9 and -ffixed-x18 and simply use -ffixed-x18, clang will note that -ffixed-r9 is not used. Remove this duplication to also remove the warning. Signed-off-by: Tom Rini --- arch/arm/config.mk | 10 ++++++++-- arch/arm/cpu/armv8/config.mk | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index bf781f102620..5530d02b66c4 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -3,7 +3,13 @@ # (C) Copyright 2000-2002 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. -CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections \ +ifeq ($(CONFIG_ARM64),y) +FIXED_REG := -ffixed-x18 +else +FIXED_REG := -ffixed-r9 +endif + +CFLAGS_NON_EFI := -fno-pic $(FIXED_REG) -ffunction-sections -fdata-sections \ -fstack-protector-strong CFLAGS_EFI := -fpic -fshort-wchar @@ -15,7 +21,7 @@ ifneq ($(LTO_ENABLE),y) PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections endif -PLATFORM_RELFLAGS += -fno-common -ffixed-r9 +PLATFORM_RELFLAGS += -fno-common $(FIXED_REG) PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \ $(call cc-option,-mgeneral-regs-only) \ $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) diff --git a/arch/arm/cpu/armv8/config.mk b/arch/arm/cpu/armv8/config.mk index ca06ed3d4f92..4d74b2a533e0 100644 --- a/arch/arm/cpu/armv8/config.mk +++ b/arch/arm/cpu/armv8/config.mk @@ -2,7 +2,6 @@ # # (C) Copyright 2002 # Gary Jennejohn, DENX Software Engineering, -PLATFORM_RELFLAGS += -fno-common -ffixed-x18 PLATFORM_RELFLAGS += $(call cc-option,-mbranch-protection=none) PF_NO_UNALIGNED := $(call cc-option, -mstrict-align) -- 2.34.1