2011-09-09 00:18:23 +08:00
|
|
|
# Copyright (C) 2002, 2011 by Red Hat, Incorporated. All rights reserved.
|
2002-05-02 01:06:25 +08:00
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software
|
|
|
|
# is freely granted, provided that this notice is preserved.
|
|
|
|
#
|
|
|
|
|
For GCC, newlib combined tree, newlib build-tree testing, use standard search paths
For example, for GCC/GCN target (AMD GPUs), target libraries are built
individually per supported hardware ISA ('-march=[...]'). Testing such a
toolchain via, for example:
$ make RUNTESTFLAGS='--target_board=[...]/-march=gfx90a' check[...]
... does work fine for all 'check-gcc-[...]' as well as GCC-provided target
libraries, 'check-target-[...]'. Just for 'check-target-newlib', for the
example above, not the '-march=gfx90a' newlib libraries are linked in, but
instead always the default ones, which results in link FAILure. This is cured
simply by skipping use of 'newlib/testsuite/lib/flags.exp', so that the
standard search paths as determined by GCC, DejaGnu are used for newlib, too.
2023-04-15 03:26:32 +08:00
|
|
|
if [info exists env(XGCC_FLAGS_FOR_TARGET)] {
|
|
|
|
verbose "GCC, newlib combined tree, build-tree testing; using standard search paths"
|
|
|
|
# ... instead of the search paths built here, based on 'objdir' as set in
|
|
|
|
# newlib's 'site.exp', which always points to the default multilib.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2002-05-02 01:06:25 +08:00
|
|
|
# flags.exp: overrides the dejagnu versions of libgloss_link_flags,
|
|
|
|
# newlib_link_flags, and newlib_include_flags.
|
|
|
|
|
|
|
|
# These versions of the procedures generate link and include flags
|
|
|
|
# by searching for the needed files in the current build and source
|
|
|
|
# directories, rather than in the build and source paths of the
|
|
|
|
# compiler being used.
|
|
|
|
|
2005-07-05 08:11:50 +08:00
|
|
|
if {![llength [info procs saved_libgloss_link_flags]]} {
|
|
|
|
rename libgloss_link_flags saved_libgloss_link_flags
|
|
|
|
}
|
|
|
|
|
2002-05-02 01:06:25 +08:00
|
|
|
proc libgloss_link_flags { args } {
|
|
|
|
global target_cpu
|
|
|
|
# These values come from the local site.exp.
|
|
|
|
global srcdir objdir
|
|
|
|
global multibuildtop
|
|
|
|
|
2005-07-05 08:11:50 +08:00
|
|
|
if {![info exists multibuildtop]} {
|
|
|
|
return [saved_libgloss_link_flags $args]
|
|
|
|
}
|
|
|
|
|
2002-05-02 01:06:25 +08:00
|
|
|
verbose "In newlib version of libgloss_link_flags...\n"
|
|
|
|
|
|
|
|
if [isnative] {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
if [is_remote host] {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2015-11-06 22:41:33 +08:00
|
|
|
set target_build_path "$objdir/.."
|
2002-05-02 01:06:25 +08:00
|
|
|
|
|
|
|
set gloss_srcdir [lookfor_file ${srcdir} libgloss/$target_cpu]
|
|
|
|
|
|
|
|
if { $gloss_srcdir == "" } {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
if [file exists $target_build_path/libgloss/$target_cpu] {
|
|
|
|
verbose "libgloss path is $target_build_path/libgloss/$target_cpu" 2
|
|
|
|
return "-B$target_build_path/libgloss/$target_cpu/ -L$target_build_path/libgloss/$target_cpu -L$gloss_srcdir"
|
|
|
|
} else {
|
|
|
|
verbose -log "No libgloss support for this target." 2
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc newlib_link_flags { args } {
|
|
|
|
global tool_root_dir
|
|
|
|
global srcdir objdir
|
|
|
|
|
|
|
|
verbose "In newlib version of newlib_link_flags...\n"
|
|
|
|
|
|
|
|
if [is_remote host] {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"];
|
|
|
|
if { $ld_script_path != "" } {
|
|
|
|
set result "-L[file dirname $ld_script_path]"
|
|
|
|
} else {
|
|
|
|
set result ""
|
|
|
|
}
|
|
|
|
|
|
|
|
return "$result -B$objdir -L$objdir"
|
|
|
|
}
|
|
|
|
|
|
|
|
proc newlib_include_flags { args } {
|
|
|
|
global srcdir objdir
|
|
|
|
|
|
|
|
verbose "In newlib version of newlib_include_flags...\n"
|
|
|
|
|
|
|
|
if [is_remote host] {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2011-09-09 00:18:23 +08:00
|
|
|
set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h]
|
|
|
|
if { ${newlib_dir} != "" } {
|
|
|
|
set newlib_dir [file dirname ${newlib_dir}]
|
|
|
|
}
|
|
|
|
return " -I$objdir/targ-include -I$objdir -I${newlib_dir}"
|
2002-05-02 01:06:25 +08:00
|
|
|
}
|