#!/usr/bin/make -f export DH_VERBOSE = 1 export deb_build_dir = /tmp/deb_build export name = occlum-toolchains-gcc export buildroot := $(deb_build_dir)/$(name)/debian/$(name) export tmp_build_dir = $(deb_build_dir)/$(name)/tmp_build export install_dir = $(buildroot)/opt/occlum/toolchains/gcc SHELL = /bin/bash # Needed by musl-cross-make config TARGET = x86_64-linux-musl MUSL_REPO = https://github.com/occlum/musl MUSL_VER = 1.1.24 GCC_VER = 8.3.0 # Users can pass "-j$(nproc)" by specifying this env. # This is not enabled by default because under certain scenarios, # make will use too many jobs and gcc will be killed because out # of memory. BUILD_OPTIONS += .ONESHELL: prepare_musl override_dh_install %: dh $@ # All rules executed in one shell prepare_musl: rm -rf $(tmp_build_dir) rm -rf $(install_dir) mkdir -p $(tmp_build_dir) cd $(tmp_build_dir) git clone https://github.com/occlum/musl-cross-make cd musl-cross-make git checkout 0.9.9.hotfix cp $(deb_build_dir)/$(name)/debian/0014-libgomp-*.diff patches/gcc-$(GCC_VER) cat > config.mak < $(install_dir)/bin/occlum-gcc < $(install_dir)/bin/occlum-g++ < $(install_dir)/bin/occlum-ld <