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

gcc.exe: error: unrecognized command-line option '-mthumb' #593

Open
hamzao95 opened this issue Dec 30, 2024 · 1 comment
Open

gcc.exe: error: unrecognized command-line option '-mthumb' #593

hamzao95 opened this issue Dec 30, 2024 · 1 comment

Comments

@hamzao95
Copy link

I tried compiling the i2c\lcd_1602_i2c example and got the below error, any idea on how I can get around this?

C:\Users-\Documents\pico\pico-examples\build\i2c\lcd_1602_i2c>mingw32-make
PICO_SDK_PATH is C:/Users/-/Downloads/pico-sdk-master (1)/pico-sdk
Target board (PICO_BOARD) is 'pico'.
Using board configuration from C:/Users/-/Downloads/pico-sdk-master (1)/pico-sdk/src/boards/include/boards/pico.h
Pico Platform (PICO_PLATFORM) is 'rp2040'.
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/VSARM/mingw/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/VSARM/mingw/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"C:/VSARM/mingw/mingw64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'

Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 C:/VSARM/mingw/mingw64/bin/mingw32-make.exe -f Makefile cmTC_34270/fast
mingw32-make[1]: Entering directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
C:/VSARM/mingw/mingw64/bin/mingw32-make.exe  -f CMakeFiles\cmTC_34270.dir\build.make CMakeFiles/cmTC_34270.dir/build
mingw32-make[2]: Entering directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
Building C object CMakeFiles/cmTC_34270.dir/testCCompiler.c.obj
C:\VSARM\mingw\mingw64\bin\gcc.exe   -mcpu=cortex-m0plus -mthumb  -o CMakeFiles\cmTC_34270.dir\testCCompiler.c.obj -c C:\Users\-\Documents\pico\pico-examples\build\CMakeFiles\CMakeScratch\TryCompile-cjdk0h\testCCompiler.c
gcc.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc.exe: error: unrecognized command-line option '-mthumb'
mingw32-make[2]: *** [CMakeFiles\cmTC_34270.dir\build.make:80: CMakeFiles/cmTC_34270.dir/testCCompiler.c.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
mingw32-make[1]: *** [Makefile:132: cmTC_34270/fast] Error 2
mingw32-make[1]: Leaving directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)

-- Configuring incomplete, errors occurred!
mingw32-make: *** [Makefile:1520: cmake_check_build_system] Error 1

@lurch
Copy link
Contributor

lurch commented Jan 1, 2025

It sounds like something's gone a bit screwy with your compiler setup under mingw - you seem to have both C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe and also C:/VSARM/mingw/mingw64/bin/gcc.exe. It seems to be the latter which isn't happy with the -mcpu=cortex-m0plus -mthumb options, but normally you'd expect these to be passed to arm-none-eabi-gcc.exe.
Can you provide the output of C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe -v and C:/VSARM/mingw/mingw64/bin/gcc.exe please?

Are you running Windows on an ARM processor?

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