Skip to content
Snippets Groups Projects
Commit 545357f5 authored by antoo98's avatar antoo98
Browse files

tried building the project as well and made some progress (can't tell how much...

tried building the project as well and made some progress (can't tell how much is missing to build everything)
parent d44512d4
No related branches found
No related tags found
No related merge requests found
--- sancus-main/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h 2019-11-13 03:18:57.226325476 +0100
+++ sancus-main/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.patched.h 2019-11-13 03:18:52.269658941 +0100
@@ -687,7 +687,7 @@
uint32_t getTrampolineSize() const { return RemoteTrampolineSize; }
- Expected<std::vector<char>> readMem(char *Dst, JITTargetAddress Src,
+ Expected<std::vector<unsigned char>> readMem(char *Dst, JITTargetAddress Src,
uint64_t Size) {
// Check for an 'out-of-band' error, e.g. from an MM destructor.
if (ExistingError)
--- sancus-main/Makefile.pkgs 2019-11-13 08:50:02.266565018 +0100
+++ sancus-main/Makefile.patched.pkgs 2019-11-13 08:49:48.833232042 +0100
@@ -4,8 +4,13 @@
# ---------------------------------------------------------------------------
# Package config for TI MSPGCC
-TI_MSPGCC_VER = 6.4.0.32
-TI_MSPGCC_SRC_DIR = msp430-gcc-$(TI_MSPGCC_VER)_source-full
+# CHANGE:
+# - changed to version 8.3.0.16, because 6.4.0.32 couldn't be found online anymore
+# - changed src_dir template, because the naming sheme was changed
+# TI_MSPGCC_VER = 6.4.0.32
+# TI_MSPGCC_SRC_DIR = msp430-gcc-$(TI_MSPGCC_VER)_source-full
+TI_MSPGCC_VER = 8.3.0.16
+TI_MSPGCC_SRC_DIR = msp430-gcc-$(TI_MSPGCC_VER)-source-full
TI_MSPGCC_SRC_TBZ = $(TI_MSPGCC_SRC_DIR).tar.bz2
TI_MSPGCC_SRC_URL = http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/$(TI_MSPGCC_SRC_TBZ)
TI_MSPGCC_PREFIX = /usr/local
#!/bin/sh
# # Patches:
# - anton_fix_llvm_error.patch
# On my system, when trying to build sancus-main, target 'llvm-build',
# a conversion error in a C++ file deep down the directory tree caused the
# build to fail. At least for me, that fixed the problem
# - anton_fix_mspgcc_version.patch
# Apparently TI MSPGCC version 6.4.0.32 isn't online anymore, so I upgraded
# to version 8.3.0.16
# Make sure we are in the dir the script is in,
# because the paths in the patchfiles are realtive to this dir
# Absolute path to this script, e.g. /home/user/bin/foo.sh
script=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
scriptpath=$(dirname "$script")
cd $scriptpath
patchfile=
usage() {
echo "usage: $0 [--unpatch] patchfile.patch"
}
do_patch() {
# p0 means that the paths in the .patch file don't need be stripped
# (they are relative to the current directory)
patch -p0 --forward < $patchfile
}
do_unpatch() {
patch -p0 -R < $patchfile; \
}
case $1 in
-h | --help )
usage
;;
-u | --unpatch | --undo )
patchfile=$2
do_unpatch
;;
--patch | --apply)
patchfile=$2
do_patch
;;
"" )
usage
exit 1
;;
* )
patchfile=$1
do_patch
;;
esac
\ No newline at end of file
# Steps i took to build/install the toolchain on arch
1. get sancus-main repo
```(sh)
git clone git@github.com:sancus-pma/sancus-main.git
```
or
```(sh)
git clone https://github.com/sancus-pma/sancus-main.git
```
2. ```(sh)
cd sancus-main`
```
3. ```(sh)
make llvm-build
```
* On my machine the compilation failed due to an invalid type signature
* If that is the case for you too, I created a patch that fixes the problem
* ```(sh)
../apply_patch.sh ../anton_fix_llvm_error.patch
```
* (retry `make`)
4. ```(sh)
make llvm-inst
```
5. Building TI MSPGCC will most likely also fail, because the specified version isn't online anymore (at least when i looked). To fix this, there is another patch that adjusts the MSPGCC version to 8.3.0.16 (hoping that everything is backwards compatible)
```(sh)
../apply_patch.sh ../anton_fix_mspgcc_version.patch
make ti-mspgcc-build
```
6. ```(sh)
make ti-mspgcc-inst
```
7. Install [gcc-msp430 (AUR)](https://aur.archlinux.org/packages/gcc-msp430/)
```(sh)
yay -S binutils-msp430 gcc-msp430 msp430-libc msp430mcu
```
8. Trick `make` into thinking target `debian-deps` was correctly installed and install python3 pip packages
```(sh)
touch debian-deps
make pip-deps
```
## Todo
* Maybe write this as a Makefile itself
* Find out whether the llvm error occurs on other systems too. Maybe it was just my system that was badly configured
* Is `make ti-mspgcc-build` necessary? There is [msp430-elf-binutils (AUR)](https://aur.archlinux.org/packages/msp430-elf-binutils/), maybe that works too?
* Look into:
* [https://aur.archlinux.org/packages/ti-msp430ware/]
* [https://aur.archlinux.org/packages/python-msp430-tools/]
* [https://aur.archlinux.org/packages/mspgcc-ti/]
*
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment