Further refine sysroot.
* remove need for NASM from sysroot * have peru sync libc separately
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
imports:
|
imports:
|
||||||
sysroot: ./sysroot
|
sysroot: ./sysroot
|
||||||
|
j6libc: ./sysroot
|
||||||
|
|
||||||
curl module sysroot:
|
curl module sysroot:
|
||||||
url: https://f000.backblazeb2.com/file/jsix-os/sysroot-llvm8-20190705.tar.bz2
|
url: https://f000.backblazeb2.com/file/jsix-os/sysroot-llvm8-20190706.tar.bz2
|
||||||
|
unpack: tar
|
||||||
|
export: sysroot/
|
||||||
|
|
||||||
|
curl module j6libc:
|
||||||
|
url: https://f000.backblazeb2.com/file/jsix-os/sysroot-j6libc-0377948.tar.bz2
|
||||||
unpack: tar
|
unpack: tar
|
||||||
export: sysroot/
|
export: sysroot/
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
TARGET="x86_64-elf"
|
TARGET="x86_64-elf"
|
||||||
NASM_VERSION="2.13.03"
|
|
||||||
LLVM_BRANCH="release_80"
|
LLVM_BRANCH="release_80"
|
||||||
|
|
||||||
TOOLS="clang lld" # lld libunwind libcxxabi libcxx"
|
TOOLS="clang lld" # lld libunwind libcxxabi libcxx"
|
||||||
@@ -19,33 +18,6 @@ mkdir -p "${WORK}"
|
|||||||
export CC=clang
|
export CC=clang
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
|
|
||||||
function build_nasm() {
|
|
||||||
if [[ ! -d "${WORK}/nasm-${NASM_VERSION}" ]]; then
|
|
||||||
echo "Downloading NASM..."
|
|
||||||
tarball="nasm-${NASM_VERSION}.tar.gz"
|
|
||||||
curl -sSOL "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/${tarball}"
|
|
||||||
tar xzf "${tarball}" -C "${WORK}" && rm "${tarball}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${WORK}/build/nasm"
|
|
||||||
pushd "${WORK}/build/nasm"
|
|
||||||
|
|
||||||
if [[ ! -f "${WORK}/build/nasm/config.cache" ]]; then
|
|
||||||
echo "Configuring NASM..."
|
|
||||||
"${WORK}/nasm-${NASM_VERSION}/configure" \
|
|
||||||
--quiet \
|
|
||||||
--config-cache \
|
|
||||||
--disable-werror \
|
|
||||||
--prefix="${SYSROOT}" \
|
|
||||||
--srcdir="${WORK}/nasm-${NASM_VERSION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building NASM..."
|
|
||||||
(make -j && make install) > "${WORK}/build/nasm_build.log"
|
|
||||||
popd
|
|
||||||
}
|
|
||||||
|
|
||||||
function build_llvm() {
|
|
||||||
if [[ ! -d "${WORK}/llvm" ]]; then
|
if [[ ! -d "${WORK}/llvm" ]]; then
|
||||||
echo "Downloading LLVM..."
|
echo "Downloading LLVM..."
|
||||||
git clone -q \
|
git clone -q \
|
||||||
@@ -154,40 +126,6 @@ function build_llvm() {
|
|||||||
ninja cxx cxxabi compiler-rt
|
ninja cxx cxxabi compiler-rt
|
||||||
ninja install-compiler-rt install-cxx install-cxxabi
|
ninja install-compiler-rt install-cxx install-cxxabi
|
||||||
popd
|
popd
|
||||||
}
|
|
||||||
|
|
||||||
function build_libc() {
|
|
||||||
if [[ ! -d "${WORK}/poplibc" ]]; then
|
|
||||||
echo "Downloading poplibc..."
|
|
||||||
git clone \
|
|
||||||
"https://github.com/justinian/poplibc.git" \
|
|
||||||
"${WORK}/poplibc"
|
|
||||||
else
|
|
||||||
echo "Updating poplibc..."
|
|
||||||
git -C "${WORK}/poplibc" pull
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd "${WORK}/poplibc"
|
|
||||||
echo "Building poplibc..."
|
|
||||||
pb prefix="${SYSROOT}" && ninja -C build install
|
|
||||||
popd
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_links() {
|
|
||||||
for exe in `ls "${SYSROOT}/bin/${TARGET}-"*`; do
|
|
||||||
base=$(echo "$exe" | sed -e "s/${TARGET}-//")
|
|
||||||
ln -fs "${exe}" "${base}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
build_nasm
|
|
||||||
build_libc
|
|
||||||
build_llvm
|
|
||||||
update_links
|
|
||||||
|
|
||||||
export CC="${SYSROOT}/bin/clang"
|
|
||||||
export CXX="${SYSROOT}/bin/clang++"
|
|
||||||
export LD="${SYSROOT}/bin/ld"
|
|
||||||
build_libc
|
|
||||||
|
|
||||||
cp "${README}" "${SYSROOT}/README.md"
|
cp "${README}" "${SYSROOT}/README.md"
|
||||||
|
|||||||
@@ -4,39 +4,6 @@ This is a pre-built sysroot for building the jsix operating system kernel,
|
|||||||
bootloader, and utilities. This package is provided as a convenience, and
|
bootloader, and utilities. This package is provided as a convenience, and
|
||||||
contains software from the following repositories.
|
contains software from the following repositories.
|
||||||
|
|
||||||
## NASM, the Netwide Assembler
|
|
||||||
|
|
||||||
As downloaded from [the NASM website][nasm] under the following license:
|
|
||||||
|
|
||||||
Copyright 1996-2010 the NASM Authors - All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following
|
|
||||||
conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
||||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
||||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
||||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
[nasm]: https://www.nasm.us
|
|
||||||
|
|
||||||
## The LLVM toolchain
|
## The LLVM toolchain
|
||||||
|
|
||||||
The LLVM sources as downloaded via git from [llvm.org][llvm] under the terms of
|
The LLVM sources as downloaded via git from [llvm.org][llvm] under the terms of
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ cc = ${srcroot}/sysroot/bin/clang
|
|||||||
cxx = ${srcroot}/sysroot/bin/clang++
|
cxx = ${srcroot}/sysroot/bin/clang++
|
||||||
ld = ${srcroot}/sysroot/bin/ld.lld
|
ld = ${srcroot}/sysroot/bin/ld.lld
|
||||||
ar = ${srcroot}/sysroot/bin/ar
|
ar = ${srcroot}/sysroot/bin/ar
|
||||||
nasm = ${srcroot}/sysroot/bin/nasm
|
nasm = nasm
|
||||||
objcopy = ${srcroot}/sysroot/bin/x86_64-elf-objcopy
|
objcopy = ${srcroot}/sysroot/bin/objcopy
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block variables %}
|
{% block variables %}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ cc = ${srcroot}/sysroot/bin/clang
|
|||||||
cxx = ${srcroot}/sysroot/bin/clang++
|
cxx = ${srcroot}/sysroot/bin/clang++
|
||||||
ld = ${srcroot}/sysroot/bin/ld.lld
|
ld = ${srcroot}/sysroot/bin/ld.lld
|
||||||
ar = ${srcroot}/sysroot/bin/ar
|
ar = ${srcroot}/sysroot/bin/ar
|
||||||
nasm = ${srcroot}/sysroot/bin/nasm
|
nasm = nasm
|
||||||
objcopy = ${srcroot}/sysroot/bin/objcopy
|
objcopy = ${srcroot}/sysroot/bin/objcopy
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user