[riot-notifications] [RIOT-OS/RIOT] build system: add compile-commands target to generate compile_commands.json (#16129)

chrysn notifications at github.com
Mon Apr 12 17:30:44 CEST 2021


I've run some tests with the squashed version and ran into one last issue:

On native with GCC as toolchain, the compile commands contain `["-target", ""]`, which at least bindgen doesn't like (that's the clang based tool I'm using this for; didn't test applicability with others but assume it could cause the same problem). The error message is a nondescript list of options, but "Host vs. target architecture mismatch" is one of them.

The `bin/native/application_saul_example/compile_cmds.txt` file in that situation shows:

```
SRC: main.c
SRC_NO_LTO: 
SRCXX: 
CURDIR: /home/chrysn/git/RIOT-doc-fixes/examples/saul
CFLAGS: -DDEVELHELP -Werror -Wall -Wextra -pedantic -g3 -Og -U_FORTIFY_SOURCE -std=gnu11 -m32 -fstack-protector-all -ffunction-sections -fdata-sections -DDEBUG_ASSERT_VERBOSE -DRIOT_APPLICATION=\"saul_example\" -DBOARD_NATIVE=\"native\" -DRIOT_BOARD=BOARD_NATIVE -DCPU_NATIVE=\"native\" -DRIOT_CPU=CPU_NATIVE -DMCU_NATIVE=\"native\" -DRIOT_MCU=MCU_NATIVE -fwrapv -Wstrict-overflow -fno-common -ffunction-sections -fdata-sections -Wall -Wextra -Wmissing-include-dirs -fno-delete-null-pointer-checks -fdiagnostics-color -Wstrict-prototypes -Wold-style-definition -gz -Wformat=2 -Wformat-overflow -Wformat-truncation -include '/home/chrysn/git/RIOT-doc-fixes/examples/saul/bin/native/riotbuild/riotbuild.h'
LTOFLAGS: 
INCLUDES: -I/home/chrysn/git/RIOT-doc-fixes/core/include -I/home/chrysn/git/RIOT-doc-fixes/drivers/include -I/home/chrysn/git/RIOT-doc-fixes/sys/include -I/home/chrysn/git/RIOT-doc-fixes/boards/native/include -DNATIVE_INCLUDES -I/home/chrysn/git/RIOT-doc-fixes/boards/native/include/ -I/home/chrysn/git/RIOT-doc-fixes/core/include/ -I/home/chrysn/git/RIOT-doc-fixes/drivers/include/ -I/home/chrysn/git/RIOT-doc-fixes/cpu/native/include -I/home/chrysn/git/RIOT-doc-fixes/sys/include -I/home/chrysn/git/RIOT-doc-fixes/cpu/native/include 
CXXFLAGS: -DDEVELHELP -Werror -Wall -Wextra -pedantic -g3 -Og -U_FORTIFY_SOURCE -m32 -fstack-protector-all -ffunction-sections -fdata-sections -DDEBUG_ASSERT_VERBOSE -DRIOT_APPLICATION=\"saul_example\" -DBOARD_NATIVE=\"native\" -DRIOT_BOARD=BOARD_NATIVE -DCPU_NATIVE=\"native\" -DRIOT_CPU=CPU_NATIVE -DMCU_NATIVE=\"native\" -DRIOT_MCU=MCU_NATIVE -fwrapv -Wstrict-overflow -fno-common -ffunction-sections -fdata-sections -Wall -Wextra -Wmissing-include-dirs -fno-delete-null-pointer-checks -fdiagnostics-color -gz -Wformat=2 -Wformat-overflow -Wformat-truncation -include '/home/chrysn/git/RIOT-doc-fixes/examples/saul/bin/native/riotbuild/riotbuild.h' 
CXXINCLUDES: 
CC: gcc
CXX: g++
TARGET_ARCH: 
TARGET_ARCH_LLVM: 
```

In contrast, when building for an nrf52840, it shows:

```
TARGET_ARCH: arm-none-eabi
TARGET_ARCH_LLVM: 
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16129#issuecomment-817908234
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210412/e98b1931/attachment.htm>


More information about the notifications mailing list