GNU bug report logs - #30756
GCC >= 6 '-isystem' and C_INCLUDE_PATH behavior changed, breaking #include_next

Previous Next

Package: guix;

Reported by: julien lepiller <julien <at> lepiller.eu>

Date: Fri, 9 Mar 2018 12:12:01 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 30756 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Giel van Schijndel <giel <at> mortis.eu>
Cc: Marius Bakke <mbakke <at> fastmail.com>, julien lepiller <julien <at> lepiller.eu>,
 30756 <at> debbugs.gnu.org
Subject: Re: bug#30756: gcc7 doesn't find stdlib.h
Date: Fri, 04 May 2018 14:43:42 +0200
[Message part 1 (text/plain, inline)]
Hi,

Giel van Schijndel <giel <at> mortis.eu> skribis:

> On 09-03-18 13:42, Ludovic Courtès wrote:
>> julien lepiller <julien <at> lepiller.eu> skribis:
>>
>>> I'm trying to build a software that requires gcc>=7.2. Unfortunately,
>>> the process crashes and ends with:
>>>
>>> /gnu/store/a4vwdk8r6p6l2mnffz4yaqlr1z6z6w3r-gcc-7.3.0/include/c++/cstdlib:75:15:
>>> fatal error: stdlib.h: No such file or directory.
>> On IRC Marius mentioned this bug report:
>>
>>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129#c3
>>
>> Note that we use C_INCLUDE_PATH, which is equivalent to ‘-isystem’.
>
> This is biting me too for a C++17 project I'm trying to build.

Marius, do you have a link to the exact change in GCC that caused this
regression?

I find it hard to believe that a fix would necessarily “slow everything
down”, as Jakub put it in the report above.

Also it seems clear that in Guix we’ll want a solution that’s not
CMake-specific.

Giel, does the patch below work for you?

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 62b896882..9a82a9e81 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -476,7 +476,17 @@ Go.  It also includes runtime support libraries for these languages.")
                     "pa" "sh" "tilepro" "xtensa")))))
     (inputs
      `(("isl" ,isl)
-       ,@(package-inputs gcc-4.7)))))
+       ,@(package-inputs gcc-4.7)))
+
+    (native-search-paths
+     ;; We have to use 'CPATH' for GCC > 5, not 'C_INCLUDE_PATH' & co., due to
+     ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129>.
+     (list (search-path-specification
+            (variable "CPATH")
+            (files '("include")))
+           (search-path-specification
+            (variable "LIBRARY_PATH")
+            (files '("lib" "lib64")))))))
 
 (define-public gcc-7
   (package
[Message part 3 (text/plain, inline)]
Thanks,
Ludo’.

This bug report was last modified 5 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.