Skip to content

Commit 75d100a

Browse files
committed
Build picolibc too
To make C++ work, this requires patching the GCC headers that are built. This would have been done by crosstool-ng, but sdk-ng doesn't use a GCC version known to crosstool-ng, so none of the crosstool-ng patches are applied. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent cd9367c commit 75d100a

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

configs/arm.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
7070
# CT_LIBC_NEWLIB_NANO_LTO is not set
7171
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
7272
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y
73+
74+
CT_COMP_LIBS_PICOLIBC=y
75+
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
76+
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
77+
CT_TARGET_CFLAGS="-ftls-model=local-exec"

configs/arm64.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
6969
# CT_LIBC_NEWLIB_NANO_LTO is not set
7070
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
7171
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y
72+
73+
CT_COMP_LIBS_PICOLIBC=y
74+
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
75+
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
76+
CT_TARGET_CFLAGS="-ftls-model=local-exec"

configs/i586.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
6969
# CT_LIBC_NEWLIB_NANO_LTO is not set
7070
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
7171
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y
72+
73+
CT_COMP_LIBS_PICOLIBC=y
74+
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
75+
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y

configs/riscv64.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
7070
# CT_LIBC_NEWLIB_NANO_LTO is not set
7171
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
7272
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y
73+
74+
CT_COMP_LIBS_PICOLIBC=y
75+
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
76+
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
77+
CT_TARGET_CFLAGS="-ftls-model=local-exec"

go.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ for t in ${TARGETS}; do
175175
fi
176176
rm -rf ${CT_PREFIX}/*/newlib-nano
177177

178+
# Fix include_next in c++ headers. Crosstool-ng does this for
179+
# known GCC releases, but we're cherry-picking a specific GCC
180+
# tag, so none of the crosstool-ng patches get applied.
181+
182+
find ${OUTPUT_DIR}/${TARGET_DIR}/include/c++ -type f | xargs sed -i 's/include_next/include/'
183+
178184
popd
179185
rm -fr ${TARGET_BUILD_DIR}
180186
mv ${CT_PREFIX}/${TRIPLET}/build.log.bz2 ${OUTPUT_DIR}/build.${t}.${os}.${machine}.log.bz2

0 commit comments

Comments
 (0)