From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (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 finch.gentoo.org (Postfix) with ESMTPS id DA9AD158043 for ; Fri, 19 Apr 2024 18:42:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E68EE2AD6; Fri, 19 Apr 2024 18:42:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EE7DFE2AC9 for ; Fri, 19 Apr 2024 18:42:06 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-419ca3f3dd0so4962305e9.2 for ; Fri, 19 Apr 2024 11:42:06 -0700 (PDT) X-Gm-Message-State: AOJu0Yz9FBcx4F/6/SYen2orEpYHclcn017wJOB/qUYXWAlaSmTRVZg1 M9n1rsxz7FFPj/1yhQov4Z5eaWkdcZQW/Zbtsg19nT7IQknn3RfwyZ/SMK/f26Qey6IS9b62yyP r/NfIb+f1aHeZMMLNPGe2nwxxEkU= X-Google-Smtp-Source: AGHT+IHBqux5Nj4vdsNgbkU23L5Stm+m98cQCr02x3O/OYInwlYPlvvU1Wc2G+Dzv9QqoO/AyjIiUXZ4iiyP44v+bPk= X-Received: by 2002:a5d:4082:0:b0:34a:2c89:8517 with SMTP id o2-20020a5d4082000000b0034a2c898517mr2067053wrp.10.1713552123742; Fri, 19 Apr 2024 11:42:03 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <20240419161425.3428694-1-floppym@gentoo.org> In-Reply-To: From: Mike Gilbert Date: Fri, 19 Apr 2024 14:41:52 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH] toolchain-funcs.eclass: tc-env_build: override (E)SYSROOT To: gentoo-dev@lists.gentoo.org Cc: Mike Gilbert Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a8100058-61c5-458a-bd63-717676bb2999 X-Archives-Hash: a8d28ba021073053a659dcdb0d669445 On Fri, Apr 19, 2024 at 1:56=E2=80=AFPM James Le Cuirot = wrote: > > On Fri, 2024-04-19 at 12:14 -0400, Mike Gilbert wrote: > > When using the CBUILD toolchain, it makes no sense to look for headers > > and libraries in the CHOST-based SYSROOT. > > > > Signed-off-by: Mike Gilbert > > --- > > eclass/toolchain-funcs.eclass | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.ecl= ass > > index cde84e6f34c8..58a718180079 100644 > > --- a/eclass/toolchain-funcs.eclass > > +++ b/eclass/toolchain-funcs.eclass > > @@ -1,4 +1,4 @@ > > -# Copyright 2002-2023 Gentoo Authors > > +# Copyright 2002-2024 Gentoo Authors > > # Distributed under the terms of the GNU General Public License v2 > > > > # @ECLASS: toolchain-funcs.eclass > > @@ -384,6 +384,12 @@ tc-export_build_env() { > > # the target build system does not check. > > tc-env_build() { > > tc-export_build_env > > + local -x SYSROOT=3D > > + if [[ ${EAPI} =3D=3D 6 ]]; then > > + local -x ESYSROOT=3D${EPREFIX} > > + else > > + local -x ESYSROOT=3D${BROOT} > > + fi > > CFLAGS=3D${BUILD_CFLAGS} \ > > CXXFLAGS=3D${BUILD_CXXFLAGS} \ > > CPPFLAGS=3D${BUILD_CPPFLAGS} \ > > What do you need this for? Just wondering because I wouldn't have thought > anything you wrap with tc-env_build would care about ESYSROOT. I ran into this when converting dev-build/ninja to use cmake.eclass. Basically, I need to invoke ninja to build its own docs. I accomplish this by building a second "native" (CBUILD) copy of ninja when cross-compiling. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3D1122aa04647a60de1508= 11c133490d248de4bc43 cmake.eclass utilizes ESYSROOT when SYSROOT is not empty. https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/cmake.eclass?id=3D112= 2aa04647a60de150811c133490d248de4bc43#n503 If I don't set SYSROOT to empty when building the "native" ninja, it explodes with a segfault when I invoke it in the ebuild.