From 483d094ad1bfbcf14a8acdd1f64c057e7600bcc8 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 18 May 2012 18:47:43 +0200 Subject: [PATCH] Run script for using binutils + gcc in Noux --- ports/run/noux_tool_chain.run | 198 ++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 ports/run/noux_tool_chain.run diff --git a/ports/run/noux_tool_chain.run b/ports/run/noux_tool_chain.run new file mode 100644 index 000000000..a95bc63e3 --- /dev/null +++ b/ports/run/noux_tool_chain.run @@ -0,0 +1,198 @@ +if {![have_spec x86]} { + puts "\nNoux is supported on the x86 architecture only\n" + exit 0 +} + +set build_components { + core init drivers/timer noux lib/libc_noux + drivers/framebuffer drivers/pci drivers/input + server/terminal server/ram_fs + test/libports/ncurses +} + +# +# Build Noux packages only once +# +set noux_pkgs {bash coreutils vim findutils binutils gcc make} + +foreach pkg $noux_pkgs { + lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg } + +build $build_components + +# write default vimrc file +set vimrc_fd [open "bin/vim/share/vim/vimrc" w] +puts $vimrc_fd { +set noloadplugins +set hls +set nocompatible +set laststatus=2 +set noswapfile +set viminfo=} +close $vimrc_fd + +# strip all binaries prior archiving +set find_args "" +foreach pkg $noux_pkgs { append find_args " bin/$pkg/" } +exec sh -c "find $find_args -type f | (xargs strip || true) 2>/dev/null" + +foreach pkg $noux_pkgs { + exec tar cfv bin/$pkg.tar -h -C bin/$pkg . } + +create_boot_directory + +append config { + + + + + + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + + + + + int main(int argc, char **argv) { return 0; } + +SHELL=/bin/bash +all: + genode-x86-gcc -v -c a.c -o a.o + + + + + cd /tmp; make; genode-x86-readelf -a a.o + + + + + + + + + + + + + + } + +foreach pkg $noux_pkgs { + append config " " } + +append config { + + + + + + + + + + + + + + + + + + +} + +install_config $config + + +# +# Boot modules +# + +# generic modules +set boot_modules { + core init timer ld.lib.so noux terminal ram_fs + libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so } + +append boot_modules { gmp.lib.so mpfr.lib.so } + +foreach pkg $noux_pkgs { + lappend boot_modules "$pkg.tar" } + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +append qemu_args " -m 300 " + +run_genode_until forever + +exec rm bin/bash.tar