diff --git a/common/src/lib.rs b/common/src/lib.rs index 7f9fd55..12d82c9 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -73,8 +73,7 @@ impl Environment { /// /// The key is the name of the package and the value is the installed package. pub fn load_installed_list(&self) -> io::Result> { - let path = util::concat_paths(&self.sysroot, Path::new(INSTALLED_FILE)); - + let path = util::concat_paths(&self.sysroot, INSTALLED_FILE); match util::read_json::>(&path) { Ok(pkgs) => Ok(pkgs), Err(e) if e.kind() == ErrorKind::NotFound => Ok(HashMap::new()), @@ -87,7 +86,7 @@ impl Environment { &self, list: &HashMap, ) -> io::Result<()> { - let path = util::concat_paths(&self.sysroot, Path::new(INSTALLED_FILE)); + let path = util::concat_paths(&self.sysroot, INSTALLED_FILE); util::write_json(&path, list) } diff --git a/cross/.gitignore b/cross/.gitignore index 9633208..9e7a1ce 100644 --- a/cross/.gitignore +++ b/cross/.gitignore @@ -1 +1,2 @@ -toolchain/ \ No newline at end of file +work/ +toolchain/ diff --git a/cross/build.sh b/cross/build.sh index 17042fc..01bd11f 100755 --- a/cross/build.sh +++ b/cross/build.sh @@ -10,7 +10,7 @@ fi # Prepare mkdir -p toolchain/repo PATH="$(pwd)/../target/release:$PATH" -export SYSROOT="$(pwd)/toolchain/" +export SYSROOT="toolchain/" export LOCAL_REPO="toolchain/repo/" # binutils @@ -25,4 +25,4 @@ yes | blimp install musl # clang blimp-builder desc/clang toolchain/repo/ -yes | blimp install clang \ No newline at end of file +yes | blimp install clang diff --git a/cross/desc/clang/build-hook b/cross/desc/clang/build-hook index 3332cca..caaf5b9 100755 --- a/cross/desc/clang/build-hook +++ b/cross/desc/clang/build-hook @@ -42,7 +42,7 @@ cd .. # Build compiler-rt cd compiler-rt-build -cmake \ +LDFLAGS="-nostdlib" cmake \ ../llvm/compiler-rt \ -G Ninja \ -DCMAKE_C_COMPILER="$SYSROOT/bin/clang" \ @@ -62,13 +62,14 @@ cmake \ -DCOMPILER_RT_BUILD_ORC=ON \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \ - -DCMAKE_INSTALL_PREFIX="$SYSROOT/lib/clang/13.0.1/" + -DCMAKE_INSTALL_PREFIX="$SYSROOT/lib/clang/$PKG_VERSION/" ninja -j$JOBS ninja -j$JOBS install cd .. # Patch -ln -fsv ../../lib/clang/13.0.1/lib/linux/clang_rt.crtbegin-i386.o "$SYSROOT/usr/lib/crtbegin.o" +mkdir -p "$SYSROOT/usr/lib" +ln -fsv "../../lib/clang/$PKG_VERSION/lib/linux/clang_rt.crtbegin-i386.o" "$SYSROOT/usr/lib/crtbegin.o" ln -fsv crtbegin.o "$SYSROOT/usr/lib/crtbeginS.o" ln -fsv crtbegin.o "$SYSROOT/usr/lib/crtbeginT.o" -ln -fsv ../../lib/clang/13.0.1/lib/linux/clang_rt.crtend-i386.o "$SYSROOT/usr/lib/crtend.o" +ln -fsv "../../lib/clang/$PKG_VERSION/lib/linux/clang_rt.crtend-i386.o" "$SYSROOT/usr/lib/crtend.o"