Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8118607rwl; Fri, 30 Dec 2022 23:12:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXv+ptly7MjSYEmCNrahguPdMfwPmCHNluwX+KC7xlulwDGNkKnECtta4rs1kx5o/vmfqMtn X-Received: by 2002:a17:90a:7f86:b0:225:c085:2ed3 with SMTP id m6-20020a17090a7f8600b00225c0852ed3mr28925495pjl.39.1672470777395; Fri, 30 Dec 2022 23:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672470777; cv=none; d=google.com; s=arc-20160816; b=g89ji5giRlq88vLQfp96Eq+Qan6q0St4xoKhNQLPXAjP4N9BC3QmZf2877+NvJQwCw qOwtCUxBIjQdhW9lRL8SLnsOqc85v4mHghGplsoc3nQVuXtE4JBBstjO+kJDw1DImALu Vu1+MHoE2HPwgqdqmrO76MYXePQZgFCP+WNkLsRMjrlynnaACPGLQT9OAAew6qHJG6I7 KtdV27GtFKQBM/1P0i8CVmdJaBymYBWUH8UqjGmMMpPIdss0AEnaVxthjqQHIyQIG3Kx GmDM1iqeaQt2MTW2RcVoWI4zv0pL3ASwJjCXR0qk1QtvTIAAPFlElPi1paDgauffqETc N8OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mS+QwM2C48TKR4S1u/eqCDmgzkfx5YUcl5DAJhuEy/E=; b=zVGK9O9jVJQ26vukpP6Pf5nYUAkNyQRLTjiUeOshI8UAiwFfsqfC2JwVo0X8q5zf8z Wb9BFkQVxj2DPD/tZ9JGHr0KnqEnfDTFJBU5Wi11RbGHFvQe3IS0oJUpZC73NH60mtTl z/V1v67WUB8J0vtcKYs/mZ38q+b6SlnLAlDUNyfNkE4VwTKX3ZBkVZsjDZeLwrZeE2eV hqkXcTnO0+ngD8ViYn3t+aFyAnKiMQYBfW3ulS4RpcFNBlK2KV7aQ5jL2xt56c7U9Ouh da4d0H6bgB/rYPrXI420PIpArAa4cc4z3C5qfRX6aHbggWnmG53/RHBNGFl3oYiocCJ/ UnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQpteJpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a63-20020a639042000000b00461bf5f86fdsi24359052pge.403.2022.12.30.23.12.47; Fri, 30 Dec 2022 23:12:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQpteJpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235623AbiLaGmt (ORCPT + 62 others); Sat, 31 Dec 2022 01:42:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231553AbiLaGmj (ORCPT ); Sat, 31 Dec 2022 01:42:39 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D406A13FA1; Fri, 30 Dec 2022 22:42:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 34DA8CE19E5; Sat, 31 Dec 2022 06:42:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2D05C433D2; Sat, 31 Dec 2022 06:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672468951; bh=5OrrSG3HnFPsNx647A+ePC6NFhN8w9ptOuEE6V18iio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YQpteJpGRVv60LnIO7ahIvfLcIxAKn74971cR7DTRmsYTY33XJHnS08UUG+84IoBP pVe1xO14P/bla6/4BYWc98HdAwu0NndZIrktvbokoATjjIaAqJzurUacaFvULcpVxu 96Mys0LKaInJn01urGD9T/qbvbrNiy6+3s6ZuRtZuOBC3AmChrsbrxDHYBqe+32EQX j3bKXf4V+KVbLIo+9LILeLLZtrzjCCQDGav8oSIFbKmjBrg4Ww4IH2qQaS36CBFioS VUHm9N4+9+h7hrukuvytq1Zlv9F1qGNgUhEbQoEeXIWa4sT+EQanqf+yRoRXDFkdhJ xxxM0M6O6iV5g== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 6/6] fixdep: do not parse *.so, *.rmeta, *.rlib Date: Sat, 31 Dec 2022 15:42:03 +0900 Message-Id: <20221231064203.1623793-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221231064203.1623793-1-masahiroy@kernel.org> References: <20221231064203.1623793-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fixdep is designed only for parsing text files. read_file() appends a terminating null byte ('\0') and parse_config_file() calls strstr() to search for CONFIG options. rustc outputs *.so, *.rmeta, *rlib to dep-info. fixdep needs them in the dependency, but there is no point to parse such binary files. Signed-off-by: Masahiro Yamada --- scripts/basic/fixdep.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index cc8f6d34c2ca..b70885116ed2 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -250,6 +250,15 @@ static int is_ignored_file(const char *s, int len) str_ends_with(s, len, "include/generated/autoksyms.h"); } +/* Do not parse these files */ +static int is_no_parse_file(const char *s, int len) +{ + /* rustc may output binary files into dep-info */ + return str_ends_with(s, len, ".rlib") || + str_ends_with(s, len, ".rmeta") || + str_ends_with(s, len, ".so"); +} + /* * Important: The below generated source_foo.o and deps_foo.o variable * assignments are parsed not only by make, but also by the rather simple @@ -378,7 +387,7 @@ static void parse_dep_file(char *p, const char *target) need_parse = true; } - if (need_parse) { + if (need_parse && !is_no_parse_file(p, q - p)) { void *buf; buf = read_file(p); -- 2.34.1