Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
7 tasks done
slam-bert opened this issue Jul 30, 2024 · 1 comment
Open
7 tasks done

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

slam-bert opened this issue Jul 30, 2024 · 1 comment
Labels

Comments

@slam-bert
Copy link

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.
@slam-bert slam-bert added the bug label Jul 30, 2024
@Shoegzer
Copy link
Contributor

Shoegzer commented Aug 5, 2024

It's failing to build here too, on Linux Mint 22, which uses the Ubuntu 24.04 base. However, it fails earlier than cxxopts, with errors such as the following:

../../contrib/libzip/mkstemp.c: In function ‘_zip_mkstemp’:
../../contrib/libzip/mkstemp.c:76:15: error: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
   76 |         pid = getpid();
      |               ^~~~~~
lbitlib.c
make[2]: *** [zip-lib.make:303: obj/Release/zip-lib/mkstemp.o] Error 1
make[1]: *** [Makefile:74: zip-lib] Error 2
make[1]: *** Waiting for unfinished jobs....

This is related to gcc-14 pickiness, as explained here. I'm guessing you're using gcc-13 or below.

Here's my full build.log: xenia_build_log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants