VirtualBox

Opened 5 years ago

Last modified 5 years ago

#18624 new defect

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 Espenlaub)

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 (3)

comment:1 by berolinux, 5 years ago

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 by Klaus Espenlaub, 5 years ago

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 by Klaus Espenlaub, 5 years ago

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

© 2023 Oracle
ContactPrivacy policyTerms of Use