1 This is Debian packaging of the Hercules compiler provided by ETHZ.
3 Compiling the compiler manually
4 ===============================
6 To compile the compiler, without creating the Debian package, run:
8 apt install quilt cmake ninja-build python3
10 git submodule update --init
11 export QUILT_PATCHES=debian/patches
12 export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
18 This will install the compiler and related stuff into
19 ~/opt/hercules-compiler.
21 Creating Debian packages
22 ========================
27 A simple method to create a native Debian package is the following:
29 apt install build-essential cmake ninja-build python3
31 dpkg-buildpackage -uc -us
33 Sbuild method - native
34 ----------------------
36 You can also use the sbuild tool to create the native package. The
37 advantage is that the build happens in a clean environment, ensuring
38 that only distribution-provided packages are used for building.
40 Setup the sbuild chroot as documented at
41 https://wiki.debian.org/sbuild and then build the package with:
49 Cross-compilation for different architecture is more complex,
50 especially in case of Ubuntu Xenial. Se let's start with simpler
51 variant - Debian Stretch.
53 ### Debian Stretch ###
55 For Debian Stretch, setup the chroot as above and install
56 qemu-user-static to both your host system and the build chroot:
58 sudo apt-get install qemu-user-static
59 sbuild-apt <chroot-name> apt-get install qemu-user-static
61 Then build the package with:
66 ### Ubuntu Xenial (TX2) ###
68 Setup the chroot as above. Ubuntu Xenial does not have
69 qemu-user-static package so copy the static binaries from your host:
71 sudo apt-get install qemu-user-static
72 cp /usr/bin/qemu-aarch64-static /path/to/your/chroot/xenaial/usr/bin
74 Then modify /etc/apt/sources.list to contain the URL of arm64 package
75 repository. This is the sources.list that I use:
77 deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial main universe
78 deb-src http://cz.archive.ubuntu.com/ubuntu/ xenial main universe
80 deb [arch=arm64] http://ports.ubuntu.com/ xenial main universe
82 Furthermore, Xenial has too old packages to cross build LLVM. For that
83 reason, we backport the following packages: `cmake_3.7.2-1` from
84 Debian Stretch and `ninja-build_1.8.2-1` from Debian unstable. Just
85 download the corresponding source packages (from e.g.
86 https://packages.debian.org/source/stretch/cmake) and run
88 sbuild -d xenial cmake_3.7.2-1.dsc
89 sbuild -d xenial ninja-build_1.8.2-1.dsc
91 Then install the created packages into the xenial chroot.
93 Then build the package by
96 sbuild --host=arm64 -d xenial --add-depends="libc6-dev, libstdc++-5-dev" --build-failed-commands='%s'
98 The `--build-failed-commands` switch ensures that a shell is run if
99 the build fails to allow investigating the problem.