[RFC,0/2] let gdbserver use libiberty

Message ID CAFqB+Pyp_=QavC0HYOpmZBvHuiCNu8Z_geCaa3-Rm5xC1Or1Lw@mail.gmail.com
State Committed
Headers

Commit Message

Marcus Shawcroft June 18, 2014, 12:27 p.m. UTC
  On 16 June 2014 14:25, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Thu, Jun 12, 2014 at 09:37:19PM +0100, Tom Tromey wrote:
>> This series slipped through the cracks somehow.  I'm going to push it
>> now.  I believe I addressed all the review comments upthread.  I rebased
>> it and rebuilt it on x86-64 Fedora 20; let me know if you encounter any
>> problems.
>
> Hi Tom,
>
> This seems to cause issues when building gdbserver as part of a larger
> Canadian Cross ARM/AArch64 build. ar ends up confused having seemingly lost
> the expected flags:

The issue here appears to be that libiberty configure script probes
for and finds an appropriate AR for the --build/--target combination.
However, the gdbserver configure does not probe for AR but does
override the AR used in the libiberty build by explicitly passing AR
to the sub-builds.  This has the effect of passing the systems 'ar'
rather than an ar appropriate for the --build/--target combination.

An alternative  approach to that suggested by James is to have the
gdbserver configure scri[t probe for AR to ensure that something sane
is passed on to the sub-builds.

Patch attached.

OK ?

/Marcus
  

Comments

Tom Tromey June 19, 2014, 2:48 p.m. UTC | #1
>>>>> "Marcus" == Marcus Shawcroft <marcus.shawcroft@gmail.com> writes:

Marcus> An alternative  approach to that suggested by James is to have the
Marcus> gdbserver configure scri[t probe for AR to ensure that something sane
Marcus> is passed on to the sub-builds.

Marcus> Patch attached.

Marcus> OK ?

Yes, this is ok.  Thanks.

Tom
  

Patch

From 96c14c27fc7ff86e028d1f1a156391154d8e7c04 Mon Sep 17 00:00:00 2001
From: Marcus Shawcroft <marcus.shawcroft@arm.com>
Date: Wed, 18 Jun 2014 11:53:33 +0100
Subject: [PATCH 1/2] Fix gdbserver canadian cross build.

---
 gdb/gdbserver/ChangeLog    |    5 +++++
 gdb/gdbserver/Makefile.in  |    2 ++
 gdb/gdbserver/configure.ac |    1 +
 3 files changed, 8 insertions(+)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 3186336..8788be1 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@ 
+2014-06-18  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+	* configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
+	* Makefile.in (AR, AR_FLAGS): Define.
+
 2014-06-18  Gary Benson  <gbenson@redhat.com>
 
 	* i386-low.h (i386_low_insert_watchpoint): Renamed to
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index cbf36ab..c650477 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -50,6 +50,8 @@  INSTALL_DATA = @INSTALL_DATA@
 RANLIB = @RANLIB@
 
 CC = @CC@
+AR = @AR@
+AR_FLAGS = rc
 
 # Dependency tracking information.
 DEPMODE = @CCDEPMODE@
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index ede38d0..7fa89d6 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -32,6 +32,7 @@  AC_SYS_LARGEFILE
 AC_CANONICAL_SYSTEM
 
 AC_PROG_INSTALL
+AC_CHECK_TOOL(AR, ar)
 AC_PROG_RANLIB
 
 AC_ARG_PROGRAM
-- 
1.7.9.5