Skip to content

Commit 6b3443e

Browse files
Improve support for hand-written asm source files in PIO
Closes: espressif#6817 Co-Authored-By: Ivan Kravets <[email protected]>
1 parent be120d3 commit 6b3443e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION)
1111

1212
add_custom_command(
1313
OUTPUT "idf_libs"
14-
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_ESPTOOLPY_OCT_FLASH}" "${CONFIG_SPIRAM_MODE_OCT}"
14+
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_ESPTOOLPY_OCT_FLASH}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}"
1515
DEPENDS ${elf}
1616
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
1717
VERBATIM

Diff for: tools/copy-libs.sh

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# config
33

44
IDF_TARGET=$1
5+
IS_XTENSA=$4
56
OCT_FLASH=
67
OCT_PSRAM=
78
if [ "$2" = "y" ]; then
@@ -281,6 +282,15 @@ cat pio_start.txt > "$AR_PLATFORMIO_PY"
281282
rm pio_end.txt 1pio_start.txt pio_start.txt
282283

283284
echo " ASFLAGS=[" >> "$AR_PLATFORMIO_PY"
285+
if [ "$IS_XTENSA" = "y" ]; then
286+
echo " \"-mlongcalls\"" >> "$AR_PLATFORMIO_PY"
287+
else
288+
echo " \"-march=rv32imc\"" >> "$AR_PLATFORMIO_PY"
289+
fi
290+
echo " ]," >> "$AR_PLATFORMIO_PY"
291+
echo "" >> "$AR_PLATFORMIO_PY"
292+
293+
echo " ASPPFLAGS=[" >> "$AR_PLATFORMIO_PY"
284294
set -- $PIO_AS_FLAGS
285295
for item; do
286296
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"

0 commit comments

Comments
 (0)