From patchwork Wed May 16 14:14:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 914659 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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 40mGrn5M1bz9s3B for ; Thu, 17 May 2018 00:23:53 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CzErw6HO"; 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 40mGrm6gcDzDsQ6 for ; Thu, 17 May 2018 00:23:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="CzErw6HO"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CzErw6HO"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::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 40mGft6CYNzF14v for ; Thu, 17 May 2018 00:15:18 +1000 (AEST) Received: by mail-pl0-x243.google.com with SMTP id t12-v6so506546plo.7 for ; Wed, 16 May 2018 07:15:18 -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=YSwvxCxV9zP5V8oBGnYbbEnrr2b/Qjc4ApvIbDwdDSs=; b=CzErw6HOycwEsFUNKbLJ1BMaG6gYHpJSI/S0ypNGp1f6UdgWUAjPM+x3i2tFrSx1PI Xz4hId3FnoaPLaE1VSdRowJHK4qQWNT3FuRgzcv1h9klG5ZXMvafoMntMHLLEazN3Uc8 95JNDF/nk777IyXfiOi8OrKuebovliPsrX60AZ8Ee+byIP+dBRChSSxffjpY/4J28ZJi H6TEQbhNuP1WriK+JuDVpGC0qO+x+nag/ixAIzgbJbAkd/wxRQ4yNcMtYBIJlFR3LxvI N/2FbKthrEGrQ1IA3DpJXBOAtx0r+29jEpx8jqchUMEPrNAcoH0fIlB1iBYpQBzLFmBC aGRg== 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=YSwvxCxV9zP5V8oBGnYbbEnrr2b/Qjc4ApvIbDwdDSs=; b=lmpysjbl8aLgjrno3JIgUc0CeDmBDe6QnfJv/10rEyOhS6fbgSjAZjQkqTuzx8Oefr lRw7f/9gELqbKG8aVP/zB4CJc22/PTAEF89+teirG1kW7Vc8DBgWsFEehz4efRaeDVs4 QuKo8rd0ZHW56fpvEXtzbwtqekhsfGAvFrQ4p13bCaeNd8DPY03oDgQkKzM9VVt6A96u aDCrOFQMHVdzWYU82+XD4BhJDoF7Ah0f+ArseauCAvAHaCIDAbYFGOWWGmWsa/3qhLSJ JRotEZ9k9UEY885OTe6YtKO7jBuzLKnZm60MVahsTTP3ndNdiX2sEXPVkHJucs3s1AGk Ji7g== X-Gm-Message-State: ALKqPwefwFUWguZCHC6+Iz5oJZhk9/ZiCajv9eQrkaUdxegc8wyUtuQD yntO5YDSgQLx3Y7i7Y2vELM= X-Google-Smtp-Source: AB8JxZpr3tTi2pbcHYj1jfr7/9Rfg4T2/L0iWBxmkio/OHHDpEHscvIxgK/2cvIV0zhurGPzLWdrLA== X-Received: by 2002:a17:902:268:: with SMTP id 95-v6mr1157225plc.386.1526480116961; Wed, 16 May 2018 07:15:16 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id h130-v6sm7365162pfc.98.2018.05.16.07.15.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 07:15:16 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org Subject: [PATCH v4 2/4] powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile Date: Thu, 17 May 2018 00:14:56 +1000 Message-Id: <20180516141458.18996-3-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516141458.18996-1-npiggin@gmail.com> References: <20180516141458.18996-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , linuxppc-dev@lists.ozlabs.org, Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Switch VDSO32 build over to use CROSS32_COMPILE directly, and have it pass in -m32 after the standard c_flags. This allows endianness overrides to be removed and the endian and bitness flags moved into standard flags variables. Signed-off-by: Nicholas Piggin --- arch/powerpc/Makefile | 10 ---------- arch/powerpc/boot/Makefile | 16 +++++++++++----- arch/powerpc/kernel/vdso32/Makefile | 15 +++++++++++---- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 15ca4bafad82..167b26a0780c 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -17,14 +17,8 @@ HAS_BIARCH := $(call cc-option-yn, -m32) # Set default 32 bits cross compilers for vdso and boot wrapper CROSS32_COMPILE ?= -CROSS32CC := $(CROSS32_COMPILE)gcc -CROSS32AR := $(CROSS32_COMPILE)ar - ifeq ($(HAS_BIARCH),y) ifeq ($(CROSS32_COMPILE),) -CROSS32CC := $(CC) -m32 -KBUILD_ARFLAGS += --target=elf32-powerpc - ifdef CONFIG_PPC32 # These options will be overridden by any -mcpu option that the CPU # or platform code sets later on the command line, but they are needed @@ -33,13 +27,9 @@ ifdef CONFIG_PPC32 KBUILD_CFLAGS += -mcpu=powerpc KBUILD_AFLAGS += -mcpu=powerpc endif - endif endif - -export CROSS32CC CROSS32AR - ifeq ($(CROSS_COMPILE),) KBUILD_DEFCONFIG := $(shell uname -m)_defconfig else diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 26d5d2a5b8e9..49767e06202c 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -23,19 +23,23 @@ all: $(obj)/zImage compress-$(CONFIG_KERNEL_GZIP) := CONFIG_KERNEL_GZIP compress-$(CONFIG_KERNEL_XZ) := CONFIG_KERNEL_XZ +ifdef CROSS32_COMPILE + BOOTCC := $(CROSS32_COMPILE)gcc + BOOTAR := $(CROSS32_COMPILE)ar +else + BOOTCC := $(CC) + BOOTAR := $(AR) +endif + BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -Os -msoft-float -pipe \ -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ -D$(compress-y) -BOOTCC := $(CC) ifdef CONFIG_PPC64_BOOT_WRAPPER BOOTCFLAGS += -m64 else BOOTCFLAGS += -m32 -ifdef CROSS32_COMPILE - BOOTCC := $(CROSS32_COMPILE)gcc -endif endif BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) @@ -49,6 +53,8 @@ endif BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc +BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) + ifdef CONFIG_DEBUG_INFO BOOTCFLAGS += -g endif @@ -202,7 +208,7 @@ quiet_cmd_bootas = BOOTAS $@ cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< quiet_cmd_bootar = BOOTAR $@ - cmd_bootar = $(CROSS32AR) -cr$(KBUILD_ARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@ + cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@ $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE $(call if_changed_dep,bootcc) diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile index b8c434d1d459..50112d4473bb 100644 --- a/arch/powerpc/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile @@ -8,8 +8,15 @@ obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \ # Build rules -ifeq ($(CONFIG_PPC32),y) -CROSS32CC := $(CC) +ifdef CROSS32_COMPILE + VDSOCC := $(CROSS32_COMPILE)gcc +else + VDSOCC := $(CC) +endif + +CC32FLAGS := +ifdef CONFIG_PPC64 +CC32FLAGS += -m32 endif targets := $(obj-vdso32) vdso32.so vdso32.so.dbg @@ -45,9 +52,9 @@ $(obj-vdso32): %.o: %.S FORCE # actual build commands quiet_cmd_vdso32ld = VDSO32L $@ - cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) + cmd_vdso32ld = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) quiet_cmd_vdso32as = VDSO32A $@ - cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $< + cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $< # install commands for the unstripped file quiet_cmd_vdso_install = INSTALL $@