Fix some dependency errors when running on CentOS 8

This commit is contained in:
Hui, Chunyang 2020-08-18 16:23:32 +00:00
parent 33e840143a
commit 89c292e2df
4 changed files with 11 additions and 12 deletions

@ -4,7 +4,7 @@
### How to Build ### How to Build
To build RPM packages, a docker container with Occlum CentOS image is needed. Execute below commands under the occlum directory: To build RPM packages, a docker container with Occlum CentOS image (based on CentOS 8.1) is needed. Execute below commands under the occlum directory:
``` ```
cd tools/installer/rpm cd tools/installer/rpm
make make
@ -59,5 +59,6 @@ source /etc/profile
Finally, you are good to go! Finally, you are good to go!
### Build DEB Installer
## DEB Installer
TBD TBD

@ -25,7 +25,7 @@ BuildRequires: cmake
BuildRequires: libtool BuildRequires: libtool
BuildRequires: ocaml BuildRequires: ocaml
BuildRequires: ocaml-ocamlbuild BuildRequires: ocaml-ocamlbuild
BuildRequires: python BuildRequires: python2
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: libcurl-devel BuildRequires: libcurl-devel
BuildRequires: git BuildRequires: git

@ -16,7 +16,7 @@ Group: Development/Libraries
License: BSD License License: BSD License
URL: https://github.com/occlum/occlum URL: https://github.com/occlum/occlum
Source0: https://github.com/occlum/occlum/archive/%{_musl_version}.tar.gz Source0: https://github.com/occlum/occlum/archive/%{_musl_version}.tar.gz
Source1: https://github.com/richfelker/musl-cross-make/archive/v0.9.9.tar.gz Source1: https://github.com/occlum/musl-cross-make/archive/0.9.9.hotfix.tar.gz
Source2: https://ftp.gnu.org/pub/gnu/gcc/gcc-%{GCC_VER}/gcc-%{GCC_VER}.tar.xz Source2: https://ftp.gnu.org/pub/gnu/gcc/gcc-%{GCC_VER}/gcc-%{GCC_VER}.tar.xz
Source3: config.sub Source3: config.sub
Source4: https://ftp.gnu.org/pub/gnu/binutils/binutils-2.33.1.tar.xz Source4: https://ftp.gnu.org/pub/gnu/binutils/binutils-2.33.1.tar.xz
@ -33,7 +33,6 @@ Patch0: musl-cross-make-disable-download.patch
ExclusiveArch: x86_64 ExclusiveArch: x86_64
BuildRequires: git BuildRequires: git
BuildRequires: devtoolset-9-gcc-c++
%description %description
Occlum toolchains gcc Occlum toolchains gcc
@ -43,9 +42,9 @@ 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/patches/gcc-%{GCC_VER}/ cp occlum-%{version}/tools/toolchains/gcc/0014-libgomp-*.diff musl-cross-make-0.9.9.hotfix/patches/gcc-%{GCC_VER}/
pushd musl-cross-make-0.9.9 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
mkdir -p sources/config.sub.tmp && cp %{SOURCE3} sources/config.sub.tmp mkdir -p sources/config.sub.tmp && cp %{SOURCE3} sources/config.sub.tmp
mkdir -p sources/binutils-2.33.1.tar.xz.tmp && cp %{SOURCE4} sources/binutils-2.33.1.tar.xz.tmp mkdir -p sources/binutils-2.33.1.tar.xz.tmp && cp %{SOURCE4} sources/binutils-2.33.1.tar.xz.tmp
@ -58,8 +57,7 @@ tar xf %{SOURCE9}
popd popd
%build %build
source /opt/rh/devtoolset-9/enable cd musl-cross-make-0.9.9.hotfix
cd musl-cross-make-0.9.9
cat > config.mak <<EOF cat > config.mak <<EOF
TARGET = %{TARGET} TARGET = %{TARGET}
COMMON_CONFIG += CFLAGS="-fPIC" CXXFLAGS="-fPIC" LDFLAGS="-pie" COMMON_CONFIG += CFLAGS="-fPIC" CXXFLAGS="-fPIC" LDFLAGS="-pie"
@ -70,7 +68,7 @@ make %{?_smp_mflags}
%install %install
mkdir -p %{buildroot}%{INSTALL_DIR} mkdir -p %{buildroot}%{INSTALL_DIR}
cd musl-cross-make-0.9.9 cd musl-cross-make-0.9.9.hotfix
make install OUTPUT=%{buildroot}%{INSTALL_DIR} make install OUTPUT=%{buildroot}%{INSTALL_DIR}
# Generate the wrappers for executables # Generate the wrappers for executables

@ -15,9 +15,9 @@ mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR} cd ${BUILD_DIR}
# Download musl-cross-make project # Download musl-cross-make project
git clone https://github.com/richfelker/musl-cross-make git clone https://github.com/occlum/musl-cross-make
cd musl-cross-make cd musl-cross-make
git checkout v0.9.9 git checkout 0.9.9.hotfix
# Let musl-cross-make build for x86-64 Linux # Let musl-cross-make build for x86-64 Linux
TARGET=x86_64-linux-musl TARGET=x86_64-linux-musl