Skip to content

Commit e48e3af

Browse files
committedMar 21, 2025
variants: generate cflags.txt and includes.txt from llext-edk
1 parent 43f2d5a commit e48e3af

File tree

19 files changed

+491
-72
lines changed

19 files changed

+491
-72
lines changed
 

‎boards.txt

-16
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ giga.build.extra_flags=
2525
giga.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
2626
giga.build.architecture=cortex-m7
2727
giga.build.board=GIGA
28-
giga.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DHSE_VALUE=16000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=16384 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32H747xx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
29-
giga.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mcpu=cortex-m7 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
3028
giga.compiler.zephyr=
3129
giga.vid.0=0x2341
3230
giga.pid.0=0x0066
@@ -92,8 +90,6 @@ nano33ble.build.extra_flags=
9290
nano33ble.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
9391
nano33ble.build.architecture=cortex-m4
9492
nano33ble.build.board=ARDUINO_NANO33BLE
95-
nano33ble.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DNRF52840_XXAA -DKERNEL -DK_HEAP_MEM_POOL_SIZE=32768 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
96-
nano33ble.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
9793
nano33ble.compiler.zephyr=
9894
nano33ble.vid.0=0x2341
9995
nano33ble.pid.0=0x035a
@@ -158,8 +154,6 @@ ek_ra8d1.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
158154
ek_ra8d1.build.architecture=cortex-m85+nomve
159155
ek_ra8d1.build.board=ek_ra8d1
160156
ek_ra8d1.compiler.zephyr.arch.define=
161-
ek_ra8d1.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DHSE_VALUE=16000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=16384 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32H747xx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
162-
ek_ra8d1.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
163157

164158
#ek_ra8d1.recipe.hooks.objcopy.postobjcopy.4.pattern=cp {build.variant.path}/flasher.jlink "{build.path}/flasher.jlink"
165159
#ek_ra8d1.recipe.hooks.objcopy.postobjcopy.5.pattern=sed -i 's|SKETCH|"{build.path}/{build.project_name}.llext.dfu.bin"|g' "{build.path}/flasher.jlink"
@@ -217,8 +211,6 @@ frdm_mcxn947.build.extra_flags=
217211
frdm_mcxn947.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
218212
frdm_mcxn947.build.board=frdm_mcxn947
219213
frdm_mcxn947.compiler.zephyr.arch.define=
220-
frdm_mcxn947.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DCPU_MCXN947VDF_cm33_core0 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=16384 -DLPFLEXCOMM_INIT_NOT_USED_IN_DRIVER=1 -DNDEBUG -DPICOLIBC_DOUBLE_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
221-
frdm_mcxn947.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
222214
frdm_mcxn947.compiler.zephyr=
223215
frdm_mcxn947.vid.0=0x1fc9
224216
frdm_mcxn947.pid.0=0x0143
@@ -272,8 +264,6 @@ portentah7.build.extra_flags=
272264
portentah7.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
273265
portentah7.build.architecture=cortex-m7
274266
portentah7.build.board=PORTENTA_H7
275-
portentah7.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DHSE_VALUE=25000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=16384 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32H747xx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
276-
portentah7.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mcpu=cortex-m7 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
277267
portentah7.compiler.zephyr=
278268
portentah7.vid.0=0x2341
279269
portentah7.pid.0=0x005b
@@ -339,8 +329,6 @@ frdm_rw612.build.extra_flags=
339329
frdm_rw612.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
340330
frdm_rw612.build.board=frdm_rw612
341331
frdm_rw612.compiler.zephyr.arch.define=
342-
frdm_rw612.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DCPU_RW612ETA2I -DRW610 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=122880 -DLPFLEXCOMM_INIT_NOT_USED_IN_DRIVER=1 -DNDEBUG -DPICOLIBC_DOUBLE_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
343-
frdm_rw612.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
344332
frdm_rw612.compiler.zephyr=
345333
frdm_rw612.vid.0=0x1fc9
346334
frdm_rw612.pid.0=0x0143
@@ -393,8 +381,6 @@ niclasense.build.extra_flags=
393381
niclasense.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
394382
niclasense.build.architecture=cortex-m4
395383
niclasense.build.board=ARDUINO_NICLA_SENSE_ME
396-
niclasense.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DNRF52832_XXAA -DK_HEAP_MEM_POOL_SIZE=1024 -DKERNEL -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
397-
niclasense.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
398384
niclasense.compiler.zephyr=
399385
niclasense.vid.0=0x2341
400386
niclasense.pid.0=0x0360
@@ -474,8 +460,6 @@ portentac33.build.extra_flags=
474460
portentac33.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
475461
portentac33.build.board=arduino_portenta_c33
476462
portentac33.compiler.zephyr.arch.define=
477-
portentac33.compiler.zephyr.defines=-DLL_EXTENSION_BUILD -DCONFIG_ARDUINO_API_SERIAL_BUFFER_SIZE=256 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=122880 -DNDEBUG -DPICOLIBC_DOUBLE_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
478-
portentac33.compiler.zephyr.cflags=-fno-strict-aliasing -fno-printf-return-value -fno-common -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop --specs=picolibc.specs -D_POSIX_THREADS -mlong-calls -nodefaultlibs
479463
portentac33.compiler.zephyr=
480464
portentac33.vid.0=0x2341
481465
portentac33.pid.0=0x0068

‎extra/build.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
if [ x$ZEPHYR_SDK_INSTALL_DIR == x"" ]; then
2-
export ZEPHYR_SDK_INSTALL_DIR=/ssd/zephyr-sdk-0.16.8/
3-
fi
1+
#!/bin/bash
42

53
set -e
64

5+
if [ x$ZEPHYR_SDK_INSTALL_DIR == x"" ]; then
6+
SDK_PATH=$(west sdk list | grep path | tail -n 1 | cut -d ':' -f 2 | tr -d ' ')
7+
if [ x$SDK_PATH == x ]; then
8+
echo "ZEPHYR_SDK_INSTALL_DIR not set and no SDK found"
9+
exit 1
10+
fi
11+
echo "ZEPHYR_SDK_INSTALL_DIR not set, using $SDK_PATH"
12+
export ZEPHYR_SDK_INSTALL_DIR=${SDK_PATH}
13+
fi
14+
715
board=$1
816
variant=$2
917
third_arg=$3
@@ -21,7 +29,7 @@ if [ "$third_arg" != "" ]; then
2129
fi
2230

2331
(west build loader -b $board -p $extra_args && west build -t llext-edk)
24-
(tar xfp build/zephyr/llext-edk.tar.xz --directory variants/$variant/)
32+
(rm -rf variants/$variant/* && tar xfp build/zephyr/llext-edk.tar.xz --directory variants/$variant/)
2533

2634
(cp build/zephyr/zephyr.elf firmwares/zephyr-$variant.elf)
2735
if [ -f build/zephyr/zephyr.bin ]; then
@@ -47,3 +55,5 @@ sed -i 's/PROVIDE(free =/PROVIDE(__wrap_free =/g' variants/$variant/provides.ld
4755
sed -i 's/PROVIDE(realloc =/PROVIDE(__wrap_realloc =/g' variants/$variant/provides.ld
4856
sed -i 's/PROVIDE(calloc =/PROVIDE(__wrap_calloc =/g' variants/$variant/provides.ld
4957
sed -i 's/PROVIDE(random =/PROVIDE(__wrap_random =/g' variants/$variant/provides.ld
58+
59+
cmake -P extra/gen_arduino_files.cmake $variant

‎extra/gen_arduino_files.cmake

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# get root dir for the project
2+
cmake_path(SET TOP_DIR NORMALIZE ${CMAKE_CURRENT_LIST_DIR}/..)
3+
4+
# get list of variants to be applied
5+
if(CMAKE_ARGC GREATER 3)
6+
# cmake -P <script> <variant> ...
7+
foreach(index RANGE 4 ${CMAKE_ARGC})
8+
math(EXPR index "${index} - 1")
9+
list(APPEND VARIANTS "${CMAKE_ARGV${index}}")
10+
endforeach()
11+
list(TRANSFORM VARIANTS REPLACE "/$" "")
12+
list(TRANSFORM VARIANTS REPLACE ".*/" "")
13+
else()
14+
# build for all valid variants
15+
file(GLOB VARIANTS RELATIVE ${TOP_DIR}/variants variants/*)
16+
list(REMOVE_ITEM VARIANTS llext linked)
17+
endif()
18+
19+
foreach(variant ${VARIANTS})
20+
if(NOT IS_DIRECTORY variants/${variant})
21+
continue()
22+
endif()
23+
24+
cmake_path(SET dir ${TOP_DIR}/variants/${variant})
25+
if(NOT EXISTS ${dir}/llext-edk/cmake.cflags)
26+
continue()
27+
endif()
28+
29+
message(STATUS "Processing ${variant}")
30+
include(${dir}/llext-edk/cmake.cflags)
31+
32+
list(TRANSFORM LLEXT_ALL_INCLUDE_CFLAGS REPLACE "-I${dir}" "-iwithprefixbefore")
33+
list(JOIN LLEXT_ALL_INCLUDE_CFLAGS "\n" EDK_INCLUDES)
34+
file(WRITE ${dir}/includes.txt "${EDK_INCLUDES}")
35+
36+
# exclude -imacros entries in platform from the list, make sure no others are present
37+
list(FILTER LLEXT_BASE_CFLAGS EXCLUDE REGEX "-imacros.*autoconf.h")
38+
list(FILTER LLEXT_BASE_CFLAGS EXCLUDE REGEX "-imacros.*zephyr_stdint.h")
39+
set(other_imacros "${LLEXT_BASE_CFLAGS}")
40+
list(FILTER other_imacros INCLUDE REGEX "-imacros.*")
41+
if(other_imacros)
42+
message(FATAL_ERROR "Unexpected -imacros in LLEXT_BASE_CFLAGS: ${other_imacros}")
43+
endif()
44+
45+
# exclude other problematic macros shared between C and C++
46+
list(FILTER LLEXT_BASE_CFLAGS EXCLUDE REGEX "-fdiagnostics-color=always")
47+
48+
# (temp) generate C++ flags from C flags
49+
set(LLEXT_BASE_CXXFLAGS ${LLEXT_BASE_CFLAGS})
50+
list(FILTER LLEXT_BASE_CXXFLAGS EXCLUDE REGEX "-Wno-pointer-sign")
51+
list(FILTER LLEXT_BASE_CXXFLAGS EXCLUDE REGEX "-Werror=implicit-int")
52+
list(FILTER LLEXT_BASE_CXXFLAGS EXCLUDE REGEX "-std=c.*")
53+
54+
# save flag files
55+
list(JOIN LLEXT_BASE_CFLAGS "\n" EDK_CFLAGS)
56+
file(WRITE ${dir}/cflags.txt "${EDK_CFLAGS}")
57+
58+
59+
list(JOIN LLEXT_BASE_CXXFLAGS "\n" EDK_CXXFLAGS)
60+
file(WRITE ${dir}/cxxflags.txt "${EDK_CXXFLAGS}")
61+
endforeach()

‎platform.txt

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ compiler.warning_flags.all=-Wall -Wextra
1717

1818
compiler.path={build.compiler_path}
1919
compiler.c.cmd={build.crossprefix}gcc
20-
compiler.c.flags=-g -c {compiler.warning_flags} {compiler.zephyr.defines} {compiler.zephyr.cflags} {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}
20+
compiler.c.flags=-g -c {compiler.warning_flags} {compiler.zephyr.macros} "@{compiler.zephyr.cflags}" {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}
2121
compiler.c.elf.cmd={build.crossprefix}g++
2222
compiler.c.elf.flags={build.llext_link_flags} -Wl,--gc-sections -mcpu={build.mcu} {build.float-abi} {build.fpu} -std=c++17
2323
compiler.S.cmd={build.crossprefix}g++
2424
compiler.S.flags=-c -x assembler-with-cpp -mcpu={build.mcu} {build.fpu}
2525
compiler.cpp.cmd={build.crossprefix}g++
26-
compiler.cpp.flags=-g -Os -std=c++17 -c {compiler.warning_flags} {compiler.zephyr.defines} {compiler.zephyr.common_ldflags} {compiler.zephyr.extra_ldflags} {compiler.zephyr.cflags} {compiler.zephyr.common_cxxflags} {compiler.zephyr.extra_cxxflags} {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}
26+
compiler.cpp.flags=-g -Os -std=c++17 -c {compiler.warning_flags} {compiler.zephyr.macros} "@{compiler.zephyr.cxxflags}" {compiler.zephyr.common_ldflags} {compiler.zephyr.extra_ldflags} {compiler.zephyr.common_cxxflags} {compiler.zephyr.extra_cxxflags} {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}
2727
compiler.ar.cmd={build.crossprefix}ar
2828
compiler.ar.flags=rcs
2929
compiler.objcopy.cmd=
@@ -36,7 +36,10 @@ compiler.libraries.ldflags=
3636
compiler.size.cmd={build.crossprefix}size
3737
compiler.define=-DARDUINO=
3838

39-
compiler.zephyr.includes={board.variant.path}/includes.txt
39+
compiler.zephyr.includes={build.variant.path}/includes.txt
40+
compiler.zephyr.cflags={build.variant.path}/cflags.txt
41+
compiler.zephyr.cxxflags={build.variant.path}/cxxflags.txt
42+
compiler.zephyr.macros=-imacros{build.variant.path}/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h -imacros{build.variant.path}/llext-edk/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h
4043
compiler.zephyr.common_cxxflags=-fdata-sections -ffunction-sections -fno-unwind-tables
4144
compiler.zephyr.common_ldflags=-fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-unwind-tables -fno-use-cxa-atexit -lstdc++ -lsupc++ -lnosys -nostdlib
4245

@@ -96,7 +99,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DARDUIN
9699
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
97100

98101
## Combine gc-sections, archives, and objects
99-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {build.extra_ldflags} {compiler.zephyr.ldflags} "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=picolibc.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}_debug.elf" {object_files} "{build.path}/{archive_file}" {compiler.zephyr} {compiler.zephyr.extra_ldflags} {compiler.libraries.ldflags}
102+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {build.extra_ldflags} {compiler.zephyr.common_ldflags} "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=picolibc.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}_debug.elf" {object_files} "{build.path}/{archive_file}" {compiler.zephyr} {compiler.zephyr.extra_ldflags} {compiler.libraries.ldflags}
100103
recipe.hooks.linking.postlink.1.pattern="{compiler.path}{build.crossprefix}strip" --strip-debug {build.path}/{build.project_name}_debug.elf -o{build.path}/{build.project_name}.elf
101104

102105
## Create eeprom
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
-DKERNEL
2+
-D__ZEPHYR__=1
3+
-D__LINUX_ERRNO_EXTENSIONS__
4+
-DPICOLIBC_DOUBLE_PRINTF_SCANF
5+
-D__PROGRAM_START
6+
-DSTM32H747xx
7+
-DUSE_HAL_DRIVER
8+
-DUSE_FULL_LL_DRIVER
9+
-DCORE_CM7
10+
-DHSE_VALUE=16000000
11+
-DK_HEAP_MEM_POOL_SIZE=65536
12+
-DLL_EXTENSION_BUILD
13+
-fno-strict-aliasing
14+
-fno-common
15+
-fdiagnostics-color=always
16+
-mcpu=cortex-m7
17+
-mthumb
18+
-mabi=aapcs
19+
-mfpu=fpv5-d16
20+
-mfloat-abi=hard
21+
-mfp16-format=ieee
22+
-mtp=soft
23+
-Wall
24+
-Wformat
25+
-Wformat-security
26+
-Wformat
27+
-Wno-format-zero-length
28+
-Wdouble-promotion
29+
-Wno-pointer-sign
30+
-Wpointer-arith
31+
-Wexpansion-to-defined
32+
-Wno-unused-but-set-variable
33+
-Werror=implicit-int
34+
-fno-asynchronous-unwind-tables
35+
-ftls-model=local-exec
36+
-fno-reorder-functions
37+
--param=min-pagesize=0
38+
-fno-defer-pop
39+
-specs=picolibc.specs
40+
-D_POSIX_THREADS
41+
-std=c99
42+
-mlong-calls
43+
-mthumb
44+
-nodefaultlibs

‎variants/arduino_giga_r1_m7/includes.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
-iwithprefixbefore/llext-edk/include/zephyr/soc/st/stm32
55
-iwithprefixbefore/llext-edk/include/zephyr/lib/libc/common/include
66
-iwithprefixbefore/llext-edk/include/zephyr/lib/posix/options/getopt/
7+
-iwithprefixbefore/llext-edk/include/zephyr/lib/cpp/minimal/include
78
-iwithprefixbefore/llext-edk/include/zephyr/soc/st/stm32/common/.
89
-iwithprefixbefore/llext-edk/include/zephyr/drivers
910
-iwithprefixbefore/llext-edk/include/zephyr/soc/st/stm32/stm32h7x/.
1011
-iwithprefixbefore/llext-edk/include/zephyr/subsys/usb/device
11-
-iwithprefixbefore/llext-edk/include/zephyr-arduino-core/include
12+
-iwithprefixbefore/llext-edk/include/zephyr/subsys/shell/modules/kernel_service/thread/../
1213
-iwithprefixbefore/llext-edk/include/modules/hal/cmsis/CMSIS/Core/Include
1314
-iwithprefixbefore/llext-edk/include/zephyr/modules/cmsis/.
1415
-iwithprefixbefore/llext-edk/include/modules/hal/stm32/stm32cube/stm32h7xx/soc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
-DKERNEL
2+
-D__ZEPHYR__=1
3+
-D__LINUX_ERRNO_EXTENSIONS__
4+
-DPICOLIBC_DOUBLE_PRINTF_SCANF
5+
-D__PROGRAM_START
6+
-DNRF52840_XXAA
7+
-DK_HEAP_MEM_POOL_SIZE=16384
8+
-DLL_EXTENSION_BUILD
9+
-fno-strict-aliasing
10+
-fstack-protector
11+
-mstack-protector-guard=global
12+
-fno-common
13+
-fdiagnostics-color=always
14+
-mcpu=cortex-m4
15+
-mthumb
16+
-mabi=aapcs
17+
-mfpu=fpv4-sp-d16
18+
-mfloat-abi=hard
19+
-mfp16-format=ieee
20+
-mtp=soft
21+
-Wall
22+
-Wformat
23+
-Wformat-security
24+
-Wformat
25+
-Wno-format-zero-length
26+
-Wdouble-promotion
27+
-Wno-pointer-sign
28+
-Wpointer-arith
29+
-Wexpansion-to-defined
30+
-Wno-unused-but-set-variable
31+
-Werror=implicit-int
32+
-fno-asynchronous-unwind-tables
33+
-ftls-model=local-exec
34+
-fno-reorder-functions
35+
--param=min-pagesize=0
36+
-fno-defer-pop
37+
-fstack-usage
38+
-specs=picolibc.specs
39+
-D_POSIX_THREADS
40+
-std=c99
41+
-mlong-calls
42+
-mthumb
43+
-nodefaultlibs

0 commit comments

Comments
 (0)
Please sign in to comment.