Commit c401fad6 authored by Abhishek Arya's avatar Abhishek Arya Committed by Commit Bot

Revert "Stop using -std=gnu*"

This reverts commit c85c6c91.

Reason for revert: Broke AFL ASan builder
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Afl%20Upload%20Linux%20ASan

Original change's description:
> Stop using -std=gnu*
> 
> BUG=427584
> R=​thakis
> TBR=sbc
> 
> Change-Id: I4a6f67aa6ddaf8ab78719a3c925fcd732b8c28bf
> Reviewed-on: https://chromium-review.googlesource.com/1149337
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#581478}

TBR=thakis@chromium.org,thomasanderson@chromium.org

Change-Id: Ie673c185580662fad3d641000edfc4ee203acf9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 427584
Reviewed-on: https://chromium-review.googlesource.com/1166663Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581481}
parent 00a14cbc
......@@ -547,22 +547,16 @@ config("compiler") {
cxx11_override = use_cxx11
}
# Since we build with -std=c* and not -std=gnu*, _GNU_SOURCE will not be
# defined by the compiler. However, lots of code relies on the non-standard
# features that _GNU_SOURCE enables, so define it manually.
defines += [ "_GNU_SOURCE" ]
cflags_c += [ "-std=c11" ]
# gnu11/gnu++11 instead of c11/c++11 is needed because some code uses typeof()
# (a GNU extension).
# TODO(thakis): Eventually switch this to c++11 instead,
# http://crbug.com/427584
cflags_c += [ "-std=gnu11" ]
if (cxx11_override) {
# Override Chromium's default for projects that wish to stay on C++11.
cflags_cc += [ "-std=c++11" ]
cflags_cc += [ "-std=gnu++11" ]
} else {
cflags_cc += [ "-std=c++14" ]
}
if (is_nacl) {
# Undefine __STRICT_ANSI__ to get non-standard features which would
# otherwise not be enabled by NaCl's sysroots.
cflags += [ "-U__STRICT_ANSI__" ]
cflags_cc += [ "-std=gnu++14" ]
}
} else if (!is_win && !is_nacl) {
if (target_os == "android") {
......
......@@ -82,7 +82,7 @@ EXTERN_C_BEGIN
#define WRAP(name) __nacl_irt_##name##_wrap
// Declare REAL function pointer.
#define DECLARE_REAL_PTR(name) __typeof__(__nacl_irt_##name) REAL(name);
#define DECLARE_REAL_PTR(name) typeof(__nacl_irt_##name) REAL(name);
// Assign the REAL function pointer.
#define ASSIGN_REAL_PTR(name) \
......@@ -90,12 +90,10 @@ EXTERN_C_BEGIN
REAL(name) = __nacl_irt_##name;
// Switch IRT's pointer to the REAL pointer
#define USE_REAL(name) \
__nacl_irt_##name = (__typeof__(__nacl_irt_##name))REAL(name)
#define USE_REAL(name) __nacl_irt_##name = (typeof(__nacl_irt_##name))REAL(name)
// Switch IRT's pointer to the WRAP function
#define USE_WRAP(name) \
__nacl_irt_##name = (__typeof__(__nacl_irt_##name))WRAP(name)
#define USE_WRAP(name) __nacl_irt_##name = (typeof(__nacl_irt_##name))WRAP(name)
#define EXPAND_SYMBOL_LIST_OPERATION(OP) \
OP(chdir); \
......
......@@ -32,18 +32,18 @@ EXTERN_C_BEGIN
// Declare REAL function pointer.
#define DECLARE_REAL_PTR(group, name) \
__typeof__(__libnacl_irt_##group.name) REAL(name);
typeof(__libnacl_irt_##group.name) REAL(name);
// Assign the REAL function pointer.
#define ASSIGN_REAL_PTR(group, name) REAL(name) = __libnacl_irt_##group.name;
// Switch IRT's pointer to the REAL pointer
#define USE_REAL(group, name) \
__libnacl_irt_##group.name = (__typeof__(REAL(name)))REAL(name);
__libnacl_irt_##group.name = (typeof(REAL(name)))REAL(name);
// Switch the IRT's pointer to the WRAP function
#define USE_WRAP(group, name) \
__libnacl_irt_##group.name = (__typeof__(REAL(name)))WRAP(name);
__libnacl_irt_##group.name = (typeof(REAL(name)))WRAP(name);
extern void __libnacl_irt_dev_filename_init(void);
extern void __libnacl_irt_dev_fdio_init(void);
......
......@@ -15,10 +15,8 @@ declare_args() {
if (!use_system_libdrm) {
config("libdrm_config") {
# TODO(thomasanderson): Remove this hack once
# https://patchwork.kernel.org/patch/10545295/ lands.
defines = [ "typeof(x)=__typeof__(x)" ]
# Define _GNU_SOURCE for vasprintf use in xf86drm.c
defines = [ "_GNU_SOURCE" ]
include_dirs = [
"src",
"src/include",
......
......@@ -16,10 +16,6 @@ if (!use_system_libwayland) {
"include/protocol",
"src/src",
]
# TODO(thomasanderson): Remove this once
# https://patchwork.freedesktop.org/patch/242086/ lands.
cflags = [ "-Wno-macro-redefined" ]
}
static_library("wayland_util") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment