Skip to content

Building cxxopts no longer works on Linux (Ubuntu 24.04) #2275

@slam-bert

Description

@slam-bert

Validation

Describe what's going wrong

When compiling the latest commit of Xenia on Linux as of this post (3d30b2e), building cxxopts fails with multiple of the same error.

I was able to resolve the errors by replacing
if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
with
if (u > static_cast<U>((std::numeric_limits<T>::min)()))
in cxxopts.hpp.
I got this fix from the latest cxxopts commit as of posting (2ad116a).

If possible, could this fix be somehow implemented?

Describe what should happen

cxxopts should compile just fine.

If applicable, provide a callstack here, especially for crashes

No response

If applicable, upload a logfile and link it here

Building debug...

- running premake...
Building configurations...
    Baking aes_128...
    Baking capstone...
    Baking dxbc...
    Baking discord-rpc...
    Baking cxxopts...
    Baking cpptoml...
    Baking libavcodec...
    Baking libavutil...
    Baking fmt...
    Baking glslang-spirv...
    Baking imgui...
    Baking mspack...
    Baking snappy...
    Baking xxhash...
    Baking xenia-core...
    Baking xenia-app...
    Baking xenia-app-discord...
    Baking xenia-apu...
    Baking xenia-apu-nop...
    Baking xenia-base...
    Baking xenia-base-tests...
    Baking xenia-cpu...
    Baking xenia-cpu-tests...
    Baking xenia-cpu-ppc-tests...
    Baking xenia-cpu-backend-x64...
    Baking xenia-debug-ui...
    Baking xenia-gpu...
    Baking xenia-gpu-shader-compiler...
    Baking xenia-gpu-null...
    Baking xenia-gpu-vulkan...
    Baking xenia-gpu-vulkan-trace-viewer...
    Baking xenia-gpu-vulkan-trace-dump...
    Baking xenia-hid...
    Baking xenia-hid-demo...
    Baking xenia-hid-nop...
    Baking xenia-kernel...
    Baking xenia-ui...
    Baking xenia-ui-vulkan...
    Baking xenia-ui-window-vulkan-demo...
    Baking xenia-vfs...
    Baking xenia-vfs-dump...
    Baking xenia-vfs-tests...
    Baking xenia-apu-sdl...
    Baking xenia-helper-sdl...
    Baking xenia-hid-sdl...
Running action 'gmake2'...
Done (1204ms).

- building (all):debug...
make: Entering directory '/home/brt/Downloads/xenia/build'
==== Building aes_128 (debug_linux) ====
==== Building capstone (debug_linux) ====
==== Building dxbc (debug_linux) ====
==== Building discord-rpc (debug_linux) ====
==== Building cxxopts (debug_linux) ====
==== Building cpptoml (debug_linux) ====
==== Building libavutil (debug_linux) ====
==== Building fmt (debug_linux) ====
==== Building glslang-spirv (debug_linux) ====
==== Building imgui (debug_linux) ====
==== Building xenia-base (debug_linux) ====
==== Building snappy (debug_linux) ====
==== Building xxhash (debug_linux) ====
==== Building xenia-app-discord (debug_linux) ====
==== Building xenia-helper-sdl (debug_linux) ====
clock.cc
clock_posix.cc
clock_x64.cc
cvar.cc
In file included from ../src/xenia/base/clock_x64.cc:10:
In file included from ../src/xenia/base/clock.h:16:
In file included from ../src/xenia/base/cvar.h:19:
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -2147483648 with type 'int' [-Werror,-Winteger-overflow]
In file included from ../src/xenia/base/clock_posix.cc:13:
  In file included from 488../src/xenia/base/clock.h | : 16 :
 In file included from  ../src/xenia/base/cvar.h : 19 :
  ../third_party/cxxopts/include/cxxopts.hpp : 488 if (u: 36>:  staerror: ticoverflow in expression; result is -2147483648 with type 'int' [-Werror,-Winteger-overflow]_c
ast<U>(-(std::n  u488m | e r i c _ l i m i t s < Ti>f: :(mui n>) (s)t)a)ti
c      _| ca                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~s
t<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -9223372036854775808 with type 'long' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -9223372036854775808 with type 'long' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/xenia/base/clock.cc:10:
In file included from ../src/xenia/base/clock.h:16:
In file included from ../src/xenia/base/cvar.h:19:
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -2147483648 with type 'int' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -9223372036854775808 with type 'long' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/xenia/base/cvar.cc:10:
In file included from ../src/xenia/base/cvar.h:19:
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -2147483648 with type 'int' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/cxxopts/include/cxxopts.hpp:488:36: error: overflow in expression; result is -9223372036854775808 with type 'long' [-Werror,-Winteger-overflow]
  488 |             if (u > static_cast<U>(-(std::numeric_limits<T>::min)()))
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
2 errors generated.
make[1]: *** [xenia-base.make:249: obj/Linux/Debug/Linux/Debug/xenia-base/clock_posix.o] Error 1
make[1]: *** Waiting for unfinished jobs....
==== Building libavcodec (debug_linux) ====
make[1]: *** [xenia-base.make:252: obj/Linux/Debug/Linux/Debug/xenia-base/clock_x64.o] Error 1
2 errors generated.
make[1]: *** [xenia-base.make:246: obj/Linux/Debug/Linux/Debug/xenia-base/clock.o] Error 1
2 errors generated.
make[1]: *** [xenia-base.make:258: obj/Linux/Debug/Linux/Debug/xenia-base/cvar.o] Error 1
make: *** [Makefile:287: xenia-base] Error 2
make: Leaving directory '/home/brt/Downloads/xenia/build'

ERROR: build failed with one or more errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions