Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Building GDB Statically
@ 2007-03-13 18:03 Fahd Abidi
  2007-03-13 18:08 ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: Fahd Abidi @ 2007-03-13 18:03 UTC (permalink / raw)
  To: gdb

I am trying to build GDB 6.6 so that its statically linked. I want to do
this so that I can build one GDB toolset and just move the binary to the
different platforms we support, I.E RH9 thru Fedora Core 1-6. There seem
to be some messages when I build GDB implying that there are options to
build it with a -static gcc option but I can't figure out what switch to
set and where. Trying to add -static to CFLAGS in configure.in did not
do the trick.

Any Idea's?

Fahd Abidi
Ultimate Solutions
 


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

* RE: Building GDB Statically
  2007-03-13 18:03 Building GDB Statically Fahd Abidi
@ 2007-03-13 18:08 ` Dave Korn
  2007-03-13 18:15   ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2007-03-13 18:08 UTC (permalink / raw)
  To: 'Fahd Abidi', gdb

On 13 March 2007 19:02, Fahd Abidi wrote:

> I am trying to build GDB 6.6 so that its statically linked. I want to do
> this so that I can build one GDB toolset and just move the binary to the
> different platforms we support, I.E RH9 thru Fedora Core 1-6. There seem
> to be some messages when I build GDB implying that there are options to
> build it with a -static gcc option but I can't figure out what switch to
> set and where. Trying to add -static to CFLAGS in configure.in did not
> do the trick.
> 
> Any Idea's?


  Most GNU software allows you to specify "--disable-shared" as an option to
the configure command to obtain a statically-linked build; this takes care of
everything you need to do for both compiler flags, linker flags, libtool
settings etc.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

* Re: Building GDB Statically
  2007-03-13 18:08 ` Dave Korn
@ 2007-03-13 18:15   ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-03-13 18:15 UTC (permalink / raw)
  To: Dave Korn; +Cc: 'Fahd Abidi', gdb

On Tue, Mar 13, 2007 at 06:07:55PM -0000, Dave Korn wrote:
>   Most GNU software allows you to specify "--disable-shared" as an option to
> the configure command to obtain a statically-linked build; this takes care of
> everything you need to do for both compiler flags, linker flags, libtool
> settings etc.

Actually, --disable-shared normally only generates static libraries
instead of shared libraries.

Setting LDFLAGS or CFLAGS should work.  However GDB may or may not
when moved between systems; I do not recommend the use of static
binaries.  Compiling a dynamically linked binary on the oldest
interesting system works best.

-- 
Daniel Jacobowitz
CodeSourcery


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

* RE: Building GDB Statically
@ 2007-03-14 12:18 Fahd Abidi
  0 siblings, 0 replies; 5+ messages in thread
From: Fahd Abidi @ 2007-03-14 12:18 UTC (permalink / raw)
  To: Daniel Jacobowitz, Dave Korn; +Cc: gdb

I finally found how to do it. Under gdb6.6root/gdb/Makefile.in edit
there is a commented line like so:

#(CC_LD)=gcc -static
(CC_LD)=(CC)

I Just had to comment in the first line and comment out the second. I
also built it with out the shared libraries. the resulting Binary still
does not work under RH9 though, complains that the kernel version is too
old.

BTW another possibility was if you used the optional CFLAG parameter
from the make command itself:

make CFLAG=-static

I am instead Building GDB6.4 on RH9 and am going to use that as my cross
host GDB binary, I have built it statically on RH9 and thus far have
confirmed that it works on FC6.

thanks for the help.

Fahd
 


-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
Behalf Of Daniel Jacobowitz
Sent: Tuesday, March 13, 2007 3:16 PM
To: Dave Korn
Cc: Fahd Abidi; gdb@sourceware.org
Subject: Re: Building GDB Statically


On Tue, Mar 13, 2007 at 06:07:55PM -0000, Dave Korn wrote:
>   Most GNU software allows you to specify "--disable-shared" as an 
> option to the configure command to obtain a statically-linked build; 
> this takes care of everything you need to do for both compiler flags, 
> linker flags, libtool settings etc.

Actually, --disable-shared normally only generates static libraries
instead of shared libraries.

Setting LDFLAGS or CFLAGS should work.  However GDB may or may not when
moved between systems; I do not recommend the use of static binaries.
Compiling a dynamically linked binary on the oldest interesting system
works best.

-- 
Daniel Jacobowitz
CodeSourcery




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

* RE: Building GDB Statically
@ 2007-03-13 18:22 Fahd Abidi
  0 siblings, 0 replies; 5+ messages in thread
From: Fahd Abidi @ 2007-03-13 18:22 UTC (permalink / raw)
  To: Daniel Jacobowitz, Dave Korn; +Cc: gdb

-Compiling a dynamically linked binary on the oldest interesting system
works best.

I was going to do Just that. But I have thus far been unable to get
GDB6.6 to build on my RH9 box. Compiles just fine on my FC6. I'll try
your suggestion of setting LDFLAGS with a -static option and will let
you know the result. Will also try the --disable-shared option.

Fahd
 


-----Original Message-----
From: Daniel Jacobowitz [mailto:drow@false.org] 
Sent: Tuesday, March 13, 2007 3:16 PM
To: Dave Korn
Cc: Fahd Abidi; gdb@sourceware.org
Subject: Re: Building GDB Statically


On Tue, Mar 13, 2007 at 06:07:55PM -0000, Dave Korn wrote:
>   Most GNU software allows you to specify "--disable-shared" as an 
> option to the configure command to obtain a statically-linked build; 
> this takes care of everything you need to do for both compiler flags, 
> linker flags, libtool settings etc.

Actually, --disable-shared normally only generates static libraries
instead of shared libraries.

Setting LDFLAGS or CFLAGS should work.  However GDB may or may not when
moved between systems; I do not recommend the use of static binaries.
Compiling a dynamically linked binary on the oldest interesting system
works best.

-- 
Daniel Jacobowitz
CodeSourcery




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

end of thread, other threads:[~2007-03-14 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-13 18:03 Building GDB Statically Fahd Abidi
2007-03-13 18:08 ` Dave Korn
2007-03-13 18:15   ` Daniel Jacobowitz
2007-03-13 18:22 Fahd Abidi
2007-03-14 12:18 Fahd Abidi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox