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

NuttX cmake generate Make.defs from PX4 #8573

Merged
merged 1 commit into from
Jan 6, 2018
Merged

NuttX cmake generate Make.defs from PX4 #8573

merged 1 commit into from
Jan 6, 2018

Conversation

dagar
Copy link
Member

@dagar dagar commented Jan 4, 2018

Each nuttx-config's Make.defs is nearly identical except for architecture specific compiler flags which PX4 cmake already has. We can generate this file for each nuttx-config, inheriting the cpu flags from PX4. Additional NuttX flags can be added to nuttx-configs/Make.defs.in.

TODO: test on windows

LorenzMeier
LorenzMeier previously approved these changes Jan 4, 2018
@LorenzMeier LorenzMeier added this to the Release v1.8.0 milestone Jan 4, 2018
# We only support building with the ARM bare-metal toolchain from
# https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS.
#
CONFIG_ARMV7M_TOOLCHAIN := GNU_EABI${HOST_OS_FIRST_LETTER}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagar what happens here to get GNU_EABI{L|W} for nuttx?

Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Inline comment - If it works on Linux I am good with it.

@dagar
Copy link
Member Author

dagar commented Jan 5, 2018

@MaEtUgR or @hamishwillee could you give this branch a quick try on your cygwin setup? Any nuttx build will do.

@dagar dagar force-pushed the pr-nuttx_generate branch from b922e64 to 4757603 Compare January 5, 2018 21:33
@dagar
Copy link
Member Author

dagar commented Jan 5, 2018

If we ever want to do real native toolchain windows builds this is likely going to have implications for the NuttX side, however we'll be in a much better position to handle the issues sanely from PX4 cmake.

@dagar dagar force-pushed the pr-nuttx_generate branch from 4757603 to b835d0c Compare January 5, 2018 22:21
@dagar dagar merged commit 1f63d85 into master Jan 6, 2018
@dagar dagar deleted the pr-nuttx_generate branch January 6, 2018 03:47
@hamishwillee
Copy link
Contributor

@MaEtUgR or @hamishwillee could you give this branch a quick try on your cygwin setup? Any nuttx build will do.

I don't have a current setup. @MaEtUgR ?

@MaEtUgR
Copy link
Member

MaEtUgR commented Jan 8, 2018

Late to the party. Broke it like I wrote here.

Just for reference the first error is:

[21/902] Building CXX object src/modules/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/driver/uc_can.cpp.obj
FAILED: src/modules/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/driver/uc_can.cpp.obj
/cygdrive/c/PX4/toolchain/gcc-arm-none-eabi-5_4-2016q3-20160926-win32/bin/arm-none-eabi-g++.exe   -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_PX4FMU_V4 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN                        _PLATFORM=stm32 -DUAVCAN_STM32_NUM_IFACES=1 -DUAVCAN_STM32_NUTTX=1 -DUAVCAN_STM32_TIMER_NUMBER=5 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../../src -I../../src/drivers/boards/px4fmu-v4 -I../../src/include -I../..                        /src/lib -I../../src/lib/DriverFramework/framework/include -I../../src/lib/matrix -I../../src/modules -I../../src/platforms -INuttX/nuttx/arch/arm/src/armv7-m -INuttX/nuttx/arch/arm/src/chip -INuttX/nuttx/arch/arm/src/common -INuttX/nuttx/include                         -INuttX/nuttx/include/cxx -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/uavcan/libuavcan/./libuavcan/include -I../../src/modules/uavcan/libuavcan/./libuavcan/include/dsdlc_generated -I../../src/modules/u                        avcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/modules/uavcan/libuavcan/libuavcan/include -fno-common -ffunction-sections -fdata-sections -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fno-common -ffunct                        ion-sections -fdata-sections -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Warray-bounds -Wdisabled-optimization -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wform                        at-security -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wn                        o-missing-field-initializers -Wno-overloaded-virtual -Wreorder -fvisibility=hidden -include visibility.h -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-pr                        intf -Wall -Wextra -Wundef -std=c++03 -Wno-variadic-macros -Wno-long-long -Os -DNDEBUG -MD -MT src/modules/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/driver/uc_can.cpp.obj -MF src/modules/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/                        src/driver/uc_can.cpp.obj.d -o src/modules/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/driver/uc_can.cpp.obj -c ../../src/modules/uavcan/libuavcan/libuavcan/src/driver/uc_can.cpp
cc1plus.exe: error: NuttX/nuttx/arch/arm/src/chip: not a directory [-Werror]
compilation terminated due to -Wfatal-errors.
cc1plus.exe: all warnings being treated as errors

And all the following look exactly the same.

I'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants