diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f708d4..659f195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ if(${CMAKE_CROSSCOMPILING}) endif() -target_link_libraries(${TARGET_NAME} PUBLIC bsp freertos_kernel lwip mission_rust) +target_link_libraries(${TARGET_NAME} PUBLIC bsp mission_rust lwip ) # target_include_directories( # ${TARGET_NAME} PUBLIC ${BSP_PATH}) diff --git a/bsp_z7/freeRTOS/CMakeLists.txt b/bsp_z7/freeRTOS/CMakeLists.txt index 1b305ce..597a70b 100644 --- a/bsp_z7/freeRTOS/CMakeLists.txt +++ b/bsp_z7/freeRTOS/CMakeLists.txt @@ -1 +1,6 @@ -target_sources(bsp PUBLIC FreeRTOS_asm_vectors.S FreeRTOS_tick_config.c) \ No newline at end of file +target_sources(bsp PRIVATE FreeRTOS_asm_vectors.S) + +# Needs to be INTERFACE'd so it is build as part of the main application and can be found by the linker +# Otherwise, we have a circular dependency between FreeRTOS and bsp which needs single file libraries to +# resolve +target_sources(bsp INTERFACE FreeRTOS_tick_config.c) \ No newline at end of file diff --git a/bsp_z7/lwip/xilinx_eth/CMakeLists.txt b/bsp_z7/lwip/xilinx_eth/CMakeLists.txt index 37e548a..724a8e2 100644 --- a/bsp_z7/lwip/xilinx_eth/CMakeLists.txt +++ b/bsp_z7/lwip/xilinx_eth/CMakeLists.txt @@ -16,7 +16,7 @@ set(lwip_SRCS_XIL ) -add_library(lwip_xil ${lwip_SRCS_XIL}) +add_library(lwip_xil EXCLUDE_FROM_ALL ${lwip_SRCS_XIL}) target_include_directories(lwip_xil PUBLIC ${LWIP_INCLUDE_DIRS_XIL}) diff --git a/bsp_z7/newlib/CMakeLists.txt b/bsp_z7/newlib/CMakeLists.txt index b669533..8f02f01 100644 --- a/bsp_z7/newlib/CMakeLists.txt +++ b/bsp_z7/newlib/CMakeLists.txt @@ -1 +1,3 @@ -target_sources(bsp PUBLIC close.c read.c write.c) \ No newline at end of file +# Needs to be INTERFACE'd so it is build as part of the main application and can be found by the linker +# Otherwise, the linker seems to be unable to link it into newlib +target_sources(bsp INTERFACE close.c exit.c read.c write.c) \ No newline at end of file diff --git a/bsp_z7/newlib/exit.c b/bsp_z7/newlib/exit.c new file mode 100644 index 0000000..9db9f91 --- /dev/null +++ b/bsp_z7/newlib/exit.c @@ -0,0 +1,7 @@ +void _exit (int _status) +{ + (void)_status; + while (1) { + ; + } +} \ No newline at end of file diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/emacps/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/emacps/CMakeLists.txt index 746ba16..a72c3e6 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/emacps/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/emacps/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xemacps_bdring.c src/xemacps.c src/xemacps_control.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/gpiops/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/gpiops/CMakeLists.txt index 17ececf..83e05d9 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/gpiops/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/gpiops/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xgpiops_g.c src/xgpiops_hw.c src/xgpiops_intr.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/scugic/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/scugic/CMakeLists.txt index fd7ec2b..6b0b9b7 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/scugic/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/scugic/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xscugic_g.c src/xscugic.c src/xscugic_intr.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/scutimer/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/scutimer/CMakeLists.txt index 787d0cb..0761b81 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/scutimer/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/scutimer/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xscutimer.c src/xscutimer_sinit.c src/xscutimer_g.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/scuwdt/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/scuwdt/CMakeLists.txt index 59c0364..ce26856 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/scuwdt/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/scuwdt/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xscuwdt_sinit.c src/xscuwdt_selftest.c src/xscuwdt_g.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/standalone/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/standalone/CMakeLists.txt index 67eed87..a4fcc49 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/standalone/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/standalone/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/translation_table.S src/cpu_init.S src/boot.S @@ -14,10 +14,10 @@ target_sources(bsp PUBLIC src/fstat.c src/fcntl.c src/putnum.c - src/_open.c + #src/_open.c src/xil_testcache.c src/xil_assert.c - src/_exit.c + #src/_exit.c src/time.c src/xil_testio.c src/xplatform_info.c @@ -33,7 +33,7 @@ target_sources(bsp PUBLIC src/isatty.c #src/read.c #src/inbyte.c - src/close.c + #src/close.c src/xil_sleeptimer.c src/print.c src/xil_printf.c diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/uartps/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/uartps/CMakeLists.txt index 9d97a19..80a4555 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/uartps/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/libsrc/uartps/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(bsp PUBLIC +target_sources(bsp PRIVATE src/xuartps.c src/xuartps_hw.c src/xuartps_intr.c diff --git a/sim_interface/CMakeLists.txt b/sim_interface/CMakeLists.txt index abe28b6..8dd83c3 100644 --- a/sim_interface/CMakeLists.txt +++ b/sim_interface/CMakeLists.txt @@ -1,7 +1,7 @@ -add_executable(sim_interface mission.c testEth.c) +add_executable(sim_interface EXCLUDE_FROM_ALL mission.c testEth.c) target_link_options(sim_interface PRIVATE -Wl,--cref -Wl,-Map=${TARGET_NAME}.map -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none -T${CMAKE_SOURCE_DIR}/bsp_z7/freeRTOS/lscript.ld -specs=${CMAKE_SOURCE_DIR}/bsp_z7/freeRTOS/Xilinx.spec ) -target_link_libraries(sim_interface PRIVATE bsp lwip_xil freertos_kernel) +target_link_libraries(sim_interface PRIVATE lwip_xil bsp freertos_kernel) target_link_options(sim_interface PRIVATE "-Wl,--gc-sections") \ No newline at end of file