Skip to content

Commit

Permalink
Bring back implicit usage of built-in functions of the standard library
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartatz committed Jun 1, 2024
1 parent d411590 commit 925b6ec
Show file tree
Hide file tree
Showing 4 changed files with 1,234 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
- uses: actions/checkout@main
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: '3.12'
- name: Restore from cache
uses: actions/cache@main
with:
Expand Down
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,32 @@ for target in "${targets[@]}"; do
patch --directory="${toolchain_directory}/${triple}" --strip='1' --input="${workdir}/patches/linux_pim.patch"
fi

cd "${toolchain_directory}/${triple}/include"

if ! (( is_native )); then
CC="${triple}-gcc" python "${workdir}/tools/make_builtins.py"

if [ -f './builtin_ctype.h' ]; then
echo '#include <builtin_ctype.h>' >> './ctype.h'
fi

if [ -f './builtin_math.h' ]; then
echo '#include <builtin_math.h>' >> './math.h'
fi

if [ -f './builtin_stdio.h' ]; then
echo '#include <builtin_stdio.h>' >> './stdio.h'
fi

if [ -f './builtin_complex.h' ]; then
echo '#include <builtin_complex.h>' >> './complex.h'
fi

if [ -f './builtin_stdlib.h' ]; then
echo '#include <builtin_stdlib.h>' >> './stdlib.h'
fi
fi

[ -d "${binutils_directory}/build" ] || mkdir "${binutils_directory}/build"

cd "${binutils_directory}/build"
Expand Down
Loading

0 comments on commit 925b6ec

Please sign in to comment.