From 6eeea77a7c882d7e134dee900d13328e6ab1c079 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 11 Jun 2020 21:48:10 +0100 Subject: [PATCH] Stop defining _GLIBCXX_USE_C99 (#4981) This is an internal macro defined by libstdc++ to record the result of configure checks done when GCC was built. Defining (or undefining or redefining) the macro yourself results in undefined behaviour. If the system's C library doesn't expose support for C99 or 'long long' then telling libstdc++ that it does isn't going to work. It will just mean libstdc++ tries to use features that don't actually exist in the C library. In any case, systems that don't support C99 are probably not relevant to anybody nowadays. Fixes #4975 --- src/CMakeLists.txt | 2 +- xs/Build.PL | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ebe106d3..06fac38b1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,7 @@ option(PROFILE "Build with gprof profiling output." OFF) option(COVERAGE "Build with gcov code coverage profiling." OFF) # only on newer GCCs: -ftemplate-backtrace-limit=0 -add_compile_options(-DNO_PERL -DM_PI=3.14159265358979323846 -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE) +add_compile_options(-DNO_PERL -DM_PI=3.14159265358979323846 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE) if (MSVC) add_compile_options(-W3) diff --git a/xs/Build.PL b/xs/Build.PL index 63f8308d4..35356b873 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -15,11 +15,10 @@ my $linux = $^O eq 'linux'; # prevent an annoying concatenation warning by Devel::CheckLib $ENV{LD_RUN_PATH} //= ""; -# _GLIBCXX_USE_C99 : to get the long long type for g++ # HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC # NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace # BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339 -my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -Dexprtk_disable_rtl_io_file -Dexprtk_disable_return_statement -Dexprtk_disable_rtl_vecops -Dexprtk_disable_string_capabilities -Dexprtk_disable_enhanced_features); +my @cflags = qw(-DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -Dexprtk_disable_rtl_io_file -Dexprtk_disable_return_statement -Dexprtk_disable_rtl_vecops -Dexprtk_disable_string_capabilities -Dexprtk_disable_enhanced_features); push @cflags, "-DSLIC3R_BUILD_COMMIT=$ENV{SLIC3R_GIT_VERSION}" if defined $ENV{SLIC3R_GIT_VERSION}; # std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0