all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Giel van Schijndel <giel@mortis.eu>
Cc: 30756@debbugs.gnu.org
Subject: bug#30756: gcc7 doesn't find stdlib.h
Date: Fri, 04 May 2018 12:41:52 -0400	[thread overview]
Message-ID: <87zi1fid9r.fsf@netris.org> (raw)
In-Reply-To: <58dc244a-8ff5-fb1f-8c7b-d6745c1f2558@mortis.eu> (Giel van Schijndel's message of "Fri, 4 May 2018 18:03:38 +0200")

Giel van Schijndel <giel@mortis.eu> writes:

> On 04-05-18 17:28, Ludovic Courtès wrote:
>> That’s probably because your package still includes gcc@5 as an implicit
>> input via ‘cmake-build-system’.
>>
>> You could use a procedure like this to remove implicit inputs and add
>> your own GCC variant:
>>
>> --8<---------------cut here---------------start------------->8---
>> (define (package-with-specific-compiler p compiler)
>>   "Return P modified to be built with COMPILER."
>>   (package
>>     (inherit p)
>>     (arguments
>>      `(#:implicit-inputs? #f ,@(package-arguments p)))
>>     (native-inputs `(("compiler" ,compiler)
>>                      ,@(package-native-inputs p)))
>>     (inputs (append (package-inputs p)
>>                     (alist-delete "gcc" (standard-packages))))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> … where ‘standard-packages’ comes from (guix build-system gnu).
> This gives me:
>> guix/build-system/cmake.scm:93:0: In procedure cmake-build:
>> guix/build-system/cmake.scm:93:0: Unrecognized keyword: #:implicit-inputs?
>
>>> Would it be possible to filter the list of directories added to these
>>> environment variables to exclude those already present in GCC's default
>>> search path?
>> I still don’t fully understand the issue actually.  What’s wrong with
>> having these directories appear several times in the search path?
>>
>> The difficulty here will be that search path environment variables in
>> Guix are populated automatically based on their specifications, so it’s
>> not all that clear to me where that filtering would happen.
>
> The problem seems to be triggered by glibc appearing on the search path.
>
> I'm not sure about GCC's internals exactly so I'm making one assumption
> that causes all of this to make sense to me: if a directory appears
> multiples times in the search path it will be searched only the first
> time that it's encountered.
>
> So in short: <cstdlib> contains an "#include_next <stdlib.h>"
> preprocessor directive. That's a GCC extension that tells the
> preprocessor it should only search directories appearing in the search
> path _after_ the directory containing the file currently being processed.

I ran into the same problem with our 'gjs' package in the 'core-updates'
branch.  First I added 'gcc-7' to the inputs to work around a different
issue (an internal compiler error in gcc-5), and then I encountered the
exact problem you described above.

On my own private branch, I worked around this problem by adding
"-idirafter <LIBC>/include" to CXXFLAGS, but of course it's not a proper
fix.  My workaround happens to be in Savannah on the
'reproduce-bug-29774' branch:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?h=reproduce-bug-29774&id=87022e2666c5e68e865eb160a4bd8e9cdcc1a955

       Mark

  reply	other threads:[~2018-05-04 16:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 12:10 bug#30756: gcc7 doesn't find stdlib.h julien lepiller
2018-03-09 12:42 ` Ludovic Courtès
2018-05-04  9:46   ` Giel van Schijndel
2018-05-04 12:43     ` Ludovic Courtès
2018-05-04 14:30       ` Giel van Schijndel
2018-05-04 15:07         ` Giel van Schijndel
2018-05-04 15:28         ` Ludovic Courtès
2018-05-04 16:03           ` Giel van Schijndel
2018-05-04 16:41             ` Mark H Weaver [this message]
2018-05-04 17:14               ` Mark H Weaver
2018-05-04 20:39               ` Ludovic Courtès
2018-05-04 21:36                 ` Mark H Weaver
2018-05-07 10:12         ` Ludovic Courtès
2018-05-07 23:32           ` Mark H Weaver
2018-05-08 13:21             ` Ludovic Courtès
2019-10-22 16:26 ` bug#30756: GCC >= 6 '-isystem' and C_INCLUDE_PATH behavior changed, breaking #include_next Carl Dong
2019-12-14 14:23 ` bug#30756: Use {C,CPLUS,OBJC}_INCLUDE_PATH instead of CPATH Mark Wielaard
2020-01-17 10:23 ` bug#30756: GCC >= 6 '-isystem' and C_INCLUDE_PATH behavior changed, breaking Reza Housseini
2020-01-19 21:16   ` Ludovic Courtès
2020-01-20  3:25     ` Maxim Cournoyer
2020-01-20  8:56       ` Ludovic Courtès
2020-01-22  3:04         ` Maxim Cournoyer
2020-01-23 20:45           ` Ludovic Courtès
2020-02-03  9:00             ` Ludovic Courtès
2020-02-03 21:03               ` Marius Bakke
2020-02-04 11:28                 ` Ludovic Courtès
2020-02-06 17:49                   ` Ludovic Courtès
2020-02-07  3:39               ` Maxim Cournoyer
2020-02-07 11:00                 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zi1fid9r.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=30756@debbugs.gnu.org \
    --cc=giel@mortis.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.