From cbdf132edf885adfcc527f0f1cb40df29e089c14 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 14 Jun 2018 00:53:15 +0200 Subject: Skeleton of libcxxabi's usage. --- .gitmodules | 8 ++++ Makefile | 50 +++++++++++++++++++++- build.yaml | 30 +++++++++++++ grpc.gyp | 26 +++++++++++ templates/Makefile.template | 5 +++ third_party/libcxx | 1 + third_party/libcxxabi | 1 + tools/run_tests/generated/sources_and_headers.json | 10 +++++ 8 files changed, 130 insertions(+), 1 deletion(-) create mode 160000 third_party/libcxx create mode 160000 third_party/libcxxabi diff --git a/.gitmodules b/.gitmodules index 52db29be00..afde4d34f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,11 @@ [submodule "third_party/abseil-cpp"] path = third_party/abseil-cpp url = https://github.com/abseil/abseil-cpp +[submodule "third_party/libcxxabi"] + path = third_party/libcxxabi + url = https://github.com/llvm-mirror/libcxxabi.git + branch = release_60 +[submodule "third_party/libcxx"] + path = third_party/libcxx + url = https://github.com/llvm-mirror/libcxx.git + branch = release_60 diff --git a/Makefile b/Makefile index 1247566ffe..a1abc5e868 100644 --- a/Makefile +++ b/Makefile @@ -1372,7 +1372,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc @@ -2847,6 +2847,11 @@ $(OBJDIR)/$(CONFIG)/%.o : %.cc $(Q) mkdir -p `dirname $@` $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< +$(OBJDIR)/$(CONFIG)/%.o : %.cpp + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + install: install_c install_cxx install-plugins install-certs install_c: install-headers_c install-static_c install-shared_c @@ -3161,6 +3166,49 @@ endif endif +LIBCXXABI_SRC = \ + third_party/libcxxabi/src/abort_message.cpp \ + third_party/libcxxabi/src/cxa_aux_runtime.cpp \ + third_party/libcxxabi/src/cxa_default_handlers.cpp \ + third_party/libcxxabi/src/cxa_demangle.cpp \ + third_party/libcxxabi/src/cxa_exception_storage.cpp \ + third_party/libcxxabi/src/cxa_guard.cpp \ + third_party/libcxxabi/src/cxa_handlers.cpp \ + third_party/libcxxabi/src/cxa_noexception.cpp \ + third_party/libcxxabi/src/cxa_thread_atexit.cpp \ + third_party/libcxxabi/src/cxa_unexpected.cpp \ + third_party/libcxxabi/src/cxa_vector.cpp \ + third_party/libcxxabi/src/cxa_virtual.cpp \ + third_party/libcxxabi/src/fallback_malloc.cpp \ + third_party/libcxxabi/src/private_typeinfo.cpp \ + third_party/libcxxabi/src/stdlib_exception.cpp \ + third_party/libcxxabi/src/stdlib_new_delete.cpp \ + third_party/libcxxabi/src/stdlib_stdexcept.cpp \ + third_party/libcxxabi/src/stdlib_typeinfo.cpp \ + +PUBLIC_HEADERS_C += \ + +LIBCXXABI_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBCXXABI_SRC)))) + +$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include -Wno-unused-but-set-variable -Wno-c++14-compat -fvisibility=hidden + +$(LIBDIR)/$(CONFIG)/libcxxabi.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBCXXABI_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/libcxxabi.a + $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBCXXABI_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libcxxabi.a +endif + + + + +ifneq ($(NO_DEPS),true) +-include $(LIBCXXABI_OBJS:.o=.dep) +endif + + LIBGPR_SRC = \ src/core/lib/gpr/alloc.cc \ src/core/lib/gpr/arena.cc \ diff --git a/build.yaml b/build.yaml index 16c90fbd4c..17a2ebcdfe 100644 --- a/build.yaml +++ b/build.yaml @@ -1359,6 +1359,32 @@ libs: deps: - grpc secure: true +- name: cxxabi + build: private + language: c + src: + - third_party/libcxxabi/src/abort_message.cpp + - third_party/libcxxabi/src/cxa_aux_runtime.cpp + - third_party/libcxxabi/src/cxa_default_handlers.cpp + - third_party/libcxxabi/src/cxa_demangle.cpp + - third_party/libcxxabi/src/cxa_exception_storage.cpp + - third_party/libcxxabi/src/cxa_guard.cpp + - third_party/libcxxabi/src/cxa_handlers.cpp + - third_party/libcxxabi/src/cxa_noexception.cpp + - third_party/libcxxabi/src/cxa_thread_atexit.cpp + - third_party/libcxxabi/src/cxa_unexpected.cpp + - third_party/libcxxabi/src/cxa_vector.cpp + - third_party/libcxxabi/src/cxa_virtual.cpp + - third_party/libcxxabi/src/fallback_malloc.cpp + - third_party/libcxxabi/src/private_typeinfo.cpp + - third_party/libcxxabi/src/stdlib_exception.cpp + - third_party/libcxxabi/src/stdlib_new_delete.cpp + - third_party/libcxxabi/src/stdlib_stdexcept.cpp + - third_party/libcxxabi/src/stdlib_typeinfo.cpp + build_system: + - Makefile + defaults: cxxabi + secure: false - name: gpr build: all language: c @@ -5608,6 +5634,10 @@ defaults: CPPFLAGS: -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX CXXFLAGS: -fno-rtti -fno-exceptions + cxxabi: + CPPFLAGS: -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS + -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include -Wno-unused-but-set-variable + -Wno-c++14-compat -fvisibility=hidden global: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 diff --git a/grpc.gyp b/grpc.gyp index 2ceae3fe36..43e2485289 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -178,6 +178,32 @@ 'test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc', ], }, + { + 'target_name': 'cxxabi', + 'type': 'static_library', + 'dependencies': [ + ], + 'sources': [ + 'third_party/libcxxabi/src/abort_message.cpp', + 'third_party/libcxxabi/src/cxa_aux_runtime.cpp', + 'third_party/libcxxabi/src/cxa_default_handlers.cpp', + 'third_party/libcxxabi/src/cxa_demangle.cpp', + 'third_party/libcxxabi/src/cxa_exception_storage.cpp', + 'third_party/libcxxabi/src/cxa_guard.cpp', + 'third_party/libcxxabi/src/cxa_handlers.cpp', + 'third_party/libcxxabi/src/cxa_noexception.cpp', + 'third_party/libcxxabi/src/cxa_thread_atexit.cpp', + 'third_party/libcxxabi/src/cxa_unexpected.cpp', + 'third_party/libcxxabi/src/cxa_vector.cpp', + 'third_party/libcxxabi/src/cxa_virtual.cpp', + 'third_party/libcxxabi/src/fallback_malloc.cpp', + 'third_party/libcxxabi/src/private_typeinfo.cpp', + 'third_party/libcxxabi/src/stdlib_exception.cpp', + 'third_party/libcxxabi/src/stdlib_new_delete.cpp', + 'third_party/libcxxabi/src/stdlib_stdexcept.cpp', + 'third_party/libcxxabi/src/stdlib_typeinfo.cpp', + ], + }, { 'target_name': 'gpr', 'type': 'static_library', diff --git a/templates/Makefile.template b/templates/Makefile.template index 43fa904768..cb8a85ba0a 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -1273,6 +1273,11 @@ $(Q) mkdir -p `dirname $@` $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + $(OBJDIR)/$(CONFIG)/%.o : %.cpp + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + install: install_c install_cxx install-plugins install-certs install_c: install-headers_c install-static_c install-shared_c diff --git a/third_party/libcxx b/third_party/libcxx new file mode 160000 index 0000000000..6599cac096 --- /dev/null +++ b/third_party/libcxx @@ -0,0 +1 @@ +Subproject commit 6599cac0965be8e5a835ab7a5684bbef033d5ad0 diff --git a/third_party/libcxxabi b/third_party/libcxxabi new file mode 160000 index 0000000000..9245d481eb --- /dev/null +++ b/third_party/libcxxabi @@ -0,0 +1 @@ +Subproject commit 9245d481eb3e890f708ff2d7dadf2a10c04748ba diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 0af4e19a1a..bdc6cc101c 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -6826,6 +6826,16 @@ "third_party": false, "type": "lib" }, + { + "deps": [], + "headers": [], + "is_filegroup": false, + "language": "c", + "name": "cxxabi", + "src": [], + "third_party": false, + "type": "lib" + }, { "deps": [ "gpr_base" -- cgit v1.2.3 From 1813ed94a7da954d8b7f870a730ad7e9550861ff Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 19 Jun 2018 01:02:48 +0200 Subject: Fixing sanity check. --- tools/run_tests/sanity/check_submodules.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 6362afd289..4fe1aa8450 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -26,16 +26,18 @@ want_submodules=$(mktemp /tmp/submXXXXXX) git submodule | awk '{ print $1 }' | sort > "$submodules" cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" + cc4bed2d74f7c8717e31f9579214ab52a9c9c610 third_party/abseil-cpp (cc4bed2) 5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8 third_party/benchmark (v1.2.0) - 70ef9596bbcc11353b9bb8d4e91478694dd21439 third_party/boringssl (fips-20170615-704-g70ef9596) - dcd3e6e6ecddf059adb48fca45bc7346a108bdd9 third_party/boringssl-with-bazel (version_for_cocoapods_10.0-369-gdcd3e6e6) - 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0) + 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty (remotes/origin/wide-14-g73594cd) + 70ef9596bbcc11353b9bb8d4e91478694dd21439 third_party/boringssl (fips-20170615-704-g70ef959) + dcd3e6e6ecddf059adb48fca45bc7346a108bdd9 third_party/boringssl-with-bazel (version_for_cocoapods_10.0-369-gdcd3e6e) + 3be1924221e1326df520f8498d704a5c4c8d0cce third_party/cares/cares (cares-1_13_0) + 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0-5-g30dbc81) ec44c6c1675c25b9827aacd08c02433cccde7780 third_party/googletest (release-1.8.0) - b5fbb742af122b565925987e65c08957739976a7 third_party/protobuf (v3.5.2) + 6599cac0965be8e5a835ab7a5684bbef033d5ad0 third_party/libcxx (heads/release_60) + 9245d481eb3e890f708ff2d7dadf2a10c04748ba third_party/libcxxabi (heads/release_60) + b5fbb742af122b565925987e65c08957739976a7 third_party/protobuf (v3.3.1-641-gb5fbb74) cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) - 3be1924221e1326df520f8498d704a5c4c8d0cce third_party/cares/cares (cares-1_13_0) - 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty - cc4bed2d74f7c8717e31f9579214ab52a9c9c610 third_party/abseil-cpp EOF diff -u "$submodules" "$want_submodules" -- cgit v1.2.3 From fe62844cc0f37dc466291b756614e310b8bcb2f0 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 22 Jun 2018 19:44:18 +0200 Subject: Not all compilers... --- Makefile | 14 +++++++++++++- build.yaml | 4 ++-- templates/Makefile.template | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a1abc5e868..b87692ce08 100644 --- a/Makefile +++ b/Makefile @@ -318,6 +318,18 @@ ifeq ($(HAS_WORKING_NO_SHIFT_NEGATIVE_VALUE),true) W_NO_SHIFT_NEGATIVE_VALUE=-Wno-shift-negative-value NO_W_NO_SHIFT_NEGATIVE_VALUE=-Wshift-negative-value endif +CHECK_NO_C++14_COMPAT_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.c +HAS_WORKING_NO_C++14_COMPAT = $(shell $(CHECK_NO_C++14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) +ifeq ($(HAS_WORKING_NO_C++14_COMPAT),true) +W_NO_C++14_COMPAT=-Wno-c++14-compat +NO_W_NO_C++14_COMPAT=-Wc++14-compat +endif +CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-unused-but-set-variable -o $(TMPOUT) -c test/build/no-unused-but-set-variable.c +HAS_WORKING_NO_UNUSED_BUT_SET_VARIABLE = $(shell $(CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD) 2> /dev/null && echo true || echo false) +ifeq ($(HAS_WORKING_NO_UNUSED_BUT_SET_VARIABLE),true) +W_NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable +NO_W_NO_UNUSED_BUT_SET_VARIABLE=-Wunused-but-set-variable +endif # The HOST compiler settings are used to compile the protoc plugins. # In most cases, you won't have to change anything, but if you are @@ -3190,7 +3202,7 @@ PUBLIC_HEADERS_C += \ LIBCXXABI_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBCXXABI_SRC)))) -$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include -Wno-unused-but-set-variable -Wno-c++14-compat -fvisibility=hidden +$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) $(W_NO_C++14_COMPAT) -fvisibility=hidden $(LIBDIR)/$(CONFIG)/libcxxabi.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBCXXABI_OBJS) $(E) "[AR] Creating $@" diff --git a/build.yaml b/build.yaml index 17a2ebcdfe..490d479269 100644 --- a/build.yaml +++ b/build.yaml @@ -5636,8 +5636,8 @@ defaults: CXXFLAGS: -fno-rtti -fno-exceptions cxxabi: CPPFLAGS: -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS - -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include -Wno-unused-but-set-variable - -Wno-c++14-compat -fvisibility=hidden + -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) + $(W_NO_C++14_COMPAT) -fvisibility=hidden global: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 diff --git a/templates/Makefile.template b/templates/Makefile.template index cb8a85ba0a..8082ca9afb 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -37,7 +37,7 @@ # warnings we'd like, but that dont exist in all compilers PREFERRED_WARNINGS=['shadow', 'extra-semi'] - CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value'] + CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-c++14-compat', 'no-unused-but-set-variable'] def warning_var(fmt, warning): return fmt % warning.replace('-', '_').upper() -- cgit v1.2.3 From fae0d95d2b48e9cdc9810ac90586251fcc8c548b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 22 Jun 2018 19:55:02 +0200 Subject: Missing test files. --- test/build/no-c++14-compat.c | 19 +++++++++++++++++++ test/build/no-unused-but-set-variable.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/build/no-c++14-compat.c create mode 100644 test/build/no-unused-but-set-variable.c diff --git a/test/build/no-c++14-compat.c b/test/build/no-c++14-compat.c new file mode 100644 index 0000000000..0c1771c7bb --- /dev/null +++ b/test/build/no-c++14-compat.c @@ -0,0 +1,19 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +int main(void) {} diff --git a/test/build/no-unused-but-set-variable.c b/test/build/no-unused-but-set-variable.c new file mode 100644 index 0000000000..0c1771c7bb --- /dev/null +++ b/test/build/no-unused-but-set-variable.c @@ -0,0 +1,19 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +int main(void) {} -- cgit v1.2.3 From c6ed823ef7f1b1b4254110aef5f0a30bf101fe4a Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 23 Jun 2018 10:22:49 +0200 Subject: + -> X --- Makefile | 12 ++++++------ build.yaml | 2 +- templates/Makefile.template | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b87692ce08..f4025011c1 100644 --- a/Makefile +++ b/Makefile @@ -318,11 +318,11 @@ ifeq ($(HAS_WORKING_NO_SHIFT_NEGATIVE_VALUE),true) W_NO_SHIFT_NEGATIVE_VALUE=-Wno-shift-negative-value NO_W_NO_SHIFT_NEGATIVE_VALUE=-Wshift-negative-value endif -CHECK_NO_C++14_COMPAT_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.c -HAS_WORKING_NO_C++14_COMPAT = $(shell $(CHECK_NO_C++14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) -ifeq ($(HAS_WORKING_NO_C++14_COMPAT),true) -W_NO_C++14_COMPAT=-Wno-c++14-compat -NO_W_NO_C++14_COMPAT=-Wc++14-compat +CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.c +HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) +ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) +W_NO_CXX14_COMPAT=-Wno-c++14-compat +NO_W_NO_CXX14_COMPAT=-Wc++14-compat endif CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-unused-but-set-variable -o $(TMPOUT) -c test/build/no-unused-but-set-variable.c HAS_WORKING_NO_UNUSED_BUT_SET_VARIABLE = $(shell $(CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD) 2> /dev/null && echo true || echo false) @@ -3202,7 +3202,7 @@ PUBLIC_HEADERS_C += \ LIBCXXABI_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBCXXABI_SRC)))) -$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) $(W_NO_C++14_COMPAT) -fvisibility=hidden +$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) $(W_NO_CXX14_COMPAT) -fvisibility=hidden $(LIBDIR)/$(CONFIG)/libcxxabi.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBCXXABI_OBJS) $(E) "[AR] Creating $@" diff --git a/build.yaml b/build.yaml index 490d479269..30722b4b87 100644 --- a/build.yaml +++ b/build.yaml @@ -5637,7 +5637,7 @@ defaults: cxxabi: CPPFLAGS: -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) - $(W_NO_C++14_COMPAT) -fvisibility=hidden + $(W_NO_CXX14_COMPAT) -fvisibility=hidden global: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 diff --git a/templates/Makefile.template b/templates/Makefile.template index 8082ca9afb..afab229fae 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -40,7 +40,7 @@ CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-c++14-compat', 'no-unused-but-set-variable'] def warning_var(fmt, warning): - return fmt % warning.replace('-', '_').upper() + return fmt % warning.replace('-', '_').replace('+', 'X').upper() def neg_warning(warning): if warning[0:3] == 'no-': -- cgit v1.2.3 From b71da61dd16b73ff1f12056ad418f31900ae8f8f Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 24 Jun 2018 21:56:32 +0200 Subject: c++14-compat is c++ only. --- Makefile | 15 ++++++++------- build.yaml | 3 ++- templates/Makefile.template | 8 +++++++- test/build/no-c++14-compat.c | 19 ------------------- test/build/no-c++14-compat.cc | 19 +++++++++++++++++++ 5 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 test/build/no-c++14-compat.c create mode 100644 test/build/no-c++14-compat.cc diff --git a/Makefile b/Makefile index f4025011c1..76a8d7ec00 100644 --- a/Makefile +++ b/Makefile @@ -300,6 +300,12 @@ else TMPOUT = `mktemp /tmp/test-out-XXXXXX` endif +CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c++11 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.cc +HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) +ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) +W_NO_CXX14_COMPAT=-Wno-c++14-compat +endif + CHECK_SHADOW_WORKS_CMD = $(CC) -std=c99 -Werror -Wshadow -o $(TMPOUT) -c test/build/shadow.c HAS_WORKING_SHADOW = $(shell $(CHECK_SHADOW_WORKS_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_WORKING_SHADOW),true) @@ -318,12 +324,6 @@ ifeq ($(HAS_WORKING_NO_SHIFT_NEGATIVE_VALUE),true) W_NO_SHIFT_NEGATIVE_VALUE=-Wno-shift-negative-value NO_W_NO_SHIFT_NEGATIVE_VALUE=-Wshift-negative-value endif -CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.c -HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) -ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) -W_NO_CXX14_COMPAT=-Wno-c++14-compat -NO_W_NO_CXX14_COMPAT=-Wc++14-compat -endif CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-unused-but-set-variable -o $(TMPOUT) -c test/build/no-unused-but-set-variable.c HAS_WORKING_NO_UNUSED_BUT_SET_VARIABLE = $(shell $(CHECK_NO_UNUSED_BUT_SET_VARIABLE_WORKS_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_WORKING_NO_UNUSED_BUT_SET_VARIABLE),true) @@ -3202,7 +3202,8 @@ PUBLIC_HEADERS_C += \ LIBCXXABI_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBCXXABI_SRC)))) -$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) $(W_NO_CXX14_COMPAT) -fvisibility=hidden +$(LIBCXXABI_OBJS): CPPFLAGS += -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) -fvisibility=hidden +$(LIBCXXABI_OBJS): CXXFLAGS += $(W_NO_CXX14_COMPAT) $(LIBDIR)/$(CONFIG)/libcxxabi.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBCXXABI_OBJS) $(E) "[AR] Creating $@" diff --git a/build.yaml b/build.yaml index 30722b4b87..1c6c98ff09 100644 --- a/build.yaml +++ b/build.yaml @@ -5637,7 +5637,8 @@ defaults: cxxabi: CPPFLAGS: -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_NO_EXCEPTIONS -Ithird_party/libcxxabi/include -nostdinc++ -Ithird_party/libcxx/include $(W_NO_UNUSED_BUT_SET_VARIABLE) - $(W_NO_CXX14_COMPAT) -fvisibility=hidden + -fvisibility=hidden + CXXFLAGS: $(W_NO_CXX14_COMPAT) global: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 diff --git a/templates/Makefile.template b/templates/Makefile.template index afab229fae..caf6c12646 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -37,7 +37,7 @@ # warnings we'd like, but that dont exist in all compilers PREFERRED_WARNINGS=['shadow', 'extra-semi'] - CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-c++14-compat', 'no-unused-but-set-variable'] + CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable'] def warning_var(fmt, warning): return fmt % warning.replace('-', '_').replace('+', 'X').upper() @@ -191,6 +191,12 @@ TMPOUT = `mktemp /tmp/test-out-XXXXXX` endif + CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c++11 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.cc + HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) + ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) + W_NO_CXX14_COMPAT=-Wno-c++14-compat + endif + %for warning in CHECK_WARNINGS: ${warning_var('CHECK_%s_WORKS_CMD', warning)} = $(CC) -std=c99 -Werror -W${warning} -o $(TMPOUT) -c test/build/${warning}.c ${warning_var('HAS_WORKING_%s', warning)} = $(shell $(${warning_var('CHECK_%s_WORKS_CMD', warning)}) 2> /dev/null && echo true || echo false) diff --git a/test/build/no-c++14-compat.c b/test/build/no-c++14-compat.c deleted file mode 100644 index 0c1771c7bb..0000000000 --- a/test/build/no-c++14-compat.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -int main(void) {} diff --git a/test/build/no-c++14-compat.cc b/test/build/no-c++14-compat.cc new file mode 100644 index 0000000000..0c1771c7bb --- /dev/null +++ b/test/build/no-c++14-compat.cc @@ -0,0 +1,19 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +int main(void) {} -- cgit v1.2.3