This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[review v2] libc: Don't use a custom wrapper macro around __has_include.


Florian Weimer has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/697
......................................................................


Patch Set 2:

(5 comments)

| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +8,17 @@ libc: Don't use a custom wrapper macro around __has_include.
| +
| +This causes issues when using clang with -frewrite-includes to e.g., submit the
| +translation unit to a distributed compiler.
| +
| +In my case, I was building Firefox using sccache.
| +
| +See https://bugs.llvm.org/show_bug.cgi?id=43982 for a reduced test-case since I
| +initially thought this was a clang bug.
| +
| +Apparently doing this is invalid C++ per:
| +
| + * http://eel.is/c++draft/cpp.cond#7.sentence-2

PS1, Line 19:

Done

| +
| +(See https://bugs.llvm.org/show_bug.cgi?id=37990)
| +
| +Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

PS1, Line 23:

Done

| +Change-Id: Id4b8ee19176a9e4624b533087ba870c418f27e60
| --- sysdeps/unix/sysv/linux/bits/statx.h
| +++ sysdeps/unix/sysv/linux/bits/statx.h
| @@ -26,12 +26,14 @@ /* Use the Linux kernel header if available.  */
|  
|  /* Use "" to work around incorrect macro expansion of the
|     __has_include argument (GCC PR 80005).  */
| -#if __glibc_has_include ("linux/stat.h")
| -# include "linux/stat.h"
| -# ifdef STATX_TYPE
| -#  define __statx_timestamp_defined 1
| -#  define __statx_defined 1
| -# endif
| +#ifdef __has_include

PS1, Line 29:

Done

| +#  if __has_include("linux/stat.h")

PS1, Line 30:

Done

| +#   include "linux/stat.h"
| +#   ifdef STATX_TYPE
| +#    define __statx_timestamp_defined 1
| +#    define __statx_defined 1
| +#   endif
| +#  endif
|  #endif
|  
|  #include <bits/statx-generic.h>
| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +1,16 @@ 
| +Parent:     fcb04b9a (Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x)
| +Author:     Emilio Cobos Álvarez <emilio@crisal.io>
| +AuthorDate: 2019-11-12 19:18:32 +0100
| +Commit:     Emilio Cobos Álvarez <emilio@crisal.io>
| +CommitDate: 2019-11-21 14:43:52 +0100
| +
| +libc: Don't use a custom wrapper macro around __has_include.

PS2, Line 7:

Sorry, missed this before.

Please include a reference to the bug, as (bug 25189) or [BZ #25189].
And the libc: prefix probably is not needed.

The rest looks good to me.

| +
| +This causes issues when using clang with -frewrite-includes to e.g., submit the
| +translation unit to a distributed compiler.
| +
| +In my case, I was building Firefox using sccache.
| +
| +See [1] for a reduced test-case since I initially thought this was a clang bug,
| +and [2] for more context.
| +

-- 
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Id4b8ee19176a9e4624b533087ba870c418f27e60
Gerrit-Change-Number: 697
Gerrit-PatchSet: 2
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-Reviewer: Florian Weimer <fw@deneb.enyo.de>
Gerrit-Reviewer: Florian Weimer <fweimer@redhat.com>
Gerrit-Comment-Date: Thu, 21 Nov 2019 14:09:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: comment


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]