From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7480 invoked by alias); 13 Jun 2005 19:07:24 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6692 invoked by uid 22791); 13 Jun 2005 19:07:18 -0000 Received: from wbmler4.mail.xerox.com (HELO wbmler4.mail.xerox.com) (13.13.138.219) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 13 Jun 2005 19:07:18 +0000 Received: from wbmlir3.mail.xerox.com (wbmlir3.mail.xerox.com [13.131.8.223]) by wbmler4.mail.xerox.com (8.13.4/8.13.1) with ESMTP id j5DJ73CS031424; Mon, 13 Jun 2005 15:07:09 -0400 Received: from wbmlir3.mail.xerox.com (localhost [127.0.0.1]) by wbmlir3.mail.xerox.com (8.13.4/8.13.1) with ESMTP id j5DJ6L0M012864; Mon, 13 Jun 2005 15:06:21 -0400 Received: from mailhost.eng.mc.xerox.com (romeo.ess.mc.xerox.com [13.1.87.14]) by wbmlir3.mail.xerox.com (8.13.4/8.13.1) with ESMTP id j5DJ6LDC012859; Mon, 13 Jun 2005 15:06:21 -0400 Received: from rockhopper (rockhopper [13.142.232.138]) by mailhost.eng.mc.xerox.com (8.11.6+Sun/8.9.3) with ESMTP id j5DJ4Ld13672; Mon, 13 Jun 2005 15:04:21 -0400 (EDT) Subject: Re: Configuring linker flags while cross-compiling gdb From: Aaron Gaudio To: Daniel Jacobowitz Cc: gdb In-Reply-To: <20050613153007.GA7054@nevyn.them.org> References: <1118676366.27729.73.camel@rockhopper> <20050613153007.GA7054@nevyn.them.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-NfLC5yo63aDLU2gpIpQ4" Date: Mon, 13 Jun 2005 19:07:00 -0000 Message-Id: <1118689574.27729.82.camel@rockhopper> Mime-Version: 1.0 X-SW-Source: 2005-06/txt/msg00115.txt.bz2 --=-NfLC5yo63aDLU2gpIpQ4 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 2416 On Mon, 2005-06-13 at 11:30 -0400, Daniel Jacobowitz wrote: > On Mon, Jun 13, 2005 at 11:26:06AM -0400, Aaron Gaudio wrote: > > Continuing with my adventure from last week, I am now trying to cross- > > comile gdb to run on i386-pc-solaris2.10 and build on sparc-sun- > > solaris2.10.=20 > >=20 > > I used the following configure line: > >=20 > > $ bash_cv_have_mbstate_t=3Dyes ./configure --build sparc-sun-solaris2.8= -- > > host i386-pc-solaris2.10 > >=20 > > This seems to get the correct compilers to use. However, when trying to > > link, it is missing the correct rpath-link (where I have the x86 sysroot > > to link system libraries), and it is also not linking in a required > > library, libsocket (I get undefined symbols that manually adding - > > lsocket to the link command fixes). >=20 > These both sound like problems with your cross compiler, not problems > with GDB. In the case of libsocket, it is not a cross-compiler problem; you always have to add -lsocket to the link libs when using things like socket(), or linking libraries that do (such as X11 libs). The problem is that when building a native gdb on solaris (with --target=3Di386-pc- solaris2.10), configure detects that -lsocket is required and adds it to the appopriate Makefile macros, but does not when building for x86 Solaris.... >=20 > No, that's for target libraries. Gdb is a host program. The fact taht > build !=3D host is irrelevant here; your "target" is i386-pc-solaris2.10, > and so is your "host". LDFLAGS is the correct place to add flags for > the host. >=20 I've tried this, but it didn't seem to change anything. Part of the confusion is that the sub-level configures don't get called until you run a top-level make, and not all environment variables set (such as LDFLAGS) at configure time get cascaded to the sub-level configure, and furthermore I'm not sure the sub-level Makefile is handling merging LDFLAGS from the environment and from the makefile (since I just want to tell it to add "-lsocket", not manually figure out every single library that needs to be linked). Any further help is much appreciated. --=20 Aaron Gaudio agaudio @ eng.mc.xerox.com 585-422-6876 While life is yours, live joyously; None can escape Death's searching eye: When once this frame of ours they burn, How shall it e'er again return? --=-NfLC5yo63aDLU2gpIpQ4 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-length: 197 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iEYEABECAAYFAkKt2SYACgkQEbHgw5SciQZR4gCeOBaZ7Pa7ud9QdAd0302y/hk4 XCYAn19y2v44Prfed75NCQorKrWkm20v =+rel -----END PGP SIGNATURE----- --=-NfLC5yo63aDLU2gpIpQ4--