From patchwork Tue Jan 15 07:19:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10764033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6D1791E for ; Tue, 15 Jan 2019 07:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B3C62BAB6 for ; Tue, 15 Jan 2019 07:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE642BB00; Tue, 15 Jan 2019 07:21:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 624CA2BAB6 for ; Tue, 15 Jan 2019 07:21:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbfAOHVH (ORCPT ); Tue, 15 Jan 2019 02:21:07 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:46279 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfAOHVH (ORCPT ); Tue, 15 Jan 2019 02:21:07 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x0F7JTTt025896; Tue, 15 Jan 2019 16:19:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x0F7JTTt025896 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547536770; bh=08AbJJ8hBVDBXX2UF9mFjcRwzLGQ7QhyPVH8V6BPlIc=; h=From:To:Cc:Subject:Date:From; b=cc/+VoBvxW4OZPcv2ix8I5JuxXptMd/3lF5mNIh5YELemVL1guzdqCSdqtZ1o8t9/ bi56yFu2Q+LvL4cacgvMAfVg6bFOseR4SJ9XDvvBb/Uynov0dsdYpZueuMekdaKJMK VE2zw6LIg/Rn1xzkzIhTAZCmRi42bi2NiOPEfDo9HkI+xI23PgEEWhE+nbVwU3fdbO jg3bnzwB25WmVBN5NVJQcb4yxrnl8TDXDlXEGPRrV2QZ5Y+AnGzOOPJMSFqUN/QDgr PTgg3eRb6Og435J+KADBC8w+QfjAS1U7EuAmPjMpJib1PA4t3YMT4JI8IVMcggQr6C dahgHqucL4exg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ard Biesheuvel , Samuel Holland , Alexey Kardashevskiy , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Masahiro Yamada , "linux-stable # v4 . 20" , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Date: Tue, 15 Jan 2019 16:19:00 +0900 Message-Id: <1547536740-1572-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit c3ff2a5193fa ("powerpc/32: add stack protector support") caused kernel panic on PowerPC if an external module is used with CONFIG_STACKPROTECTOR because the 'prepare' target was not executed for the external module build. Commit e07db28eea38 ("kbuild: fix single target build for external module") turned it into a build error because the 'prepare' target is now executed but the 'prepare0' target is missing for the external module build. External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is also broken in the same way. Move 'PHONY += prepare0' to the common place. Make is fine with missing rule for phony targets. I minimize the change so it can be easily backported to 4.20.x To fix v4.20 for external modules of PowerPC, please backport e07db28eea38 ("kbuild: fix single target build for external module"), and then this commit. Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891 Fixes: e07db28eea38 ("kbuild: fix single target build for external module") Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support") Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries") Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries") Cc: linux-stable # v4.20 Reported-by: Samuel Holland Reported-by: Alexey Kardashevskiy Signed-off-by: Masahiro Yamada Acked-by: Ard Biesheuvel Tested-by: Alexey Kardashevskiy --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 499b968..789b332 100644 --- a/Makefile +++ b/Makefile @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION endif endif +PHONY += prepare0 ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc # archprepare is used in arch Makefiles and when processed asm symlink, # version.h and scripts_basic is processed / created. -# Listed in dependency order -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 +PHONY += prepare archprepare prepare1 prepare2 prepare3 # prepare3 is used to check if we are building in a separate output directory, # and if so do: