Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55395

4.0.23 does not build with gcc 10

    • Fully Compatible
    • ALL
    • v4.9, v4.4, v4.2, v4.0
    • Service Arch 2021-04-05

      When I build the server 4.0.23 with gcc 10, I get the following error:

      Compiling build/opt/mongo/util/clock_source.o
      In file included from src/mongo/util/clock_source.cpp:33:
      src/mongo/stdx/thread.h: In member function 'void mongo::stdx::support::SigAltStackController::_install() const':
      src/mongo/stdx/thread.h:82:13: error: 'abort' was not declared in this scope
         82 |             abort();
            |             ^~~~~
      src/mongo/stdx/thread.h: In member function 'void mongo::stdx::support::SigAltStackController::_uninstall() const':
      src/mongo/stdx/thread.h:90:13: error: 'abort' was not declared in this scope
         90 |             abort();
            |             ^~~~~
      scons: *** [build/opt/mongo/util/clock_source.o] Error 1
      
      

      Tail of build transcript:

      Compiling build/opt/mongo/db/logical_clock.o
      Compiling build/opt/third_party/gperftools-2.5/src/maybe_threads.o
      Compiling build/opt/mongo/db/repl/always_allow_non_local_writes.o
      Compiling build/opt/third_party/s2/s2regionunion.o
      Compiling build/opt/third_party/icu4c-57.1/source/i18n/numsys.o
      Compiling build/opt/third_party/icu4c-57.1/source/common/uniset_closure.o
      Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid32_nearbyintd.o
      Compiling build/opt/third_party/zlib-1.2.11/inftrees.o
      Compiling build/opt/third_party/gperftools-2.5/src/internal_logging.o
      src/third_party/gperftools-2.5/src/internal_logging.cc: In function 'void tcmalloc::WriteMessage(const char*, int)':
      src/third_party/gperftools-2.5/src/internal_logging.cc:58:8: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)' declared with attribute 'warn_unused_result' [-Wunused-result]
         58 |   write(STDERR_FILENO, msg, length);
            |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Compiling build/opt/third_party/mozjs-45/platform/x86_64/linux/build/Unified_cpp_js_src25.o
      Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid32_ldexp.o
      Compiling build/opt/third_party/icu4c-57.1/source/common/uchar.o
      Compiling build/opt/third_party/icu4c-57.1/source/common/ucnv_cnv.o
      Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_tgamma.o
      Compiling build/opt/mongo/util/itoa.o
      Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid64_to_uint8.o
      Compiling build/opt/mongo/util/net/sock.o
      In member function 'js::TemporaryTypeSet* js::jit::IonBuilder::computeHeapType(const js::TemporaryTypeSet*, jsid)':
      cc1plus: warning: function may return address of local variable [-Wreturn-local-addr]
      In file included from src/third_party/mozjs-45/platform/x86_64/linux/build/Unified_cpp_js_src12.cpp:47:
      src/third_party/mozjs-45/extract/js/src/jit/IonBuilder.cpp:9259:22: note: declared here
       9259 |     TemporaryTypeSet empty;
            |                      ^~~~~
      Compiling build/opt/third_party/mozjs-45/platform/x86_64/linux/build/Unified_cpp_js_src19.o
      Compiling build/opt/third_party/mozjs-45/platform/x86_64/linux/build/Unified_cpp_js_src26.o
      Compiling build/opt/mongo/util/clock_source.o
      In file included from src/mongo/util/clock_source.cpp:33:
      src/mongo/stdx/thread.h: In member function 'void mongo::stdx::support::SigAltStackController::_install() const':
      src/mongo/stdx/thread.h:82:13: error: 'abort' was not declared in this scope
         82 |             abort();
            |             ^~~~~
      src/mongo/stdx/thread.h: In member function 'void mongo::stdx::support::SigAltStackController::_uninstall() const':
      src/mongo/stdx/thread.h:90:13: error: 'abort' was not declared in this scope
         90 |             abort();
            |             ^~~~~
      scons: *** [build/opt/mongo/util/clock_source.o] Error 1
      scons: building terminated because of errors.
      build/opt/mongo/util/clock_source.o failed: Error 1
      
      
      (.2) serene% gcc -v
      Using built-in specs.
      COLLECT_GCC=gcc
      COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
      OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
      OFFLOAD_TARGET_DEFAULT=1
      Target: x86_64-linux-gnu
      Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
      Thread model: posix
      Supported LTO compression algorithms: zlib zstd
      gcc version 10.2.1 20210110 (Debian 10.2.1-6) 
      

      The abort() call appears to have been added in 4.0.21. I successfully built 4.0.19 previously.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: