Skip to content

Commit

Permalink
Build picolibc too
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
keith-packard committed Oct 21, 2021
1 parent c045f51 commit fca7eac
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions configs/arm.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
# CT_LIBC_NEWLIB_NANO_LTO is not set
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y

CT_COMP_LIBS_PICOLIBC=y
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
CT_TARGET_CFLAGS="-ftls-model=local-exec"
5 changes: 5 additions & 0 deletions configs/arm64.config
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
# CT_LIBC_NEWLIB_NANO_LTO is not set
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y

CT_COMP_LIBS_PICOLIBC=y
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
CT_TARGET_CFLAGS="-ftls-model=local-exec"
4 changes: 4 additions & 0 deletions configs/i586.config
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
# CT_LIBC_NEWLIB_NANO_LTO is not set
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y

CT_COMP_LIBS_PICOLIBC=y
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
5 changes: 5 additions & 0 deletions configs/riscv64.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE=y
# CT_LIBC_NEWLIB_NANO_LTO is not set
CT_LIBC_NEWLIB_NANO_NANO_MALLOC=y
CT_LIBC_NEWLIB_NANO_NANO_FORMATTED_IO=y

CT_COMP_LIBS_PICOLIBC=y
CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y
CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y
CT_TARGET_CFLAGS="-ftls-model=local-exec"
6 changes: 6 additions & 0 deletions go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ for t in ${TARGETS}; do
fi
rm -rf ${CT_PREFIX}/*/newlib-nano

# Fix include_next in c++ headers. Crosstool-ng does this for
# known GCC releases, but we're cherry-picking a specific GCC
# tag, so none of the crosstool-ng patches get applied.

find ${OUTPUT_DIR}/${TARGET_DIR}/include/c++ -type f | xargs sed -i 's/include_next/include/'

popd
rm -fr ${TARGET_BUILD_DIR}
mv ${CT_PREFIX}/${TRIPLET}/build.log.bz2 ${OUTPUT_DIR}/build.${t}.${os}.${machine}.log.bz2
Expand Down

0 comments on commit fca7eac

Please sign in to comment.