This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch,ld] Support cflags, ldflags from board description file in ld tests
- From: Vidya Praveen <vidyapraveen at arm dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: "nickc at redhat dot com" <nickc at redhat dot com>
- Date: Wed, 11 Dec 2013 13:51:17 +0000
- Subject: Re: [Patch,ld] Support cflags, ldflags from board description file in ld tests
- Authentication-results: sourceware.org; auth=none
- References: <20131211133801 dot GC5586 at e103625-lin dot cambridge dot arm dot com>
Apologies. Now with the patch attached!
VP.
On Wed, Dec 11, 2013 at 01:38:01PM +0000, Vidya Praveen wrote:
> Hello,
>
> This patch enables the ld regression test scripts to use ldflags and cflags
> from the board description file. However, these are used only when the tests
> makes use of default_ld_link or default_ld_simple_link or default_ld_compile
> eventually.
>
> Tested for aarch64-one-elf, arm-none-eabi, arm-none-linux-gnueabihf and
> x86_64-unknown-linux-gnu.
>
> OK for trunk?
>
> Cheers
> VP.
>
> ld/testsuite/ChangeLog:
>
> 2013-12-11 Vidya Praveen <vidyapraveen@arm.com>
>
> * lib/ld-lib.exp (default_ld_link): Use ldflags from board description
> file.
> (default_ld_simple_link): Likewise.
> (default_ld_compile): Use cflags from board description file.
>
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 67c429f..f22fa8e 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -197,6 +197,10 @@ proc default_ld_link { ld target objects } {
set flags ""
}
+ if [board_info [target_info name] exists ldflags] {
+ append flags " [board_info [target_info name] ldflags]"
+ }
+
remote_file host delete $target
return [run_host_cmd_yesno "$ld" "$HOSTING_EMU $flags -o $target $objs $libs"]
@@ -215,6 +219,10 @@ proc default_ld_simple_link { ld target objects } {
set flags ""
}
+ if [board_info [target_info name] exists ldflags] {
+ append flags " [board_info [target_info name] ldflags]"
+ }
+
# If we are compiling with gcc, we want to add gcc_ld_flag to
# flags. Rather than determine this in some complex way, we guess
# based on the name of the compiler.
@@ -293,6 +301,10 @@ proc default_ld_compile { cc source object } {
set flags "$flags $CFLAGS"
}
+ if [board_info [target_info name] exists cflags] {
+ append flags " [board_info [target_info name] cflags]"
+ }
+
if [board_info [target_info name] exists multilib_flags] {
append flags " [board_info [target_info name] multilib_flags]"
}