Skip to content

Commit 376329c

Browse files
Using app source newlib (3.3.0 in Debian 12)
1 parent c8b1eac commit 376329c

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tools/build_newlib.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ then
2727
exit 1
2828
fi
2929

30+
# Enabling source repository
31+
sed -i 's/^\(Types: deb\)$/\1 deb-src/g' /etc/apt/sources.list.d/debian.sources
3032

31-
mkdir -p "$OUTPUT_DIR"
32-
OUTPUT_DIR=$(realpath "$OUTPUT_DIR")
33+
# Installing newlib build dependencies
34+
apt update
35+
apt install -y --no-install-recommends texinfo dpkg-dev
36+
37+
# Get the latest fixed version for this OS version
38+
apt source newlib
3339

40+
# Entering the source directory
41+
cd */
3442

3543
# ENV SETUP
3644
WORKDIR="$(pwd)"
37-
SRC="${WORKDIR}/newlib"
38-
BUILD="${SRC}/arm_none_eabi_build"
39-
INSTALL="${SRC}/arm_none_eabi_install"
40-
cd "${WORKDIR}"
41-
42-
# Installing newlib build dependencies
43-
apt update
44-
apt install -y --no-install-recommends texinfo
45-
46-
# Get the latest fixed version
47-
git clone --depth=1 --single-branch --branch newlib-4.5.0 https://sourceware.org/git/newlib-cygwin.git "${SRC}"
45+
#SRC="${WORKDIR}/newlib"
46+
BUILD="${WORKDIR}/arm_none_eabi_build"
47+
INSTALL="${WORKDIR}/arm_none_eabi_install"
4848

4949
# Build configuration
5050
mkdir -p "${BUILD}" "${INSTALL}"
@@ -86,6 +86,7 @@ arm-none-eabi-strip --strip-debug "${INSTALL}/arm-none-eabi/lib/libc.a"
8686
arm-none-eabi-strip --strip-debug "${INSTALL}/arm-none-eabi/lib/libm.a"
8787

8888
# Copy back
89+
OUTPUT_DIR=$(realpath "$OUTPUT_DIR")
8990
mkdir -p "$OUTPUT_DIR"
9091
cp "${INSTALL}/arm-none-eabi/lib/libc.a" "$OUTPUT_DIR"
9192
cp "${INSTALL}/arm-none-eabi/lib/libm.a" "$OUTPUT_DIR"

0 commit comments

Comments
 (0)