apache / mynewt-newt

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
117 stars 96 forks source link

cmake: Fix setting compile flags #400

Closed michal-narajowski closed 4 years ago

michal-narajowski commented 4 years ago

By some recent change in gcc or cmake the compilation flags for sources defined in CMakeLists.txt would get reordered in a way that the first -D flag would come after the last -m flag. As a result we would get a gcc error "Unrecognized command line argument: -mthumb-interwork-DAPP_NAME=" Adding space before the first flag in CMakeLists.txt file fixes the problem.

kasjer commented 4 years ago

Explanation of problem is strange. Can you add example of one line that was generated before and after the fix in CMakeLists.txt Maybe also version of cmake used. And line that fails without fix with

set(CMAKE_VERBOSE_MAKEFILE ON)
michal-narajowski commented 4 years ago

This is a cmake issue probably as I can see this in compile_commands.json produced by cmake. cmake version 3.16.3

Diff on the command:

185c185,186
< -mthumb-interwork-DAPP_NAME=bleprph_memfault
---
> -mthumb-interwork
> -DAPP_NAME=bleprph_memfault
This is an example of a command before the update ```/usr/lib/ccache/arm-none-eabi-gcc -I/home/michaln/Workspace/ble-stats/bin/targets/nrf52pdk_bleprph_memfault/generated/include -I/home/michaln/Workspace/ble-stats/bin/targets/nrf52pdk_bleprph_memfault/user/pre_build/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/include/bleprph_memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/boot/split/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/boot/split/include/split/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/mbedtls/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/tinycrypt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/tinycrypt/include/tinycrypt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/base64/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/base64/include/base64/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/tinycbor/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/tinycbor/include/tinycbor/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include/bsp -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include/nordic_pca10056/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/include/cmsis-core/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/src/ext -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/include/uart/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/uart_hal/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/uart_hal/include/uart_hal/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/hal/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/hal/include/hal/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/include/nordic/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include/nrf52xxx/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src/prs -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/hal -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/helpers -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/mdk -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/soc -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/templates -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/kernel/os/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/kernel/os/include/os/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/libc/baselibc/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/libc/baselibc/include/baselibc/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/imgmgr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/imgmgr/include/imgmgr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/oicmgr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/oicmgr/include/oicmgr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/net/oic/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/net/oic/include/oic/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/config/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/config/include/config/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/console/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/console/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/defs/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/defs/include/defs/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/flash_map/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/flash_map/include/flash_map/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/id/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/id/include/id/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/common/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/common/include/common/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/modlog/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/modlog/include/modlog/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/util/log_cbor_reader/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/util/log_cbor_reader/include/log_cbor_reader/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/core/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/demo/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/http/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/metrics/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/panics/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/util/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/include/memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/mfg/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/mfg/include/mfg/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/shell/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/shell/include/shell/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/stats/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/stats/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sys/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sys/include/sys/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysdown/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysdown/include/sysdown/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysinit/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysinit/include/sysinit/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/time/datetime/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/time/datetime/include/datetime/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/cbmem/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/cbmem/include/cbmem/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/crc/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/crc/include/crc/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/mem/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/mem/include/mem/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/rwlock/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/rwlock/include/rwlock/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/scfg/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/scfg/include/scfg/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/streamer/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/streamer/include/streamer/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cborattr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cborattr/include/cborattr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/include/img_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/include/log_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/memfault_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/memfault_mgmt/include/memfault_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/include/stat_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/mgmt/include/mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/include/omp/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/util/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/util/include/util/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/controller/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/controller/include/controller/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/drivers/nrf52/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/drivers/nrf52/include/nrf52/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/include/host/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gap/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gap/include/gap/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gatt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gatt/include/gatt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/store/ram/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/store/ram/include/ram/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/include/nimble/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/include/transport/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/ram/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/ram/include/ram/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/porting/npl/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/porting/npl/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/bootutil/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/bootutil/include/bootutil/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/flash_map_backend/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/flash_map_backend/include/flash_map_backend/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/mcuboot_config/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/mcuboot_config/include/mcuboot_config/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/include -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/include/nrf52pdk_bleprph_memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/src -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/src/arch/cortex_m4 -DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork-DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork -o CMakeFiles/sys_memfault.dir/repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c.obj -c /home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c```
This is an example of a command after the update ```/usr/lib/ccache/arm-none-eabi-gcc -I/home/michaln/Workspace/ble-stats/bin/targets/nrf52pdk_bleprph_memfault/generated/include -I/home/michaln/Workspace/ble-stats/bin/targets/nrf52pdk_bleprph_memfault/user/pre_build/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/include/bleprph_memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/apps/bleprph_memfault/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/boot/split/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/boot/split/include/split/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/mbedtls/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/mbedtls/include/mbedtls/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/tinycrypt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/crypto/tinycrypt/include/tinycrypt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/base64/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/base64/include/base64/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/tinycbor/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/encoding/tinycbor/include/tinycbor/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include/bsp -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/include/nordic_pca10056/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/bsp/nordic_pca10056/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/include/cmsis-core/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/cmsis-core/src/ext -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/include/uart/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/uart_hal/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/drivers/uart/uart_hal/include/uart_hal/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/hal/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/hal/include/hal/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/include/nordic/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include/nrf52xxx/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src/prs -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/hal -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/helpers -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/mdk -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/soc -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/templates -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/kernel/os/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/kernel/os/include/os/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/libc/baselibc/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/libc/baselibc/include/baselibc/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/imgmgr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/imgmgr/include/imgmgr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/oicmgr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/mgmt/oicmgr/include/oicmgr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/net/oic/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/net/oic/include/oic/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/config/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/config/include/config/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/console/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/console/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/defs/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/defs/include/defs/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/flash_map/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/flash_map/include/flash_map/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/id/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/id/include/id/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/common/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/common/include/common/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/modlog/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/modlog/include/modlog/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/util/log_cbor_reader/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/log/util/log_cbor_reader/include/log_cbor_reader/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/core/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/demo/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/http/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/metrics/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/panics/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/util/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/include/memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/src -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/src/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/mfg/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/mfg/include/mfg/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/shell/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/shell/include/shell/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/stats/full/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/stats/full/include/full/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sys/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sys/include/sys/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysdown/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysdown/include/sysdown/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysinit/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/sysinit/include/sysinit/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/time/datetime/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/time/datetime/include/datetime/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/cbmem/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/cbmem/include/cbmem/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/crc/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/crc/include/crc/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/mem/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/mem/include/mem/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/rwlock/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/rwlock/include/rwlock/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/scfg/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/scfg/include/scfg/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/streamer/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/util/streamer/include/streamer/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cborattr/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cborattr/include/cborattr/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/include/img_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/img_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/include/log_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/log_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/memfault_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/memfault_mgmt/include/memfault_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/include/stat_mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/cmd/stat_mgmt/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/mgmt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/mgmt/include/mgmt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/include/omp/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/port/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/omp/port/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/util/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-mcumgr/util/include/util/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/controller/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/controller/include/controller/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/drivers/nrf52/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/drivers/nrf52/include/nrf52/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/include/host/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gap/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gap/include/gap/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gatt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/services/gatt/include/gatt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/store/ram/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/host/store/ram/include/ram/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/include/nimble/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/include/transport/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/ram/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/nimble/transport/ram/include/ram/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/porting/npl/mynewt/include -I/home/michaln/Workspace/ble-stats/repos/apache-mynewt-nimble/porting/npl/mynewt/include/mynewt/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/bootutil/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/bootutil/include/bootutil/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/flash_map_backend/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/flash_map_backend/include/flash_map_backend/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/mcuboot_config/include -I/home/michaln/Workspace/ble-stats/repos/mcuboot/boot/mynewt/mcuboot_config/include/mcuboot_config/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/include -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/include/nrf52pdk_bleprph_memfault/arch/cortex_m4 -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/src -I/home/michaln/Workspace/ble-stats/targets/nrf52pdk_bleprph_memfault/src/arch/cortex_m4 -DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork -DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork -o CMakeFiles/sys_memfault.dir/repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c.obj -c /home/michaln/Workspace/ble-stats/repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c```
michal-narajowski commented 4 years ago

Before:

set_property(SOURCE repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c APPEND_STRING
PROPERTY
COMPILE_FLAGS
"-DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork")

After:

set_property(SOURCE repos/apache-mynewt-core/sys/memfault/ext/components/core/src/arch_arm_cortex_m.c APPEND_STRING
PROPERTY
COMPILE_FLAGS
" -DAPP_NAME=bleprph_memfault -DAPP_bleprph_memfault -DARCH_NAME=cortex_m4 -DARCH_cortex_m4 -DBSP_NAME=nordic_pca10056 -DBSP_nordic_pca10056 -DMEMFAULT_TRACE_REASON_USER_DEFS_FILE=\\\"memfault_trace_reason_user_config.def\\\" -DMYNEWT=1 -DNRF52840_XXAA -DSTATS_NAME_ENABLE -Og -Wall -Werror -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m4 -mthumb -mthumb-interwork")
michal-narajowski commented 4 years ago

Closing, as this is not the real cause. In reality this issue was caused by duplicated lines in CMakeLists.txt for the same files. CMake would then merge these lines and generate concatenated flags. Duplicates were not the fault of newt but rather a duplicate line in pkg.yml configuration in pkg.src_dirs.

Thanks @kasjer for being vigilant!