-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·35 lines (27 loc) · 870 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -xe
# CFLAGS="-mretpoline -fstack-clash-protection -fcf-protection -fstack-protector-strong -funsigned-char -ffast-math -ffunction-sections -fdata-sections -march=native -Oz --ld-path=/usr/bin/ld.lld"
CFLAGS="-fstack-clash-protection -fcf-protection -fstack-protector-strong -funsigned-char -ffast-math -ffunction-sections -fdata-sections -march=native -Oz"
# CC="clang"
CC="gcc"
cd ./musl/
make clean
./configure CC=$CC CFLAGS=$CFLAGS --exec_prefix=$(pwd) --prefix=$(pwd)/dest
make -j$(nproc) -B
make install
cd ..
nim r numbers.nim
nim c -f\
--cc:$CC \
--gcc.exe:./musl/dest/bin/musl-$CC \
--gcc.linkerexe:./musl/dest/bin/musl-$CC \
-d:release \
-d:danger \
-d:lto \
--mm:arc \
--opt:size \
--passL:"-Wl,--gc-sections" \
--passL:"-static" \
--passC:"$CFLAGS" \
countdown.nim && strip --strip-all countdown
# --passL:"-strip-all" \