From patchwork Mon May 13 11:22:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 164024 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1192629ili; Mon, 13 May 2019 04:25:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxihhVm0puWy9n7b3fIhUSWI44GfPJWSaLZDWFzqR1uR9iZKUgbEDXUe1uZQwFq2hiYakOI X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr28248528plp.71.1557746702719; Mon, 13 May 2019 04:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557746702; cv=none; d=google.com; s=arc-20160816; b=p3b46MBM3e/i+gVGLA5HBnXoWDl2E0bvdueVeANBwqMUwNgJktpbK4GF5tQradsoYJ uZUGYUA3O6T9dAPHRPMUD9MGV6sYI4mefqHDlcXnG12nQvKFKawoAKo6zaS8E3pcbhbo Fz14bYR9JU4oEQyKifuacUco4g25+nt2Fj8ND7emSyvjLopgINsQkvLBHWMeo+mW9Q6a RroPTua78iZs37GrzsovbEl9NP5RvUxRj0SFrgSbRkGQvmYe+s7u8QzEBB7QLWkb7NvE 7+ktBGSgK+R8jgl+zj8O2DLMnd8ulzK7YMWWo2vTByc2rkocXdHv8ry8vgLTGOEKpIAb rrdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=EU/CK6RIzPKe+JRQJjURxe4pIo5LQHgjibXAtioSisQ=; b=HrrE/lOA484q8JOUDcINZX6mwnARxG5LeSbFiMCPRP88DseX3pKdAsZ3VffYDFZSpK y3Q5dRZSnH4Tjjpkhb6dSuQnd1LHvSyGXTyjTzcsuuMaHCe8Txi1/yEb8qG9+RutiwZ+ oF7e7MByRB1/T3dEfEidc7p+miFtRii8Yj83k4hTyzrBspn/lyIH5i34YnvjEu4+AddQ tV96LJFS5ocz23XEJf1F16RH/17nV38co4UqhMiLRbvsEOPHyuqb6DWOG6exb8QoSGKr xLlIq4UGBMEzgNEcwNty1cOB0AMZwfAgeo3CWbL2pGITBWLueYsJqdpJu/aLRmufeJND bgMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nifty.com header.s=dec2015msa header.b=qSvI060C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si15266767pln.135.2019.05.13.04.25.02; Mon, 13 May 2019 04:25:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nifty.com header.s=dec2015msa header.b=qSvI060C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbfEMLZB (ORCPT + 30 others); Mon, 13 May 2019 07:25:01 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:41393 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbfEMLZA (ORCPT ); Mon, 13 May 2019 07:25:00 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x4DBMtr3032513; Mon, 13 May 2019 20:22:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x4DBMtr3032513 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1557746576; bh=EU/CK6RIzPKe+JRQJjURxe4pIo5LQHgjibXAtioSisQ=; h=From:To:Cc:Subject:Date:From; b=qSvI060CSPYmLRBCA4iRYFXdm9PWeqD3oF7SUtVayRcD6QY7sg1HjCzEmcLXYdpA/ pjAw6StN5Mki/36nrnQLctAkGlx8ZwKhEzR+E74nxnnV2FJnMuwzZxks42K/aDQnVU qIq3z/2Q5MFnAPGuqxgTCOSFPpSqdsP4X7SSL6c/TVkgCWBc5u5ou3E8TYP3rsU+RI pOIf4h2MHLJIF1cCM3Ej4ZmJIfQ160kAncurfUDxkAa4Oa69jjytLRDVX/j9CI61ek bIesGFYqfWEiXqJWs8vwtVpXfclw0mLdmEK0guUbLor/VOmvn7cmiygyPHG751OOe4 VTu5fprP9SDuw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman Cc: Masahiro Yamada , Nicholas Piggin , Rob Herring , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, "Rodrigo R. Galvao" , "Oliver O'Halloran" , Paul Mackerras , Joel Stanley , Mark Greer Subject: [PATCH] powerpc/boot: fix broken way to pass CONFIG options Date: Mon, 13 May 2019 20:22:54 +0900 Message-Id: <20190513112254.22534-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper") was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures with -j 1") was also wrong. Check-in source files never ever depend on build artifacts. The correct dependency is: $(obj)/serial.o: $(obj)/autoconf.h However, copying autoconf.h to arch/power/boot/ is questionable in the first place. arch/powerpc/Makefile adopted multiple ways to pass CONFIG options. arch/powerpc/boot/decompress.c references CONFIG_KERNEL_GZIP and CONFIG_KERNEL_XZ, which are passed via the command line. arch/powerpc/boot/serial.c includes the copied autoconf.h to reference a couple of CONFIG options. Do not do this. We should have already learned that including autoconf.h from each source file is really fragile. In fact, it is already broken. arch/powerpc/boot/ppc_asm.h references CONFIG_PPC_8xx, but arch/powerpc/boot/utils.S is not given any way to access CONFIG options. So, CONFIG_PPC_8xx is never defined here. Just pass $(LINUXINCLUDE) and remove all broken code. I also removed the -traditional flag to make include/linux/kconfig.h work. I do not understand why it needs to imitate the behavior of pre-standard C preprocessors. Signed-off-by: Masahiro Yamada --- arch/powerpc/boot/.gitignore | 2 -- arch/powerpc/boot/Makefile | 14 +++----------- arch/powerpc/boot/serial.c | 1 - 3 files changed, 3 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore index 32034a0cc554..6610665fcf5e 100644 --- a/arch/powerpc/boot/.gitignore +++ b/arch/powerpc/boot/.gitignore @@ -44,5 +44,3 @@ fdt_sw.c fdt_wip.c libfdt.h libfdt_internal.h -autoconf.h - diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 73d1f3562978..b8a82be2af2a 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -20,9 +20,6 @@ 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 @@ -34,7 +31,7 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ - -D$(compress-y) + $(LINUXINCLUDE) ifdef CONFIG_PPC64_BOOT_WRAPPER BOOTCFLAGS += -m64 @@ -51,7 +48,7 @@ BOOTCFLAGS += -mlittle-endian BOOTCFLAGS += $(call cc-option,-mabi=elfv2) endif -BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc +BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) @@ -202,14 +199,9 @@ $(obj)/empty.c: $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S $(Q)cp $< $@ -$(srctree)/$(src)/serial.c: $(obj)/autoconf.h - -$(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/% - $(Q)cp $< $@ - clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \ $(zlib-decomp-) $(libfdt) $(libfdtheader) \ - autoconf.h empty.c zImage.coff.lds zImage.ps3.lds zImage.lds + empty.c zImage.coff.lds zImage.ps3.lds zImage.lds quiet_cmd_bootcc = BOOTCC $@ cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index b0491b8c0199..9457863147f9 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -18,7 +18,6 @@ #include "stdio.h" #include "io.h" #include "ops.h" -#include "autoconf.h" static int serial_open(void) {