mk: link core to library archive instead of .o file

Do not link base and core libraries into on large relocatable .o file,
which is linked later to core - causing long link times. Create an
independent library archive out of the base and core libraries that can
be linked faster.

issue #4027
This commit is contained in:
Sebastian Sumpf
2021-02-19 15:23:49 +01:00
committed by Norman Feske
parent 64165d829e
commit f68e655312
16 changed files with 49 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-fiasco.lib.so" }
proc binary_name_core_o { } { return "core-fiasco.o" }
proc binary_name_core_a { } { return "core-fiasco.a" }
proc binary_name_timer { } { return "fiasco_timer_drv" }
proc kernel_files { } { return { fiasco sigma0-fiasco bootstrap-fiasco } }

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-foc.lib.so" }
proc binary_name_core_o { } { return "core-foc-[board].o" }
proc binary_name_core_a { } { return "core-foc-[board].a" }
proc binary_name_timer { } { return "foc_timer_drv" }
proc kernel_files { } { return { foc sigma0-foc bootstrap-foc } }

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-hw.lib.so" }
proc binary_name_core_o { } { return "core-hw.o" }
proc binary_name_core_a { } { return "core-hw.a" }
proc binary_name_timer { } { return "hw_timer_drv" }
@@ -49,14 +49,14 @@ proc run_boot_dir {binaries} {
set ld_arg ""
if {![file exists [run_dir]/genode/ld.lib.so]} { set ld_arg lib/ld/hw }
if {![file exists [run_dir]/genode/core-hw-[board].o]} { set core_arg core/hw }
if {![file exists [run_dir]/genode/core-hw-[board].a]} { set core_arg core/hw }
if {![file exists [run_dir]/genode/bootstrap-hw-[board].o]} { set bootstrap_arg bootstrap/hw }
set build_args "$bootstrap_arg $core_arg $ld_arg"
if {[llength $build_args]} { build $build_args }
if {$ld_arg != ""} { file copy -force bin/ld-hw.lib.so [run_dir]/genode/ld.lib.so }
if {$core_arg != ""} { file copy -force bin/core-hw-[board].o [run_dir]/genode/ }
if {$core_arg != ""} { file copy -force bin/core-hw-[board].a [run_dir]/genode/ }
if {$bootstrap_arg != ""} { file copy -force bin/bootstrap-hw-[board].o [run_dir]/genode/ }
#
@@ -68,12 +68,12 @@ proc run_boot_dir {binaries} {
puts "core link address is [core_link_address]"
set core_obj core-hw-[board].o
set core_obj core-hw-[board].a
set bootstrap_obj bootstrap-hw-[board].o
# create core and bootstrap binary without modules for debugging
if {[file exists debug/core-hw-[board].o]} {
build_core debug/core-hw-[board].o {} [run_dir].core [core_link_address]
build_core debug/core-hw-[board].a {} [run_dir].core [core_link_address]
build_core [run_dir]/genode/$bootstrap_obj {} [run_dir].bootstrap [bootstrap_link_address]
}

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-nova.lib.so" }
proc binary_name_core_o { } { return "core-nova.o" }
proc binary_name_core_a { } { return "core-nova.a" }
proc binary_name_timer { } { return "nova_timer_drv" }
proc kernel_files { } { return hypervisor }
@@ -36,14 +36,14 @@ proc run_boot_dir {binaries} {
set core_arg ""
set ld_arg ""
if {![file exists [run_dir]/genode/hypervisor]} { set kernel_arg kernel }
if {![file exists [run_dir]/genode/core-nova.o]} { set core_arg core/nova }
if {![file exists [run_dir]/genode/core-nova.a]} { set core_arg core/nova }
if {![file exists [run_dir]/genode/ld.lib.so]} { set ld_arg lib/ld/nova }
set targets "$kernel_arg $core_arg $ld_arg"
if {[llength $targets]} { build $targets }
if {$kernel_arg != ""} { file copy -force bin/hypervisor [run_dir]/genode/hypervisor }
if {$core_arg != ""} { file copy -force bin/core-nova.o [run_dir]/genode/core-nova.o }
if {$core_arg != ""} { file copy -force bin/core-nova.a [run_dir]/genode/core-nova.a }
if {$ld_arg != ""} { file copy -force bin/ld-nova.lib.so [run_dir]/genode/ld.lib.so }
#

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-okl4.lib.so" }
proc binary_name_core_o { } { return "core-okl4.o" }
proc binary_name_core_a { } { return "core-okl4.a" }
proc binary_name_timer { } { return "pit_timer_drv" }
proc kernel_files { } { return okl4 }

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-pistachio.lib.so" }
proc binary_name_core_o { } { return "core-pistachio.o" }
proc binary_name_core_a { } { return "core-pistachio.a" }
proc binary_name_timer { } { return "pit_timer_drv" }
proc kernel_files { } { return { pistachio sigma0-pistachio kickstart-pistachio } }

View File

@@ -1,5 +1,5 @@
proc binary_name_ld_lib_so { } { return "ld-sel4.lib.so" }
proc binary_name_core_o { } { return "core-sel4.o" }
proc binary_name_core_a { } { return "core-sel4.a" }
proc binary_name_timer { } {
if {[have_board imx6q_sabrelite]} { return "imx6_timer_drv" }
if {[have_board imx7d_sabre]} { return "imx7_timer_drv" }