VirtualBox

Ticket #18624 (new defect)

Opened 2 years ago

Last modified 2 years ago

Vbox 6.0.6 build failure on Linux with gcc 9.1.0

Reported by: berolinux Owned by:
Component: other Version: VirtualBox 6.0.6
Keywords: Cc:
Guest type: other Host type: Linux

Description (last modified by klaus) (diff)

Building vbox 6.0.6 on Linux with gcc 9.1.0 results in

kBuild: Compiling VBoxSVC - /home/bero/abf/virtualbox/BUILD/VirtualBox-6.0.6/src/VBox/Main/src-server/PerformanceImpl.cpp
/usr/include/c++/9.1.0/limits: In static member function ‘static constexpr double std::numeric_limits<double>::max()’:
/usr/include/c++/9.1.0/limits:1743:44: error: unable to find numeric literal operator ‘operator""-0.0L’
 1743 |       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
      |                                            ^~~~~~~~~~~
/usr/include/c++/9.1.0/limits:1743:44: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes
In file included from /usr/include/c++/9.1.0/bits/uniform_int_dist.h:35,
                 from /usr/include/c++/9.1.0/bits/stl_algo.h:66,
                 from /usr/include/c++/9.1.0/algorithm:62,
                 from /home/bero/abf/virtualbox/BUILD/VirtualBox-6.0.6/src/VBox/Main/src-server/PerformanceImpl.cpp:44:
/usr/include/c++/9.1.0/limits:1743:57: error: body of ‘constexpr’ function ‘static constexpr double std::numeric_limits<double>::max()’ not a return-statement
 1743 |       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
      |                                                         ^
/usr/include/c++/9.1.0/limits: In static member function ‘static constexpr double std::numeric_limits<double>::lowest()’:
/usr/include/c++/9.1.0/limits:1747:35: error: unable to find numeric literal operator ‘operator""-0.0L’
 1747 |       lowest() noexcept { return -__DBL_MAX__; }
      |                                   ^~~~~~~~~~~
/usr/include/c++/9.1.0/limits:1747:35: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes
/usr/include/c++/9.1.0/limits:1747:48: error: body of ‘constexpr’ function ‘static constexpr double std::numeric_limits<double>::lowest()’ not a return-statement
 1747 |       lowest() noexcept { return -__DBL_MAX__; }
      |                                                ^
kmk: *** [/home/bero/abf/virtualbox/BUILD/VirtualBox-6.0.6/kBuild/footer-pass2-compiling-targets.kmk:277: /home/bero/abf/virtualbox/BUILD/VirtualBox-6.0.6/out/linux.amd64/release/obj/VBoxSVC/src-server/PerformanceImpl.o] Error 1

While the error message looks like a problem in <limits> itself, the limits header works perfectly elsewhere (may be related to PCH usage in vbox?)

Change History

comment:1 Changed 2 years ago by berolinux

As expected, the problem is with PCH -- Workaround: VBOX_WITHOUT_PRECOMPILED_HEADERS := 1

While certainly not the best fix, this should help people with gcc 9 get going.

comment:2 Changed 2 years ago by klaus

An IRC user reports that modified build options are the root cause. -D_FORTIFY_SOURCE=2 is required to cause the error. But -D_FORTIFY_SOURCE=1 or =0 or not defining it actually works ok.

comment:3 Changed 2 years ago by klaus

  • Description modified (diff)
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use