Skip to content

Commit 9140c9f

Browse files
authored
thirdparty: add thirdparty-linux-armv7_bdwgc.sh for building libgc.a on ARMv7 CPUs (#25077)
1 parent 5eebd91 commit 9140c9f

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
# NOTE: The configure step may require:
4+
# sudo apt-get install libatomic-ops-dev
5+
6+
set -e
7+
8+
if ! test -f vlib/v/compiler_errors_test.v; then
9+
echo "this script should be run in V's main repo folder!"
10+
exit 1
11+
fi
12+
13+
export CURRENT_SCRIPT_PATH=$(realpath "$0")
14+
15+
export CC="${CC:-gcc}"
16+
export TCC_FOLDER="${TCC_FOLDER:-thirdparty/tcc}"
17+
export LIBGC_COMMIT="${LIBGC_COMMIT:-master}"
18+
mkdir -p $TCC_FOLDER/lib/
19+
20+
echo " CC: $CC"
21+
echo " TCC_FOLDER: $TCC_FOLDER"
22+
echo "LIBGC_COMMIT: $LIBGC_COMMIT"
23+
echo ===============================================================
24+
25+
rm -rf bdwgc/
26+
27+
pushd .
28+
git clone https://github.com/ivmai/bdwgc
29+
cd bdwgc/
30+
31+
git checkout $LIBGC_COMMIT
32+
export LIBGC_COMMIT_FULL_HASH=$(git rev-parse HEAD)
33+
34+
./autogen.sh
35+
36+
CC=$CC CFLAGS='-fPIC' LDFLAGS='-fPIC' ./configure \
37+
--disable-dependency-tracking \
38+
--disable-docs \
39+
--enable-handle-fork=yes \
40+
--enable-rwlock \
41+
--enable-threads=pthreads \
42+
--enable-static \
43+
--enable-shared=no \
44+
--enable-parallel-mark \
45+
--enable-single-obj-compilation \
46+
--enable-gc-debug \
47+
--with-libatomic-ops=yes \
48+
--enable-sigrt-signals
49+
50+
make
51+
52+
popd
53+
54+
cp bdwgc/.libs/libgc.a $TCC_FOLDER/lib/libgc.a
55+
56+
date > $TCC_FOLDER/lib/libgc_build_on_date.txt
57+
echo $LIBGC_COMMIT_FULL_HASH > $TCC_FOLDER/lib/libgc_build_source_hash.txt
58+
uname -a > $TCC_FOLDER/lib/libgc_build_machine_uname.txt
59+
60+
ls -la $TCC_FOLDER/lib/libgc.a
61+
echo "Done compiling libgc, at commit $LIBGC_COMMIT , full hash: $LIBGC_COMMIT_FULL_HASH . The static library is in $TCC_FOLDER/lib/libgc.a "

0 commit comments

Comments
 (0)