public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Configuring linker flags while cross-compiling gdb
@ 2005-06-13 15:27 Aaron Gaudio
  2005-06-13 15:30 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Gaudio @ 2005-06-13 15:27 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

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. 

I used the following configure line:

$ bash_cv_have_mbstate_t=yes ./configure --build sparc-sun-solaris2.8 --
host i386-pc-solaris2.10

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).

So, now I'm trying to figure out if there is a way to pass these by way
of option or environment variable to the top-level configure in a way
that they will cascade to the subdirectory configures and/or Makefiles.
Perusing the scripts in question, the top-level configure and
Makefile.in use a variable called "LDFLAGS_FOR_TARGET", and that seems
like the place to add a -R option or -W,l,--rpath-link to take care of
the rpath, however the gdb/configure and gdb/Makefile.in don't reference
this variable at all...

Can anyone offer any advise (or point me somewhere where this has
already been explained)?


-- 
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?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Configuring linker flags while cross-compiling gdb
  2005-06-13 15:27 Configuring linker flags while cross-compiling gdb Aaron Gaudio
@ 2005-06-13 15:30 ` Daniel Jacobowitz
  2005-06-13 19:07   ` Aaron Gaudio
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2005-06-13 15:30 UTC (permalink / raw)
  To: Aaron Gaudio; +Cc: gdb

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. 
> 
> I used the following configure line:
> 
> $ bash_cv_have_mbstate_t=yes ./configure --build sparc-sun-solaris2.8 --
> host i386-pc-solaris2.10
> 
> 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).

These both sound like problems with your cross compiler, not problems
with GDB.

> So, now I'm trying to figure out if there is a way to pass these by way
> of option or environment variable to the top-level configure in a way
> that they will cascade to the subdirectory configures and/or Makefiles.
> Perusing the scripts in question, the top-level configure and
> Makefile.in use a variable called "LDFLAGS_FOR_TARGET", and that seems
> like the place to add a -R option or -W,l,--rpath-link to take care of
> the rpath, however the gdb/configure and gdb/Makefile.in don't reference
> this variable at all...

No, that's for target libraries.  Gdb is a host program.  The fact taht
build != 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.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Configuring linker flags while cross-compiling gdb
  2005-06-13 15:30 ` Daniel Jacobowitz
@ 2005-06-13 19:07   ` Aaron Gaudio
  2005-06-13 19:40     ` Aaron Gaudio
  2005-06-13 19:42     ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: Aaron Gaudio @ 2005-06-13 19:07 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 2446 bytes --]

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. 
> > 
> > I used the following configure line:
> > 
> > $ bash_cv_have_mbstate_t=yes ./configure --build sparc-sun-solaris2.8 --
> > host i386-pc-solaris2.10
> > 
> > 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).
> 
> 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=i386-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....


> 
> No, that's for target libraries.  Gdb is a host program.  The fact taht
> build != 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.
> 

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.

-- 
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?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Configuring linker flags while cross-compiling gdb
  2005-06-13 19:07   ` Aaron Gaudio
@ 2005-06-13 19:40     ` Aaron Gaudio
  2005-06-13 19:42     ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Aaron Gaudio @ 2005-06-13 19:40 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Okay, I think I got it figured out... I just need to get '-Wl,--rpath-
link=...' added to the LDFLAGS when running make, and it seems that the
makefile was specifically designed to handle setting LDFLAGS from the
cmdline....

Thanks for your guidance.

-- 
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?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Configuring linker flags while cross-compiling gdb
  2005-06-13 19:07   ` Aaron Gaudio
  2005-06-13 19:40     ` Aaron Gaudio
@ 2005-06-13 19:42     ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2005-06-13 19:42 UTC (permalink / raw)
  To: Aaron Gaudio; +Cc: gdb

On Mon, Jun 13, 2005 at 03:06:14PM -0400, Aaron Gaudio wrote:
> 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=i386-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....

But it still ought to.  That's what I meant by a cross-compiler
problem; something has gone wrong during the configure step.

> Any further help is much appreciated.

I usually stuff things that need to go in LDFLAGS in $CC if they're
being ornery.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Configuring linker flags while cross-compiling gdb
@ 2005-06-14  7:20 UDOGAN
  0 siblings, 0 replies; 6+ messages in thread
From: UDOGAN @ 2005-06-14  7:20 UTC (permalink / raw)
  To: gdb

Hi all,
We got the following error while linking gdb for HPUX 11.11 with the following configure command.
CC=gcc ./configure --build=hppa64-hp-hpux11.11 --target=hppa64-hp-hpux11.11 --host=hppa64-hp-hpux11.11 --disable-tui --disable-nls
Has anyone got any idea?
Thanks.

.......
d-frame.o tramp-frame.o inflow.o    init.o
ar: creating libgdb.a
ranlib libgdb.a
rm -f gdb
gcc -g -O2   -Dvfork=fork     \
        -o gdb gdb.o libgdb.a \
           ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a  ../libiberty/libiberty.a     -lncurses -lm -liconv ../libiberty/libiberty.a
/usr/ccs/bin/ld: Unsatisfied symbols:
   som_solib_get_got_by_pc (first referenced in libgdb.a(hppa-hpux-tdep.o)) (code)
   dlgetmodinfo (first referenced in libgdb.a(pa64solib.o)) (code)
   dlgetname (first referenced in libgdb.a(pa64solib.o)) (code)
collect2: ld returned 1 exit status
make[1]: *** [gdb] Error 1
make[1]: Leaving directory `/home/umitd/gdb-6.3/gdb'
make: *** [all-gdb] Error 2




Ümit


=============================================================================================
Bu e-mail mesaji ve ekleri, isimleri yazili alicilar disindaki kisilere aciklanmamasi, dagitilmamasi ve iletilmemesi gereken kisiye ozel ve gizli bilgiler icerebilir. Mesajin muhatabi degilseniz lutfen gonderici ile irtibat kurunuz, mesaj ve eklerini siliniz. E-mail sistemlerinin tasidigi guvenlik risklerinden dolayi, mesajlarin gizlilikleri ve butunlukleri bozulabilir, mesaj virus icerebilir. Bilinen viruslere karsi kontrolleri yapilmis olarak yollanan mesajin sisteminizde yaratabilecegi olasi zararlardan Sirketimiz (T.H.Y. A.O.) sorumlu tutulamaz.
 
This email and its attachments may contain private and confidential information intended for the use of the addressee only, which should not be announced, copied or forwarded. If you are not the intended recipient, please contact the sender, delete the message and its attachments. Due to security risks of email systems, the confidentiality and integrity of the message may be damaged, the message may contain viruses. This message is scanned for known viruses and our Company (Turkish Airlines Inc.) will not be liable for possible system damages caused by the message.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-06-14  7:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-13 15:27 Configuring linker flags while cross-compiling gdb Aaron Gaudio
2005-06-13 15:30 ` Daniel Jacobowitz
2005-06-13 19:07   ` Aaron Gaudio
2005-06-13 19:40     ` Aaron Gaudio
2005-06-13 19:42     ` Daniel Jacobowitz
2005-06-14  7:20 UDOGAN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).