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

uzem / repo build fails under EndeavourOS / Arch and Debian Testing Linux #103

Closed
danboid opened this issue Aug 20, 2022 · 4 comments
Closed

Comments

@danboid
Copy link
Contributor

danboid commented Aug 20, 2022

$ make
make -C tools/uzem  DEST_DIR=/home/dan/src/uzebox/bin/
make debug
=================================
Building Debug...
Platform: Unix-LINUX
=================================
g++ -c uzem.cpp -o Debug/uzem.o -I/usr/include/SDL2 -D_REENTRANT -DLINUX -D_GNU_SOURCE=1 -DGUI=1 -DJOY_ANALOG_DEADZONE=8192 -g -MD -MP -MF Debug/uzem.d -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
In file included from avr8.h:33,
                 from uzem.cpp:27:
gdbserver.h:118:58: error: reference to ‘byte’ is ambiguous
  118 |         void avr_core_flash_write_hi8(unsigned int addr, byte val) ;
      |                                                          ^~~~
In file included from /usr/include/c++/12.1.1/bits/stl_algobase.h:61,
                 from /usr/include/c++/12.1.1/vector:60,
                 from avr8.h:29:
/usr/include/c++/12.1.1/bits/cpp_type_traits.h:406:30: note: candidates are: ‘enum class std::byte’
  406 |   enum class byte : unsigned char;
      |                              ^~~~
gdbserver.h:57:17: note:                 ‘typedef uint8_t byte’
   57 | typedef uint8_t byte;
      |                 ^~~~
gdbserver.h:118:58: error: ‘byte’ has not been declared
  118 |         void avr_core_flash_write_hi8(unsigned int addr, byte val) ;
      |                                                          ^~~~
gdbserver.h:119:58: error: reference to ‘byte’ is ambiguous
  119 |         void avr_core_flash_write_lo8(unsigned int addr, byte val) ;
      |                                                          ^~~~
/usr/include/c++/12.1.1/bits/cpp_type_traits.h:406:30: note: candidates are: ‘enum class std::byte’
  406 |   enum class byte : unsigned char;
      |                              ^~~~
gdbserver.h:57:17: note:                 ‘typedef uint8_t byte’
   57 | typedef uint8_t byte;
      |                 ^~~~
gdbserver.h:119:58: error: ‘byte’ has not been declared
  119 |         void avr_core_flash_write_lo8(unsigned int addr, byte val) ;
      |                                                          ^~~~
make[2]: *** [Makefile:283: Debug/uzem.o] Error 1
make[1]: *** [Makefile:264: all] Error 2
make: *** [Makefile:130: tools/uzem] Error 2
@danboid
Copy link
Contributor Author

danboid commented Sep 4, 2022

I have the same problem under Debian Testing with gcc 12.2.0

@danboid danboid changed the title uzem build fails under EOS/Arch Linux uzem build fails under EOS/Arch and Debian Testing Linux Sep 4, 2022
@danboid
Copy link
Contributor Author

danboid commented Sep 4, 2022

uzem can still be successfully built under Debian testing by disabling GDB support:

cd uzebox/tools/uzem 
NOGDB=1 make release

I have tried installing gdb and gdbserver but I still get the same error about byte when I try to build the full repo with GDB enabled as it is by default.

@danboid danboid changed the title uzem build fails under EOS/Arch and Debian Testing Linux uzem / repo build fails under EndeavourOS / Arch and Debian Testing Linux Sep 4, 2022
@danboid
Copy link
Contributor Author

danboid commented Sep 4, 2022

The workaround to get this repo to build except uzem is to comment out line 15 ie

#TOOLS += uzem

in the top Makefile

@artcfox
Copy link
Contributor

artcfox commented Sep 21, 2022

I fixed the build error by renaming the local typedef so it doesn't collide with the name defined by GCC 12 (and I renamed the other local typedefs for consistency). I noticed that I had the same exact build error on my Pinebook Pro running Manjaro ARM, and after I made the change I verified that uzem builds properly. Manjaro ARM doesn't seem to have a package that includes avr-gdb, so I used Debian 11 to verify that the gdbserver inside of uzem still works to debug into Uzebox game code. (Check the commit message for the commands I used to setup a remote debugging session and to set breakpoints in the game code.)

@artcfox artcfox closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants