aboutsummaryrefslogtreecommitdiff
path: root/config/boards/qemu.exp
blob: 07acbaa51f05ecd31f09b534921c8238d2b3ab0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
load_generic_config tcwg-local

set_board_info is_simulator 1

set qemu_arch "[lindex [split $target_triplet -] 0]"
case "$qemu_arch" in {
    { armv[78]l } {
	set qemu_arch "arm"
    }
}

set ret [local_exec "$GCC_UNDER_TEST --print-sysroot" "" "" $timeout]
if { [lindex $ret 0] == 0 } {
    set sysroot "[lindex $ret 1]"
    # Strip the CR or LF off the end of the line as returned by GCC
    regsub -all "\[\n\r\]+" $sysroot "" sysroot
} else {
    error "Cannot get compiler sysroot"
}

case "$build_triplet" in {
    { "x86_64*-linux-gnu" } {
	set setarch_arch x86_64
    }
    { "aarch64*-linux-gnu" } {
	set setarch_arch arm64
    }
    { "arm-*linux*" } {
	set setarch_arch arm
    }
    default {
	puts "ERROR: Unsupported build triplet ($build_triplet) for qemu.exp"
    }
}

# qemu_cpu is set in linaro.exp
set board_info($board,exec_shell) "[board_info $board exec_shell] $env(QEMU_WRAPPER) $setarch_arch $qemu_arch $qemu_cpu $sysroot"

if { [ istarget "arm*-eabi"]
     || [ istarget "aarch64*-elf"] } {
    set_board_info cflags  "[libgloss_include_flags]"
    set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -specs=rdimon.specs"
}