-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathset_arm_env.sh
More file actions
executable file
·28 lines (21 loc) · 868 Bytes
/
set_arm_env.sh
File metadata and controls
executable file
·28 lines (21 loc) · 868 Bytes
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
#!/bin/bash
set -ex
# use qemu-user to emulate arm enviroment
# will install gcc & g++ toolchain, libc & libstdc++
# download armtool.alias from https://github.com/bruce30262/CTF
sudo apt update
# install g++ if not exist
if ! command -v g++ &> /dev/null
then
sudo apt install -y g++
fi
cur_dir=$(dirname $(readlink -f $BASH_SOURCE))
gxx_v=$(g++ -v 2>&1 | tail -1 | awk '{print $3}' | awk -F. '{print $1}')
sudo apt install -y qemu-user \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-arm-linux-gnueabi libc6-dev-armel-cross \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
g++-arm-linux-gnueabihf libstdc++-$gxx_v-dev-armhf-cross g++-arm-linux-gnueabi libstdc++-$gxx_v-dev-armel-cross \
g++-aarch64-linux-gnu libstdc++-$gxx_v-dev-arm64-cross \
'binfmt*'
set +x
echo "source armtool.alias to apply the latest arm-toolchain setting."