Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2982825rwd; Fri, 16 Jun 2023 10:35:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5FEeOIsUu8x88quIBs48V7j4k/wHK57YX+v248u/309SPKWY8d/hRT+KAlVS/UBsRjHktr X-Received: by 2002:a05:6a20:841d:b0:10c:6dbc:2806 with SMTP id c29-20020a056a20841d00b0010c6dbc2806mr3689549pzd.46.1686936939063; Fri, 16 Jun 2023 10:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686936939; cv=none; d=google.com; s=arc-20160816; b=p0qaDpK6fKBlfP05VZ6CxDs1evvo3BjE+nOI3YbSw+ezB2QX6bMPqOv6CkKg5D9vR7 f5L4dwLDeg+HTgy5DE2MGZAdcYU744Df9HJxr18dW6mhDDIfI5yjzSe6OU/NKIypQNub 0AJ3DBQ8bfdrrxHBbsrzpwOLOhFrlIRXQ0695eZNYDz3bJNgY5UlHGZuITvTMRMWlbZl Wnx1pWah1UpQCe3Qh25AioJsjhdd9FFrUOgzi6Q4vF9QJFanzqIDVDUynUmlZGuJA6Sy 6gKQLJnTR4jeldMjkEiYP71kfhAX6POBelFqf/iPnTL8Z11L0H5PbMDfkihOjZoHWjq8 nERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HtSyultnUvegmRIHU1qRF5yM92nKOxIfLtVvZ4M5Imc=; b=lRo3+Qzn6CfGHDWzsAm1noMUDhGG2Zwso95RM6eyMeHrVd9AZ0UpRCZz6GVEFTQytn Sk7qejbDELcXcNRcuyNSM9KXWn186A8Rxn9uvRf/HrRwuFffORgYpXKvjFUSMDwVCAj3 NZuvQGfRxVRZ4iEDejl00o5wt/zNDrdVgxGYaHa/TjRwik2Qh/DayQZ6PN9KCnrl8yrs mNbdhMHptHP6wSoxh4/t/vLPawPEYxqQ43Qq3mfLzKG7UeOl0ZxBx1s4BmpcQZzIgGTW lQiL7osGbQigLE3S8WXlxVLPleNE2CWRAg512p/v1UCavYcO+wjHfc2ucS9w4riXDFHK n6/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkwlJyy+; 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 s18-20020a639252000000b0055381e05234si1141909pgn.489.2023.06.16.10.35.03; Fri, 16 Jun 2023 10:35:39 -0700 (PDT) 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=tkwlJyy+; 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 S1345323AbjFPRHH (ORCPT + 99 others); Fri, 16 Jun 2023 13:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjFPRHF (ORCPT ); Fri, 16 Jun 2023 13:07:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C2A81BC3; Fri, 16 Jun 2023 10:07:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10A8761EFB; Fri, 16 Jun 2023 17:07:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A4DDC433C0; Fri, 16 Jun 2023 17:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686935223; bh=ANYkmBJGUK3gxGc6i6+SY4srcN3mW7UlL+HWDMqvql4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tkwlJyy+ithOeGX55qP22gsPP8xYfhBsmhhjjzi1BAu26df1sHKyOdzmQJjopZEts Ke16g5xnhJ95uYc8EGRdG0h5R7jrEPkAx1lseksGYwRWCSK6WAV0KwtRrkrwC+C8dl 8SMzwnGIy5+5eRx/FIydAdNDT7ea13hzI0KSyObCzhfGwswwloAqYTRcr96YRWDasI DXy23rokJ31kdc4/TkBwUkLoYePPfABueB8t3/QWAeZah9URjt6wx5Owy6LbJgDDRJ YSxUA4CGAqOTwW3tBb82tYKws6ZXeCsh2HT0ZZFPzxGT5iflr+eQly5iwGip0E6J68 f4UmAd8oVJWgw== Date: Fri, 16 Jun 2023 10:07:00 -0700 From: Nathan Chancellor To: Miguel Ojeda Cc: Masahiro Yamada , Wedson Almeida Filho , Alex Gaynor , Nick Desaulniers , Nicolas Schier , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Alice Ryhl , Andreas Hindborg , linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v2 03/11] docs: rust: add paragraph about finding a suitable `libclang` Message-ID: <20230616170700.GB3474164@dev-arch.thelio-3990X> References: <20230616001631.463536-1-ojeda@kernel.org> <20230616001631.463536-4-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230616001631.463536-4-ojeda@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, Jun 16, 2023 at 02:16:23AM +0200, Miguel Ojeda wrote: > 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/ > Reviewed-by: Nick Desaulniers > Signed-off-by: Miguel Ojeda Reviewed-by: Nathan Chancellor > --- > 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..a635be69e062 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 directory 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.41.0 >