Received: by 10.223.185.116 with SMTP id b49csp6171086wrg; Thu, 8 Mar 2018 03:04:45 -0800 (PST) X-Google-Smtp-Source: AG47ELtm7KqT7/ASmslFXvgUd0Snb/1FUWSrwu+857SyjvTxYjQ2NC0I38/vk3zPLYClSNgx2pEJ X-Received: by 2002:a17:902:b787:: with SMTP id e7-v6mr23975612pls.317.1520507085730; Thu, 08 Mar 2018 03:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520507085; cv=none; d=google.com; s=arc-20160816; b=pfoM9LxOZvWsm0z+cOdL+5uDYQwaFKC7J0kkBxptAIZcF04Lv9aNwpDrLLmSw4iUTQ fjkLMCBTaK3jm9vp9kt6Pyx8MDbDGm33mnjjXB84i2OYT7hKAVyKTQ6TLmRVD9IGAJYm V7gd1PIGGMt8kRXjdk1KxAfFi3nTzDNHPq20cZflnbje36cK/HQf2LhQAt8bvfRF0C1W 2ebnabzNITR1j8b3UEMCKs7y50M5e++U4uJ7LiY/MmNBTHesI7fa+22PivQP+X6XGyEU /32NW7cSpvU/naGGb3KFiIdnqF0dihJtthJVQENEgsVKrQpv5zYRXqUsALvkeaPD4qt3 z9bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=X32Fqes97BJaba7v4bnD+B2L/DXveYS2iK65yzThXhc=; b=yrSyIM+mljnyObyaRR9D7EwHRW6uPLLj9W5S6HC8P+K2kXHmXPZFrCtTdBREV43lFt lfXNn1o6NDHeDtj2LIxSizEWzDFigc6DsLnApStC0COGBstAKYvbpK6XHILDTHtgnCRU 94TqjVJGNQHoah22u9UQ7h2YWAJsEm8kuYx4BJGzQ3h+mv8f7kvoL17d1F35nUsQlwWr 8osAJqYp0IHW/p73cU3j5eXNqfDoyotf0OA8XDaSjbGTtDK7bKakVoH1d2jcirLJGw3V +ZhU0DvQLIrpb8pHTaoz9MTOyViKF5+xRI8M7mnomGrdryC7/+SU6D7rKsPiHnGV/QPJ GIyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 x3-v6si7092342plv.81.2018.03.08.03.04.31; Thu, 08 Mar 2018 03:04:45 -0800 (PST) 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; 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 S1755602AbeCHLDD (ORCPT + 99 others); Thu, 8 Mar 2018 06:03:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:35098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbeCHLDB (ORCPT ); Thu, 8 Mar 2018 06:03:01 -0500 Received: from localhost.localdomain (jahogan.plus.com [212.159.75.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2345C2133D; Thu, 8 Mar 2018 11:02:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2345C2133D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jhogan@kernel.org From: James Hogan To: Masahiro Yamada Cc: linux-kernel@vger.kernel.org, James Hogan , Rob Herring , Michal Marek , Ralf Baechle , Florian Fainelli , Kevin Cernekee , devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-mips@linux-mips.org, stable@vger.kernel.org Subject: [PATCH v2] kbuild: Handle builtin dtb file names containing hyphens Date: Thu, 8 Mar 2018 11:02:46 +0000 Message-Id: <20180308110246.16639-1-jhogan@kernel.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cmd_dt_S_dtb constructs the assembly source to incorporate a devicetree FDT (that is, the .dtb file) as binary data in the kernel image. This assembly source contains labels before and after the binary data. The label names incorporate the file name of the corresponding .dtb file. Hyphens are not legal characters in labels, so .dtb files built into the kernel with hyphens in the file name result in errors like the following: bcm3368-netgear-cvg834g.dtb.S: Assembler messages: bcm3368-netgear-cvg834g.dtb.S:5: Error: : no such section bcm3368-netgear-cvg834g.dtb.S:5: Error: junk at end of line, first unrecognized character is `-' bcm3368-netgear-cvg834g.dtb.S:6: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_begin:' bcm3368-netgear-cvg834g.dtb.S:8: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_end:' bcm3368-netgear-cvg834g.dtb.S:9: Error: : no such section bcm3368-netgear-cvg834g.dtb.S:9: Error: junk at end of line, first unrecognized character is `-' Fix this by updating cmd_dt_S_dtb to transform all hyphens from the file name to underscores when constructing the labels. As of v4.16-rc2, 1139 .dts files across ARM64, ARM, MIPS and PowerPC contain hyphens in their names, but the issue only currently manifests on Broadcom MIPS platforms, as that is the only place where such files are built into the kernel. For example when CONFIG_DT_NETGEAR_CVG834G=y, or on BMIPS kernels when the dtbs target is used (in the latter case it admittedly shouldn't really build all the dtb.o files, but thats a separate issue). Fixes: 695835511f96 ("MIPS: BMIPS: rename bcm96358nb4ser to bcm6358-neufbox4-sercom") Signed-off-by: James Hogan Reviewed-by: Frank Rowand Cc: Rob Herring Cc: Masahiro Yamada Cc: Michal Marek Cc: Ralf Baechle Cc: Florian Fainelli Cc: Kevin Cernekee Cc: devicetree@vger.kernel.org Cc: linux-kbuild@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: # 4.9+ --- Changes in v2: - Rewrite commit message (thanks Frank for some improved wording). - Add Franks' reviewed-by. --- scripts/Makefile.lib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5589bae34af6..a6f538b31ad6 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -297,11 +297,11 @@ cmd_dt_S_dtb= \ echo '\#include '; \ echo '.section .dtb.init.rodata,"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ - echo '.global __dtb_$(*F)_begin'; \ - echo '__dtb_$(*F)_begin:'; \ + echo '.global __dtb_$(subst -,_,$(*F))_begin'; \ + echo '__dtb_$(subst -,_,$(*F))_begin:'; \ echo '.incbin "$<" '; \ - echo '__dtb_$(*F)_end:'; \ - echo '.global __dtb_$(*F)_end'; \ + echo '__dtb_$(subst -,_,$(*F))_end:'; \ + echo '.global __dtb_$(subst -,_,$(*F))_end'; \ echo '.balign STRUCT_ALIGNMENT'; \ ) > $@ -- 2.13.6