Merge branch 'relibc'

This commit is contained in:
Jeremy Soller 2018-10-14 16:41:00 -06:00
commit e1b7b0e8cb
16 changed files with 156 additions and 63 deletions

3
.gitignore vendored
View file

@ -1 +1,2 @@
build /build/
/prefix/

3
.gitmodules vendored
View file

@ -22,3 +22,6 @@
[submodule "redoxfs"] [submodule "redoxfs"]
path = redoxfs path = redoxfs
url = https://gitlab.redox-os.org/redox-os/redoxfs.git url = https://gitlab.redox-os.org/redox-os/redoxfs.git
[submodule "relibc"]
path = relibc
url = https://gitlab.redox-os.org/redox-os/relibc.git

View file

@ -40,10 +40,8 @@ fetch:
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \ "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)"
# Emulation recipes # Cross compiler recipes
include mk/qemu.mk include mk/prefix.mk
include mk/bochs.mk
include mk/virtualbox.mk
# Kernel recipes # Kernel recipes
include mk/kernel.mk include mk/kernel.mk
@ -55,6 +53,11 @@ include mk/filesystem.mk
# Disk images # Disk images
include mk/disk.mk include mk/disk.mk
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
# CI image target # CI image target
ci-img: FORCE ci-img: FORCE
make INSTALLER_FLAGS= build/harddrive.bin.gz build/harddrive-efi.bin.gz build/livedisk.iso build/livedisk-efi.iso make INSTALLER_FLAGS= build/harddrive.bin.gz build/harddrive-efi.bin.gz build/livedisk.iso build/livedisk-efi.iso
@ -67,11 +70,12 @@ ci-img: FORCE
cd build/img && sha256sum -b * > SHA256SUM cd build/img && sha256sum -b * > SHA256SUM
# CI packaging target # CI packaging target
ci-pkg: FORCE ci-pkg: prefix FORCE
cd cookbook && ./fetch.sh \ export PATH="$(PREFIX_PATH):$$PATH" && \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)" PACKAGES="$$(cargo run --manifest-path installer/Cargo.toml -- --list-packages -c ci.toml)" && \
cd cookbook && ./repo.sh \ cd cookbook && \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)" ./fetch.sh "$${PACKAGES}" && \
./repo.sh "$${PACKAGES}"
# An empty target # An empty target
FORCE: FORCE:

@ -1 +1 @@
Subproject commit 615d9e136512a21cc5fb22b5ab74389e078d3fb7 Subproject commit ad8f6a97e9205552e1414bb481b3d13ec9ae5fae

@ -1 +1 @@
Subproject commit de305ff651b811f2640ea685bbd9f2b12b974f15 Subproject commit 555b236027a32a87bca273999b008e9534f9f876

85
ci.toml
View file

@ -5,88 +5,89 @@ prompt = false
[packages] [packages]
acid = {} acid = {}
autoconf = {} #autoconf = {}
automake = {} #automake = {}
bash = {} #bash = {}
binutils = {} #binutils = {}
ca-certificates = {} ca-certificates = {}
#cargo = {} #cargo = {}
cleye = {} cleye = {}
#cmatrix = {} #cmatrix = {}
contain = {} contain = {}
coreutils = {} coreutils = {}
curl = {} #curl = {}
dash = {} dash = {}
diffutils = {} #diffutils = {}
dosbox = {} #dosbox = {}
drivers = {} drivers = {}
#drivers-041 = {} #drivers-041 = {}
duktape = {} #duktape = {}
expat = {} expat = {}
extrautils = {} extrautils = {}
#fd = {} #fd = {}
ffmpeg = {} #ffmpeg = {}
findutils = {} findutils = {}
freedoom = {} #freedoom = {}
freetype = {} #freetype = {}
game-2048 = {} game-2048 = {}
games = {} games = {}
gawk = {} #gawk = {}
gcc = {} #gcc = {}
generaluser-gs = {} #generaluser-gs = {}
#gigalomania = {} #gigalomania = {}
git = {} #git = {}
gnu-binutils = {} #gnu-binutils = {}
gnu-grep = {} #gnu-grep = {}
gnu-make = {} #gnu-make = {}
init = {} init = {}
installer = {} installer = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
jansson = {} #jansson = {}
keyboard-sfx = {} keyboard-sfx = {}
lci = {} #lci = {}
libjpeg = {} libjpeg = {}
liborbital = {} liborbital = {}
libpng = {} libpng = {}
#libsodium = {} libsodium = {}
logd = {} logd = {}
lua = {} #lua = {}
mdp = {} #mdp = {}
nasm = {} #nasm = {}
ncdu = {} #ncdu = {}
ncurses = {} #ncurses = {}
ncursesw = {} #ncursesw = {}
netdb = {} netdb = {}
netstack = {} netstack = {}
netsurf = {} #netsurf = {}
netutils = {} netutils = {}
newlib = {} #newlib = {}
newlibtest = {} #newlibtest = {}
nulld = {} nulld = {}
openssl = {} openssl = {}
openttd = {} #openttd = {}
openttd-opengfx = {} #openttd-opengfx = {}
openttd-openmsx = {} #openttd-openmsx = {}
orbdata = {} orbdata = {}
orbital = {} orbital = {}
orbterm = {} orbterm = {}
orbutils = {} orbutils = {}
pastel = {} pastel = {}
patch = {} #patch = {}
periodictable = {} periodictable = {}
#perl = {} #perl = {}
pixelcannon = {} pixelcannon = {}
pkgutils = {} pkgutils = {}
#powerline = {} #powerline = {}
prboom = {} #prboom = {}
ptyd = {} ptyd = {}
python = {} #python = {}
randd = {} randd = {}
readline = {} #readline = {}
redoxfs = {} redoxfs = {}
#redox-ssh = {} #redox-ssh = {}
relibc = {} relibc = {}
ripgrep = {}
rs-nes = {} rs-nes = {}
#rust = {} #rust = {}
rust64 = {} rust64 = {}
@ -94,19 +95,19 @@ rustual-boy = {}
sdl = {} sdl = {}
sdl_image = {} sdl_image = {}
sdl_mixer = {} sdl_mixer = {}
sed = {} #sed = {}
shellstorm = {} shellstorm = {}
smith = {} smith = {}
sodium = {} sodium = {}
#ssh = {} #ssh = {}
terminfo = {} terminfo = {}
termplay = {} termplay = {}
timidity = {} #timidity = {}
ttf-hack = {} ttf-hack = {}
userutils = {} userutils = {}
uutils = {} uutils = {}
vim = {} #vim = {}
vttest = {} #vttest = {}
xz = {} #xz = {}
zerod = {} zerod = {}
zlib = {} zlib = {}

@ -1 +1 @@
Subproject commit 79e8d44a2e65acb0e74170209d7d551a1b997048 Subproject commit 3bcea75ac2223757b9529d0d91e78d1401305ce1

View file

@ -16,7 +16,7 @@ ca-certificates = {}
#cargo = {} #cargo = {}
#cleye = {} #cleye = {}
#cmatrix = {} #cmatrix = {}
#contain = {} contain = {}
coreutils = {} coreutils = {}
#curl = {} #curl = {}
#dash = {} #dash = {}
@ -24,6 +24,7 @@ coreutils = {}
#dosbox = {} #dosbox = {}
drivers = {} drivers = {}
#duktape = {} #duktape = {}
#exampled = {}
extrautils = {} extrautils = {}
#fd = {} #fd = {}
#ffmpeg = {} #ffmpeg = {}

@ -1 +1 @@
Subproject commit 33fa0af5214decdda7cc7ac39407ad18d727583b Subproject commit 49b7a5f427aaa08c217d784ec4b643d285cce5a8

2
kernel

@ -1 +1 @@
Subproject commit 054fc41beb82019152bfc5186557aedb4e8b5d2a Subproject commit 3b1bf1bac1aa21eed53c3465d7b1a470f5922396

View file

@ -1,4 +1,4 @@
build/filesystem.bin: filesystem.toml build/bootloader build/kernel build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
-$(FUMOUNT) build/filesystem/ || true -$(FUMOUNT) build/filesystem/ || true
rm -rf $@ $@.partial build/filesystem/ rm -rf $@ $@.partial build/filesystem/
dd if=/dev/zero of=$@.partial bs=1048576 count=256 dd if=/dev/zero of=$@.partial bs=1048576 count=256
@ -8,7 +8,10 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- $@.partial build/filesystem/ cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- $@.partial build/filesystem/
sleep 2 sleep 2
pgrep redoxfs pgrep redoxfs
cp filesystem.toml build/bootloader build/kernel build/filesystem/ cp $< build/filesystem/filesystem.toml
cp build/bootloader build/filesystem/bootloader
cp build/kernel build/filesystem/kernel
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml --release -- $(INSTALLER_FLAGS) -c $< build/filesystem/ cargo run --manifest-path installer/Cargo.toml --release -- $(INSTALLER_FLAGS) -c $< build/filesystem/
sync sync
-$(FUMOUNT) build/filesystem/ || true -$(FUMOUNT) build/filesystem/ || true

View file

@ -1,13 +1,15 @@
build/initfs.tag: initfs.toml build/initfs.tag: initfs.toml prefix
cd kernel && xargo clean cd kernel && xargo clean
rm -rf build/initfs rm -rf build/initfs
mkdir -p build/initfs mkdir -p build/initfs
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/ cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/
touch $@ touch $@
build/initfs_live.tag: initfs_live.toml build/initfs_live.tag: initfs_live.toml prefix
cd kernel && xargo clean cd kernel && xargo clean
rm -rf build/initfs_live rm -rf build/initfs_live
mkdir -p build/initfs_live mkdir -p build/initfs_live
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_live/ cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_live/
touch $@ touch $@

View file

@ -16,6 +16,8 @@ build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o $(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o
objcopy --only-keep-debug $@ $@.sym
objcopy --strip-debug $@
build/live.o: build/filesystem.bin build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH) #TODO: More general use of $(ARCH)

75
mk/prefix.mk Normal file
View file

@ -0,0 +1,75 @@
PREFIX=$(ROOT)/prefix
PREFIX_BINUTILS_PATH=$(PREFIX)/binutils-install/bin
PREFIX_FREESTANDING_PATH=$(PREFIX_BINUTILS_PATH):$(PREFIX)/gcc-freestanding-install/bin
PREFIX_PATH=$(PREFIX_BINUTILS_PATH):$(PREFIX)/gcc-install/bin
prefix: $(PREFIX)/gcc-install
touch "$@"
$(PREFIX)/binutils.tar.bz2:
mkdir -p "$(@D)"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/master/binutils-gdb-master.tar.bz2"
mv $@.partial $@
$(PREFIX)/binutils: $(PREFIX)/binutils.tar.bz2
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
mv "$@.partial" "$@"
touch "$@"
$(PREFIX)/binutils-install: $(PREFIX)/binutils
rm -rf "$<-build" "$@"
mkdir -p "$<-build" "$@"
cd "$<-build" && \
"$</configure" --target="$(TARGET)" --disable-werror --prefix="$@" && \
make all -j `nproc` && \
make install -j `nproc`
touch "$@"
$(PREFIX)/gcc.tar.bz2:
mkdir -p "$(@D)"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/gcc/-/archive/redox/gcc-redox.tar.bz2"
mv "$@.partial" "$@"
$(PREFIX)/gcc: $(PREFIX)/gcc.tar.bz2
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1
cd "$@.partial" && ./contrib/download_prerequisites
mv "$@.partial" "$@"
touch "$@"
$(PREFIX)/gcc-freestanding-install: $(PREFIX)/gcc
rm -rf "$<-freestanding-build" "$@"
mkdir -p "$<-freestanding-build" "$@"
cd "$<-freestanding-build" && \
export PATH="$(PREFIX_BINUTILS_PATH):$$PATH" && \
"$</configure" --target="$(TARGET)" --prefix="$@" --disable-nls --enable-languages=c,c++ --without-headers && \
make all-gcc -j `nproc` && \
make all-target-libgcc -j `nproc` && \
make install-gcc -j `nproc` && \
make install-target-libgcc -j `nproc`
touch "$@"
$(PREFIX)/relibc-install: $(PREFIX)/binutils-install $(PREFIX)/gcc-freestanding-install
rm -rf "$@"
cd relibc && \
export PATH="$(PREFIX_FREESTANDING_PATH):$$PATH" && \
rustup target add "$(TARGET)" && \
make all && \
make DESTDIR="$@/usr" install
touch "$@"
$(PREFIX)/gcc-install: $(PREFIX)/gcc | $(PREFIX)/relibc-install
rm -rf "$<-build" "$@"
mkdir -p "$<-build" "$@"
cd "$<-build" && \
export PATH="$(PREFIX_FREESTANDING_PATH):$$PATH" && \
"$</configure" --target="$(TARGET)" --disable-werror --prefix="$@" --with-sysroot="$(PREFIX)/relibc-install" --disable-nls --enable-languages=c,c++ && \
make all-gcc -j `nproc` && \
make all-target-libgcc -j `nproc` && \
make install-gcc -j `nproc` && \
make install-target-libgcc -j `nproc` && \
make all-target-libstdc++-v3 -j `nproc` && \
make install-target-libstdc++-v3 -j `nproc`
touch "$@"

1
relibc Submodule

@ -0,0 +1 @@
Subproject commit 23fe526c555e894916b1a17df2f5fc1a44a16d23

2
rust

@ -1 +1 @@
Subproject commit fbb1fd15d7c3ef511d785c7718899eddde095ccc Subproject commit 2385b0853d779371f02166746be21a5296cc5a75