From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: reza.housseini@gmx.ch, 30756@debbugs.gnu.org,
Reza Housseini <reza.housseini@gmail.com>
Subject: bug#30756: GCC >= 6 '-isystem' and C_INCLUDE_PATH behavior changed, breaking
Date: Tue, 21 Jan 2020 22:04:36 -0500 [thread overview]
Message-ID: <878sm0kx8b.fsf@gmail.com> (raw)
In-Reply-To: <87sgkaik08.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 20 Jan 2020 09:56:23 +0100")
Hello,
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> It'd be nice to find a correct solution, but it seems I can't even make
>> the build system of Inkscape work after switching from CPATH to
>> CPLUS_INCLUDE_PATH and stripping it from any glibc/gcc include
>> directories (I don't get the "stdlib.h: No such file or directory."
>> error anymore, but I now get:
>> "/gnu/store/zw5f5g5aqlxam3imaylfla0i98nkridf-glibc-2.30/include/bits/errno.h:26:11:
>> fatal error: linux/errno.h: No such file or directory" instead, which I
>> don't understand).
>>
>> I also tried moving the glibc include directory to the end of
>> CPLUS_INCLUDE_PATH and it would still wouldn't be happy. Hmmph!
>
> Oh, really? I think that, as Mark H Weaver mentioned in this thread, if
> we make sure that glibc comes next-to-last (before Linux-libre headers)
> and appears only once in the list, it should work.
>
> Can you confirm?
OK, so the errors I was getting about linux/errno.h missing was caused
by my omission to *also* set C_INCLUDE_PATH to the content of CPATH,
because Inkscape goes on building some bundled libraries which are C and
not C++.
After this was understood, Inkscape now builds successfully by simply
taking out glibc from the inputs. Keeping GCC headers in seems OK,
although I reckon if we fix this at the core (by extending what can be
done which search path specifications) we should take it out as it could
potentially cause problems: GCC keeps a reference to its own standard
include directories, as shown by the command 'echo | ~a/bin/c++ -E
-Wp,-v -'). On core-updates, this command, when ran in the following
phase:
--8<---------------cut here---------------start------------->8---
(add-before 'set-paths 'show-g++-internal-paths
(lambda* (#:key inputs #:allow-other-keys)
(system (format #f "echo | ~a/bin/c++ -E -Wp,-v -" (assoc-ref inputs "gcc")))
#t))
--8<---------------cut here---------------end--------------->8---
gives:
--8<---------------cut here---------------start------------->8---
starting phase `show-g++-internal-paths'
ignoring nonexistent directory "/no-gcc-local-prefix/include"
ignoring nonexistent directory "/gnu/store/bhn2mqpnxabmllh1kclrmkqp8mhhvjb0-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/../../../../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/gnu/store/bhn2mqpnxabmllh1kclrmkqp8mhhvjb0-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include
/gnu/store/bhn2mqpnxabmllh1kclrmkqp8mhhvjb0-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed
/gnu/store/zw5f5g5aqlxam3imaylfla0i98nkridf-glibc-2.30/include
End of search list.
--8<---------------cut here---------------end--------------->8---
which lists references to GCC itself as well as to glibc.
The use of -idirafter is to append a headers directory after
*everything* else, including the compiler's own standard include paths.
I think that to -idirafter glibc shouldn't have any effect, since glibc
headers are already in the standard include path, and IIUC GCC will scan
a header directory only once (the first time it encounters it). The GCC
manual lists the include directories order as (c.f. the node 'Options
for Directory Search' of the GCC reference manual):
1. For the quote form of the include directive, the directory of
the current file is searched first.
2. For the quote form of the include directive, the directories
specified by '-iquote' options are searched in left-to-right
order, as they appear on the command line.
3. Directories specified with '-I' options are scanned in
left-to-right order.
4. Directories specified with '-isystem' options are scanned in
left-to-right order.
5. Standard system directories are scanned.
6. Directories specified with '-idirafter' options are scanned in
left-to-right order.
It'd be very cool to embed arbitrary logic such as sorting, filtering,
or whatever else we need doing directly in a search path specification
:-). Do you thing this could be done? Perhaps Gexps could be useful
for this?
Maxim
next prev parent reply other threads:[~2020-01-22 3:06 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
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 [this message]
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=878sm0kx8b.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=30756@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=reza.housseini@gmail.com \
--cc=reza.housseini@gmx.ch \
/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.