From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: avr-gcc Date: Fri, 15 Apr 2016 14:44:39 +0200 Message-ID: <874mb3rqh4.fsf@drakenvlieg.flower> References: <87wptgmyv1.fsf@elephly.net> <87twoks459.fsf@gnu.org> <87a8qbr2mb.fsf@gnu.org> <87ziy8g3bp.fsf@gnu.org> <87a8kxfdgc.fsf@gnu.org> <87h9f4spw3.fsf@drakenvlieg.flower> <87twj4m92o.fsf@gnu.org> <878u0fs38f.fsf@drakenvlieg.flower> <87potrz1nh.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar37M-0006BA-Da for guix-devel@gnu.org; Fri, 15 Apr 2016 08:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ar37I-0005Ds-A7 for guix-devel@gnu.org; Fri, 15 Apr 2016 08:45:00 -0400 In-Reply-To: <87potrz1nh.fsf@igalia.com> (Andy Wingo's message of "Fri, 15 Apr 2016 11:01:22 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Andy Wingo Cc: "guix-devel@gnu.org" Andy Wingo writes: >> The problem is our usage of C_INCLUDE_PATH. > > I don't understand this diagnosis. If the paths were not in > C_INCLUDE_PATH, they would be in CPATH. Then you'd have the same > problem. No? Let me try to choose my words more carefully. The facts that gcc sets C_INCLUDE_PATH and this native gcc setting this path to the native headers, is added to the environment when cross building, and the fact that C_INCLUDE_PATH does not get special treatment when cross building, like CPATH - add_env_var_paths ("CPATH", BRACKET); + add_env_var_paths ("CROSS_CPATH", BRACKET); makes that the cross-gcc picks up the wrong native headers unless C_INCLUDE_PATH is unset. > Or is there some special logic which is applying to CPATH which is not > applying to C_INCLUDE_PATH? Ah, yes; CPATH is not used when cross building, instead CROSS_CPATH is used. > Basically in Guix we should, IMO, always be working on C_INCLUDE_PATH > and friends, and never on CPATH. I'm guessing that could work; would could try to change the above patch (in gcc-cross-environment-variables.patch) to handle C*_INCLUDE_PATH and introduce CROSS_C*_INCLUDE_PATH. I just wonder if there was another reason for cross builds to choose CPATH/CROSS_CPATH instead of C_*INCLUDE_PATH. Apart maybe from the fact that we would need to handle all `*' where CPATH works for all languages. Greetings, Jan --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20