This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add missing INCLUDE_DEFAULTS_MUSL_LOCAL
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Doug Evans <dje at google dot com>, Bernd Schmidt <bschmidt at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, Rich Felker <dalias at libc dot org>
- Date: Fri, 23 Oct 2015 19:34:36 +0100
- Subject: Re: [PATCH] Add missing INCLUDE_DEFAULTS_MUSL_LOCAL
- Authentication-results: sourceware.org; auth=none
- References: <047d7b6d8c8c4d13600522a1ffa5 at google dot com> <562A697E dot 5040608 at redhat dot com> <CADPb22SqEK0ZgHwMD4bBM8B60xyOeSFCW8nvguD+zXandEXQgw at mail dot gmail dot com>
On 23/10/15 18:39, Doug Evans wrote:
On Fri, Oct 23, 2015 at 10:08 AM, Bernd Schmidt <bschmidt@redhat.com> wrote:
On 10/21/2015 09:00 PM, Doug Evans wrote:
I happened to notice local prefixes not working with musl.
Fixes thusly.
Index: config/linux.h
===================================================================
--- config/linux.h (revision 229130)
+++ config/linux.h (working copy)
@@ -174,6 +174,7 @@
#define INCLUDE_DEFAULTS \
{ \
INCLUDE_DEFAULTS_MUSL_GPP \
+ INCLUDE_DEFAULTS_MUSL_LOCAL \
INCLUDE_DEFAULTS_MUSL_PREFIX \
INCLUDE_DEFAULTS_MUSL_CROSS \
INCLUDE_DEFAULTS_MUSL_TOOL \
Looks pretty obvious given that the macro isn't otherwise used AFAICT. However, I have no idea whether the order is right, since the purpose of all this code here is apparently only to provide a different order than the default.
So, someone who worked on the original musl patches should comment. I would also like to know precisely which ordering change over the default is required, and that it be documented. Ideally we'd come up with a solution that makes us not duplicate all this stuff in linux.h.
Bernd
Crap, sorry for the resend. Grrrr gmail ...
The only significant different AFAICT is that GCC_INCLUDE_DIR is moved
to later (last).
Why this is is briefly described in the intro comment:
config/linux.h:
/* musl avoids problematic includes by rearranging the include
directories.
* Unfortunately, this is mostly duplicated from cppdefault.c */
I've put LOCAL in the same place as the default (as defined by cppdefault.c),
so one could separate the issues here ...
1) Where does LOCAL go for musl?
LOCAL should go the same place as in cppdefault.c
so the patch is ok.
2) More clarification as to why musl doesn't use the default.
... and thus not block this patch on a more global musl rethink.
OTOH I'm in no rush. :-)
musl moves gcc includes after libc includes, that's
the only change.
i think bsd libcs do the same, compiler headers interfering
with libc headers is problematic (e.g. FLT_ROUNDS is wrong
in gcc float.h, applications shouldn't see that), i'm not sure
why glibc wants the current default order, but i do see some
include_next magic dance between glibc and gcc headers..
i think that should be fixed but most likely there is some
reason for it...