[installer] Update musl-gcc debian build
This commit is contained in:
		
							parent
							
								
									b8e516d351
								
							
						
					
					
						commit
						0910ac18e2
					
				| @ -30,24 +30,11 @@ BUILD_OPTIONS += | |||||||
| prepare_musl: | prepare_musl: | ||||||
| 	rm -rf $(tmp_build_dir) | 	rm -rf $(tmp_build_dir) | ||||||
| 	rm -rf $(install_dir) | 	rm -rf $(install_dir) | ||||||
| 	mkdir -p $(tmp_build_dir) | 	mkdir -p $(src_dir) | ||||||
| 	cd $(tmp_build_dir) | 	mkdir -p $(install_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 <<EOF |  | ||||||
| 		TARGET = $(TARGET) |  | ||||||
| 		OUTPUT = $(install_dir) |  | ||||||
| 		COMMON_CONFIG += CFLAGS="-fPIC" CXXFLAGS="-fPIC" LDFLAGS="-pie" |  | ||||||
| 		GCC_VER = $(GCC_VER) |  | ||||||
| 		MUSL_VER = git-$(MUSL_VER) |  | ||||||
| 		MUSL_REPO = $(MUSL_REPO) |  | ||||||
| 	EOF |  | ||||||
| 
 | 
 | ||||||
| override_dh_auto_build: prepare_musl | override_dh_auto_build: prepare_musl | ||||||
| 	cd $(tmp_build_dir)/musl-cross-make; \ | 	echo "skip override_dh_auto_build" | ||||||
| 		make $(BUILD_OPTIONS) |  | ||||||
| 
 | 
 | ||||||
| # We create symlinks in /usr/local | # We create symlinks in /usr/local | ||||||
| override_dh_usrlocal: | override_dh_usrlocal: | ||||||
| @ -59,26 +46,8 @@ override_dh_fixperms: | |||||||
| 	chmod 755 $(install_dir)/$(TARGET)/lib/libc.so | 	chmod 755 $(install_dir)/$(TARGET)/lib/libc.so | ||||||
| 
 | 
 | ||||||
| override_dh_install: | override_dh_install: | ||||||
| 	cd $(tmp_build_dir)/musl-cross-make | 	mkdir -p $(install_dir) | ||||||
| 	make install | 	cp -rf /opt/occlum/toolchains/gcc/* $(install_dir)/ | ||||||
| 	cat > $(install_dir)/bin/occlum-gcc <<EOF |  | ||||||
| 		#!/bin/bash |  | ||||||
| 		/opt/occlum/toolchains/gcc/bin/$(TARGET)-gcc -fPIC -pie -Wl,-rpath,/opt/occlum/toolchains/gcc/$(TARGET)/lib "\$$@" |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	cat > $(install_dir)/bin/occlum-g++ <<EOF |  | ||||||
| 		#!/bin/bash |  | ||||||
| 		/opt/occlum/toolchains/gcc/bin/$(TARGET)-g++ -fPIC -pie -Wl,-rpath,/opt/occlum/toolchains/gcc/$(TARGET)/lib "\$$@" |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	cat > $(install_dir)/bin/occlum-ld <<EOF |  | ||||||
| 		#!/bin/bash |  | ||||||
| 		/opt/occlum/toolchains/gcc/bin/$(TARGET)-ld -pie -rpath /opt/occlum/toolchains/gcc/$(TARGET)/lib "\$$@" |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	chmod +x $(install_dir)/bin/occlum-gcc |  | ||||||
| 	chmod +x $(install_dir)/bin/occlum-g++ |  | ||||||
| 	chmod +x $(install_dir)/bin/occlum-ld |  | ||||||
| 
 | 
 | ||||||
| 	mkdir -p $(buildroot)/lib | 	mkdir -p $(buildroot)/lib | ||||||
| 	pushd $(buildroot)/lib | 	pushd $(buildroot)/lib | ||||||
| @ -88,10 +57,6 @@ override_dh_install: | |||||||
| 	pushd $(buildroot)/usr/local | 	pushd $(buildroot)/usr/local | ||||||
| 	ln -sf /opt/occlum/toolchains/gcc occlum | 	ln -sf /opt/occlum/toolchains/gcc occlum | ||||||
| 	popd | 	popd | ||||||
| 	pushd $(install_dir)/bin |  | ||||||
| 	ln -sf /opt/occlum/toolchains/gcc/bin/x86_64-linux-musl-gcc-ar occlum-ar |  | ||||||
| 	ln -sf /opt/occlum/toolchains/gcc/bin/x86_64-linux-musl-strip occlum-strip |  | ||||||
| 	popd |  | ||||||
| 
 | 
 | ||||||
| 	mkdir -p $(buildroot)/etc/profile.d | 	mkdir -p $(buildroot)/etc/profile.d | ||||||
| 	cp $(deb_build_dir)/$(name)/debian/occlum-gcc.sh $(buildroot)/etc/profile.d | 	cp $(deb_build_dir)/$(name)/debian/occlum-gcc.sh $(buildroot)/etc/profile.d | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user