Rename installer to work with musl-gcc
This commit is contained in:
parent
3cb3165f8b
commit
5abfe64960
@ -32,7 +32,7 @@ jobs:
|
|||||||
run: docker run -itd --name=ubuntu -v $GITHUB_WORKSPACE:/root/workspace occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04
|
run: docker run -itd --name=ubuntu -v $GITHUB_WORKSPACE:/root/workspace occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04
|
||||||
|
|
||||||
- name: Build deb packages
|
- name: Build deb packages
|
||||||
run: docker exec ubuntu bash -c "cd /root/workspace/occlum/tools/installer/deb; make; make c/c++"
|
run: docker exec ubuntu bash -c "cd /root/workspace/occlum/tools/installer/deb; make; make musl-gcc"
|
||||||
|
|
||||||
- name: Update deb repo
|
- name: Update deb repo
|
||||||
run: docker exec ubuntu bash -c 'apt-get update; apt-get install -y tree apt-utils gnupg reprepro rng-tools aptly; rm -rf /root/.gnupg;
|
run: docker exec ubuntu bash -c 'apt-get update; apt-get install -y tree apt-utils gnupg reprepro rng-tools aptly; rm -rf /root/.gnupg;
|
||||||
@ -49,7 +49,7 @@ jobs:
|
|||||||
run: docker run -itd --name=centos -v $GITHUB_WORKSPACE:/root/workspace occlum/occlum:${{ env.OCCLUM_VERSION }}-centos8.1
|
run: docker run -itd --name=centos -v $GITHUB_WORKSPACE:/root/workspace occlum/occlum:${{ env.OCCLUM_VERSION }}-centos8.1
|
||||||
|
|
||||||
- name: Build rpm packages
|
- name: Build rpm packages
|
||||||
run: docker exec centos bash -c "cd /root/workspace/occlum/tools/installer/rpm; make; make c/c++"
|
run: docker exec centos bash -c "cd /root/workspace/occlum/tools/installer/rpm; make; make musl-gcc"
|
||||||
|
|
||||||
- name: Configure the centos container
|
- name: Configure the centos container
|
||||||
run: docker exec centos bash -c 'yum install -y gnupg pinentry createrepo rpm-sign ca-certificates; rm -rf /root/.gnupg;
|
run: docker exec centos bash -c 'yum install -y gnupg pinentry createrepo rpm-sign ca-certificates; rm -rf /root/.gnupg;
|
||||||
|
@ -26,7 +26,7 @@ If a user wants to build his application on a platform installed with Occlum ins
|
|||||||
cd tools/installer/rpm
|
cd tools/installer/rpm
|
||||||
make <language option>
|
make <language option>
|
||||||
```
|
```
|
||||||
Now, only `c/c++` and `golang` options are supported. And the installer can be found under `build/rpms`.
|
Now, only `musl-gcc` and `golang` options are supported. And the installer can be found under `build/rpms`.
|
||||||
|
|
||||||
### How to Use
|
### How to Use
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ If a user wants to build his application on a platform installed with Occlum ins
|
|||||||
cd tools/installer/deb
|
cd tools/installer/deb
|
||||||
make <language option>
|
make <language option>
|
||||||
```
|
```
|
||||||
Now, only `c/c++` and `golang` options are supported. And the installer can be found under `build/debs`.
|
Now, only `musl-gcc` and `golang` options are supported. And the installer can be found under `build/debs`.
|
||||||
|
|
||||||
### How to Use
|
### How to Use
|
||||||
|
|
||||||
|
@ -10,9 +10,18 @@ VERSION_NUM = $(MAJOR_VER_NUM).$(MINOR_VER_NUM).$(PATCH_VER_NUM)
|
|||||||
DEB_BUILD_DIR := /tmp/deb_build
|
DEB_BUILD_DIR := /tmp/deb_build
|
||||||
PACKAGE_DIR := /tmp
|
PACKAGE_DIR := /tmp
|
||||||
|
|
||||||
|
C_TOOLCHAIN_PACKAGE_NAME := occlum-toolchains-gcc
|
||||||
|
|
||||||
|
# Version number for toolchain packages
|
||||||
|
# The version numbers are only needed to update when the toolchains are updated.
|
||||||
|
# When updating the toolchain packages for Deb, please first update RPM configuration. And then
|
||||||
|
# update the "changelog" file accordingly.
|
||||||
|
MUSL_VERSION := 0.15.0
|
||||||
|
GOLAN_VERSION := 0.16.0
|
||||||
|
|
||||||
GO_PATCH = $(PROJECT_DIR)/tools/toolchains/golang/adapt-golang-to-occlum.patch
|
GO_PATCH = $(PROJECT_DIR)/tools/toolchains/golang/adapt-golang-to-occlum.patch
|
||||||
|
|
||||||
.PHONY: all main config_files main_deps c/c++ deps_c clean clean-build
|
.PHONY: all main config_files main_deps musl-gcc deps_c clean clean-build
|
||||||
|
|
||||||
all: main
|
all: main
|
||||||
|
|
||||||
@ -42,18 +51,18 @@ main_deps:
|
|||||||
git submodule deinit -f . ; \
|
git submodule deinit -f . ; \
|
||||||
rm -rf $(DEB_BUILD_DIR)/occlum-$(VERSION_NUM)/occlum-src/{build,demos}
|
rm -rf $(DEB_BUILD_DIR)/occlum-$(VERSION_NUM)/occlum-src/{build,demos}
|
||||||
|
|
||||||
c/c++: deps_c
|
musl-gcc: deps_c
|
||||||
cd $(DEB_BUILD_DIR)/occlum-toolchains-gcc ; \
|
cd $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME) ; \
|
||||||
dpkg-buildpackage -us -uc
|
dpkg-buildpackage -us -uc
|
||||||
cp -t $(TARGET_DIR) $(DEB_BUILD_DIR)/occlum-toolchains-gcc*.deb $(DEB_BUILD_DIR)/occlum-toolchains-gcc-dbgsym*.ddeb
|
cp -t $(TARGET_DIR) $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)*.deb $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)-dbgsym*.ddeb
|
||||||
|
|
||||||
deps_c:
|
deps_c:
|
||||||
mkdir -p $(TARGET_DIR)
|
mkdir -p $(TARGET_DIR)
|
||||||
mkdir -p $(DEB_BUILD_DIR)/occlum-toolchains-gcc
|
mkdir -p $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)
|
||||||
cp -r toolchains/gcc $(DEB_BUILD_DIR)/occlum-toolchains-gcc/debian
|
cp -r toolchains/musl-gcc $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)/debian
|
||||||
cp $(PROJECT_DIR)/tools/toolchains/gcc/0014-libgomp-futex-occlum.diff $(DEB_BUILD_DIR)/occlum-toolchains-gcc/debian
|
cp $(PROJECT_DIR)/tools/toolchains/musl-gcc/0014-libgomp-futex-occlum.diff $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)/debian
|
||||||
cp $(PROJECT_DIR)/tools/installer/rpm/toolchains/gcc/occlum-gcc.sh $(DEB_BUILD_DIR)/occlum-toolchains-gcc/debian
|
cp $(PROJECT_DIR)/tools/installer/rpm/toolchains/musl-gcc/occlum-gcc.sh $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)/debian
|
||||||
echo " echo 'Please execute command \"source /etc/profile\" to validate envs immediately' " > $(DEB_BUILD_DIR)/occlum-toolchains-gcc/debian/occlum-gcc.postinst
|
echo " echo 'Please execute command \"source /etc/profile\" to validate envs immediately' " > $(DEB_BUILD_DIR)/$(C_TOOLCHAIN_PACKAGE_NAME)/debian/occlum-gcc.postinst
|
||||||
|
|
||||||
golang: deps_golang
|
golang: deps_golang
|
||||||
cd $(DEB_BUILD_DIR)/occlum-toolchains-golang ; \
|
cd $(DEB_BUILD_DIR)/occlum-toolchains-golang ; \
|
||||||
|
@ -9,19 +9,21 @@ VERSION_NUM := $(MAJOR_VER_NUM).$(MINOR_VER_NUM).$(PATCH_VER_NUM)
|
|||||||
|
|
||||||
# Occlum specific version
|
# Occlum specific version
|
||||||
MUSL_VERSION = 0.15.0
|
MUSL_VERSION = 0.15.0
|
||||||
|
GOLANG_VERSION = 0.16.0
|
||||||
|
|
||||||
RPM_FILELIST = occlum-filelist occlum-pal-filelist occlum-runtime-filelist
|
RPM_FILELIST = occlum-filelist occlum-pal-filelist occlum-runtime-filelist
|
||||||
EXPORT_SCRIPT = occlum-pal.sh occlum-runtime.sh
|
EXPORT_SCRIPT = occlum-pal.sh occlum-runtime.sh
|
||||||
|
|
||||||
GCC_PATCH = toolchains/gcc/musl-cross-make-disable-download.patch
|
GCC_PATCH = toolchains/musl-gcc/musl-cross-make-disable-download.patch
|
||||||
GCC_SCRIPT = toolchains/gcc/occlum-gcc.sh
|
GCC_SCRIPT = toolchains/musl-gcc/occlum-gcc.sh
|
||||||
|
OCCLUM_MUSL_PATCH := $(PROJECT_DIR)/tools/toolchains/musl-gcc/0014-libgomp-futex-occlum.diff
|
||||||
|
|
||||||
GO_PATCH = $(PROJECT_DIR)/tools/toolchains/golang/adapt-golang-to-occlum.patch
|
GO_PATCH = $(PROJECT_DIR)/tools/toolchains/golang/adapt-golang-to-occlum.patch
|
||||||
GO_SCRIPT = toolchains/golang/occlum-go.sh
|
GO_SCRIPT = toolchains/golang/occlum-go.sh
|
||||||
|
|
||||||
PACKAGE_DIR = /tmp
|
PACKAGE_DIR = /tmp
|
||||||
|
|
||||||
.PHONY: all main main_deps c/c++ deps_c clean golang
|
.PHONY: all main main_deps musl-gcc deps_c clean golang
|
||||||
|
|
||||||
all: main
|
all: main
|
||||||
|
|
||||||
@ -47,8 +49,8 @@ $(PACKAGE_DIR)/$(VERSION_NUM).tar.gz:
|
|||||||
rm -rf $(PACKAGE_DIR)/occlum-$(VERSION_NUM)/build
|
rm -rf $(PACKAGE_DIR)/occlum-$(VERSION_NUM)/build
|
||||||
@cd $(PACKAGE_DIR) && tar -cvzf "$$HOME/rpmbuild/SOURCES/$(VERSION_NUM).tar.gz" occlum-$(VERSION_NUM)
|
@cd $(PACKAGE_DIR) && tar -cvzf "$$HOME/rpmbuild/SOURCES/$(VERSION_NUM).tar.gz" occlum-$(VERSION_NUM)
|
||||||
|
|
||||||
c/c++: deps_c
|
musl-gcc: deps_c
|
||||||
@rpmbuild -ba --define '_musl_version $(MUSL_VERSION)' toolchains/gcc/occlum-toolchains-gcc.spec
|
@rpmbuild -ba --define '_musl_version $(MUSL_VERSION)' toolchains/musl-gcc/occlum-toolchains-gcc.spec
|
||||||
@mv $$HOME/rpmbuild $$HOME/rpmbuild-occlum-toolchains-gcc
|
@mv $$HOME/rpmbuild $$HOME/rpmbuild-occlum-toolchains-gcc
|
||||||
@cp $$HOME/rpmbuild-occlum-toolchains-gcc/RPMS/x86_64/*.rpm $(TARGET_DIR)
|
@cp $$HOME/rpmbuild-occlum-toolchains-gcc/RPMS/x86_64/*.rpm $(TARGET_DIR)
|
||||||
@echo "$$(ls $$HOME/rpmbuild-occlum-toolchains-gcc/RPMS/x86_64) can be found at $(TARGET_DIR)"
|
@echo "$$(ls $$HOME/rpmbuild-occlum-toolchains-gcc/RPMS/x86_64) can be found at $(TARGET_DIR)"
|
||||||
@ -60,12 +62,12 @@ $$HOME/rpmbuild/SOURCES/$(GCC_PATCH):
|
|||||||
@if [ -d $$HOME/rpmbuild ]; then \
|
@if [ -d $$HOME/rpmbuild ]; then \
|
||||||
mv $$HOME/rpmbuild $$HOME/rpmbuild-old-$$(date +%Y%m%d-%T); fi
|
mv $$HOME/rpmbuild $$HOME/rpmbuild-old-$$(date +%Y%m%d-%T); fi
|
||||||
@mkdir -p $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
|
@mkdir -p $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
|
||||||
@MUSL_VERSION=$(MUSL_VERSION) toolchains/gcc/download_sources.sh
|
@MUSL_VERSION=$(MUSL_VERSION) toolchains/musl-gcc/download_sources.sh
|
||||||
@spectool -g -R --define '_musl_version $(MUSL_VERSION)' toolchains/gcc/occlum-toolchains-gcc.spec
|
@spectool -g -R --define '_musl_version $(MUSL_VERSION)' toolchains/musl-gcc/occlum-toolchains-gcc.spec
|
||||||
@cp -t $$HOME/rpmbuild/SOURCES $(GCC_PATCH) $(GCC_SCRIPT)
|
@cp -t $$HOME/rpmbuild/SOURCES $(GCC_PATCH) $(GCC_SCRIPT) $(OCCLUM_MUSL_PATCH)
|
||||||
|
|
||||||
golang: $$HOME/rpmbuild/SOURCES/$(GO_PATCH)
|
golang: $$HOME/rpmbuild/SOURCES/$(GO_PATCH)
|
||||||
@rpmbuild -ba toolchains/golang/occlum-toolchains-golang.spec
|
@rpmbuild -ba --define '_golang_version $(GOLANG_VERSION)' toolchains/golang/occlum-toolchains-golang.spec
|
||||||
@mv $$HOME/rpmbuild $$HOME/rpmbuild-occlum-toolchains-golang
|
@mv $$HOME/rpmbuild $$HOME/rpmbuild-occlum-toolchains-golang
|
||||||
@cp $$HOME/rpmbuild-occlum-toolchains-golang/RPMS/x86_64/*.rpm $(TARGET_DIR)
|
@cp $$HOME/rpmbuild-occlum-toolchains-golang/RPMS/x86_64/*.rpm $(TARGET_DIR)
|
||||||
@echo "$$(ls $$HOME/rpmbuild-occlum-toolchains-golang/RPMS/x86_64) can be found at $(TARGET_DIR)"
|
@echo "$$(ls $$HOME/rpmbuild-occlum-toolchains-golang/RPMS/x86_64) can be found at $(TARGET_DIR)"
|
||||||
@ -77,7 +79,7 @@ $$HOME/rpmbuild/SOURCES/$(GO_PATCH):
|
|||||||
mv $$HOME/rpmbuild $$HOME/rpmbuild-old-$$(date +%Y%m%d-%T); fi
|
mv $$HOME/rpmbuild $$HOME/rpmbuild-old-$$(date +%Y%m%d-%T); fi
|
||||||
@rm -rf $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SRPMS} # tmp
|
@rm -rf $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SRPMS} # tmp
|
||||||
@mkdir -p $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
|
@mkdir -p $$HOME/rpmbuild/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
|
||||||
@spectool -g -R toolchains/golang/occlum-toolchains-golang.spec
|
@spectool -g -R --define '_golang_version $(GOLANG_VERSION)' toolchains/golang/occlum-toolchains-golang.spec
|
||||||
@cp -t $$HOME/rpmbuild/SOURCES $(GO_PATCH) $(GO_SCRIPT)
|
@cp -t $$HOME/rpmbuild/SOURCES $(GO_PATCH) $(GO_SCRIPT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
%define _unpackaged_files_terminate_build 0
|
%define _unpackaged_files_terminate_build 0
|
||||||
|
|
||||||
Name: occlum-toolchains-golang
|
Name: occlum-toolchains-golang
|
||||||
Version: 0.16.0
|
Version: %{_golang_version}
|
||||||
Release: %{centos_base_release}%{?dist}
|
Release: %{centos_base_release}%{?dist}
|
||||||
Summary: occlum toolchains golang
|
Summary: occlum toolchains golang
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ Source9: musl-%{_musl_version}.tar.gz
|
|||||||
Source10: occlum-gcc.sh
|
Source10: occlum-gcc.sh
|
||||||
|
|
||||||
Patch0: musl-cross-make-disable-download.patch
|
Patch0: musl-cross-make-disable-download.patch
|
||||||
|
Patch1: 0014-libgomp-futex-occlum.diff
|
||||||
|
|
||||||
ExclusiveArch: x86_64
|
ExclusiveArch: x86_64
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ Occlum toolchains gcc
|
|||||||
%setup -q -T -D -a 1
|
%setup -q -T -D -a 1
|
||||||
|
|
||||||
# This patch replaces syscall instruction with libc's syscall wrapper
|
# This patch replaces syscall instruction with libc's syscall wrapper
|
||||||
cp occlum-%{version}/tools/toolchains/gcc/0014-libgomp-*.diff musl-cross-make-0.9.9.hotfix/patches/gcc-%{GCC_VER}/
|
cp %{PATCH1} musl-cross-make-0.9.9.hotfix/patches/gcc-%{GCC_VER}/
|
||||||
|
|
||||||
pushd musl-cross-make-0.9.9.hotfix
|
pushd musl-cross-make-0.9.9.hotfix
|
||||||
mkdir -p sources/gcc-%{GCC_VER}.tar.xz.tmp && cp %{SOURCE2} sources/gcc-%{GCC_VER}.tar.xz.tmp
|
mkdir -p sources/gcc-%{GCC_VER}.tar.xz.tmp && cp %{SOURCE2} sources/gcc-%{GCC_VER}.tar.xz.tmp
|
Loading…
Reference in New Issue
Block a user