I have a new Apple M2 MacBook Pro issued by my new job on which our toolchain requires the use of GDB. Since GDB is not pre compiled for Apple Silicon, I have attempted to compile the GDB as a Cross-debugger for a new ARM® Cortex®-M33-based SoC. I have followed a few examples from other users who have successfully compiled on there M1 CPUs; however, I cannot get past compiler warnings that are flagging as errors, even when applying "-Wno-..." flags to disable them. I have started editing my local copy of the GDB repo to work through the errors, but some of them have no easy answer, such as this:
/Applications/gdb-12.1/sim/arm/../common/sim-utils.c:157:24: error: format string is not a string literal [-Werror,-Wformat-nonliteral] sim_io_evprintf (sd, fmt, ap); ^~~
Currently using build in gcc: Apple clang version 14.0.0 (clang-1400.0.29.202) Target: arm64-apple-darwin21.6.0 Thread model: posix
I am attempting to build gdb-12.1
Is there a different compiler, or specific options, that I can try instead?
Started with a simple, manual compilation per the README: Opened the terminal:
- "./configure arm-none-eabi"
- "make"
I did expect some errors there. After finding forums from others who had done this, I tried the following:
- "CFLAGS=-Wno-format-nonliteral"
- "./configure arm-none-eabi"
- "make"
I was expecting the compiler to ignore the warning with that, but that failed.