Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6770328rwl; Mon, 9 Jan 2023 12:49:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXv2Mw93b1Rs+F1hBtG7FrpPDagoA+ZTvlEfRF1lYe2bZk1hvrx93UiAX7THPKen356wCVfC X-Received: by 2002:a17:906:11ce:b0:84d:3289:3287 with SMTP id o14-20020a17090611ce00b0084d32893287mr10110465eja.43.1673297389546; Mon, 09 Jan 2023 12:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673297389; cv=none; d=google.com; s=arc-20160816; b=FpSN0a3Tw/0TMctVHIEX3+t+DAi0LL6USliPbMWwbyHFs9o6WPPnqbDrkav5yz1LYE 75lDMAxCdWqVEbUXrLW4MhFQGAIdsyRz6yRN8pQ4GR48K8gIbC8IkYrQMdbxLVmYj9ZR 93OtmO1ME9MhKQ4gDJjhssv26utEJrFFO4K+stLHlagGcEmqwflBlxlfrougrFBIJ7eV Bo8MZtYk0ni4lH5MybgWhRzdL5Z6j005KayTWFsvawcyvVKeK/WRFoq/ZkVBd1Ts4Kde 70azBGQk6Icmo7XBNl8aCZaVsSaUdCRCJ5zAC8ByAY2nlTXDA8IoUYj8ElsFfEjWfbnK Hn3Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=NaSxqnXsRvl5Bhch3ZbBDYBWIfvwnRKqUqzNpWVIK1A=; b=vMSubReZxmS3AWPrsGgcZatCA9kUilEpTwBoDrbhwfJmyskPbqL9u/aBDYhN6k2KsX TFR7ahtgFXuD384H59gURZeOycNzjN8oNVWSZurqBvSkrkyS9kfji1LrhVktU1gq6p2/ X2KVuHF3SrxaA4hoBy+sd3i3IiSsCpOSAQwYf1B31F/qyz1PfgQF+GcKu63esnXAq0pm XYHKpVhPkYpfNDzWr0fpI2DfGZ5XCbxAU4m+dZ+53kOqd55SN+TjU5flAnN2XqteQce8 yGZ5Zi4xFYDNgCKaGPapv3hFhXu7bkOm/LtKAhcSnj0LMvGyLopfEzUoijCl6rRc470y n44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="g6N3/ydS"; 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 a20-20020a17090680d400b007a835c56b70si7674607ejx.267.2023.01.09.12.49.36; Mon, 09 Jan 2023 12:49:49 -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="g6N3/ydS"; 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 S234961AbjAIUp5 (ORCPT + 53 others); Mon, 9 Jan 2023 15:45:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbjAIUpx (ORCPT ); Mon, 9 Jan 2023 15:45:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D988240; Mon, 9 Jan 2023 12:45:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E633E613EA; Mon, 9 Jan 2023 20:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9624C433EF; Mon, 9 Jan 2023 20:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673297149; bh=7uir+fpWvzx/j9KVXbIqIv40RM5gM3COk4tThC15780=; h=From:To:Cc:Subject:Date:From; b=g6N3/ydSgf1ekjlEVVfHIsbM86g99kyRUChoRdZg9dF1V/YnyOisYY37+GmhiitC0 Jdi2fKYCxTR6yF2oF3U/V0kkuRBNpAVyrGOiqqVN4JpG6eGFBVbNFBPsOHQSc17+Vh lNaZxi1Dt9tvPKNvDjwQJ/6lv0fPjQGtuA3lfiiPTgOB3RZLYuYpvrrMsjEILsl8qI QuDZ0h1vJ7mq97UjXtbliAoUDQc6j8sjYcuAkg/KbYgpKCbjPb1lBS2UTe6sN8SZZ+ 83WGp3wKWYw6yURHS1NMI9AG1KA78Jh38A6ktiB7Obi8hyEL74pZ22Jywp1NEdzJtS zQWuLBcrUi58A== From: Miguel Ojeda To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH 1/6] docs: rust: add paragraph about finding a suitable `libclang` Date: Mon, 9 Jan 2023 21:45:15 +0100 Message-Id: <20230109204520.539080-1-ojeda@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 Sometimes users need to tweak the finding process of `libclang` for `bindgen` via the `clang-sys`-provided environment variables. Thus add a paragraph to the setting up guide, including a reference to `clang-sys`'s relevant documentation. Link: https://lore.kernel.org/rust-for-linux/CAKwvOdm5JT4wbdQQYuW+RT07rCi6whGBM2iUAyg8A1CmLXG6Nw@mail.gmail.com/ Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst index 13b7744b1e27..cae21ea7de41 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -100,6 +100,23 @@ Install it via (note that this will download and build the tool from source):: cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen +``bindgen`` needs to find a suitable ``libclang`` in order to work. If it is +not found (or a different ``libclang`` than the one found should be used), +the process can be tweaked using the environment variables understood by +``clang-sys`` (the Rust bindings crate that ``bindgen`` uses to access +``libclang``): + +* ``LLVM_CONFIG_PATH`` can be pointed to an ``llvm-config`` executable. + +* Or ``LIBCLANG_PATH`` can be pointed to a ``libclang`` shared library + or to the directoy containing it. + +* Or ``CLANG_PATH`` can be pointed to a ``clang`` executable. + +For details, please see ``clang-sys``'s documentation at: + + https://github.com/KyleMayes/clang-sys#environment-variables + Requirements: Developing ------------------------ -- 2.39.0