public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Is there a way to make static executable out of ELF shared one?
@ 2001-12-11  6:23 vda
  2001-12-11  7:01 ` Andrea 'Fyre Wyzard' Bocci
  2001-12-11 17:31 ` Ricardo Derbes
  0 siblings, 2 replies; 8+ messages in thread
From: vda @ 2001-12-11  6:23 UTC (permalink / raw)
  To: gcc, gcc-help

Hi gcc folks,

I need a bunch of static executables for linux initial ramdisk.
I have all needed executables but some of them require .so libs.
I know that static binaries can be made at compile time (ld -static)
but do I really need to download source for all my binaries?

There must be a way to make static binary from shared one

Please CC me
--
Denis Vlasenko

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11  6:23 Is there a way to make static executable out of ELF shared one? vda
@ 2001-12-11  7:01 ` Andrea 'Fyre Wyzard' Bocci
  2001-12-11  7:13   ` vda
  2001-12-11 17:31 ` Ricardo Derbes
  1 sibling, 1 reply; 8+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2001-12-11  7:01 UTC (permalink / raw)
  To: vda, gcc, gcc-help

At 16.22 11/12/2001 (GMT -0200), vda wrote:
>Hi gcc folks,
>
>I need a bunch of static executables for linux initial ramdisk.
>I have all needed executables but some of them require .so libs.
>I know that static binaries can be made at compile time (ld -static)
>but do I really need to download source for all my binaries?
>
>There must be a way to make static binary from shared one

Silly as it may sound - can't you just put everything (binaries & .so libs) 
in the ramdisk ?

fwyzard

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11  7:01 ` Andrea 'Fyre Wyzard' Bocci
@ 2001-12-11  7:13   ` vda
  2001-12-11  8:50     ` H . J . Lu
  2001-12-11 23:54     ` Axel Kittenberger
  0 siblings, 2 replies; 8+ messages in thread
From: vda @ 2001-12-11  7:13 UTC (permalink / raw)
  To: Andrea 'Fyre Wyzard' Bocci, gcc, gcc-help

On Tuesday 11 December 2001 13:02, Andrea 'Fyre Wyzard' Bocci wrote:
> At 16.22 11/12/2001 (GMT -0200), vda wrote:
> >I need a bunch of static executables for linux initial ramdisk.
> >I have all needed executables but some of them require .so libs.
> >I know that static binaries can be made at compile time (ld -static)
> >but do I really need to download source for all my binaries?
> >
> >There must be a way to make static binary from shared one
>
> Silly as it may sound - can't you just put everything (binaries & .so libs)
> in the ramdisk ?

Yes I can but most shared binaries need (guess what?....) libc
which isn't exactly small :-(
--
vda

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11  7:13   ` vda
@ 2001-12-11  8:50     ` H . J . Lu
  2001-12-11 23:54     ` Axel Kittenberger
  1 sibling, 0 replies; 8+ messages in thread
From: H . J . Lu @ 2001-12-11  8:50 UTC (permalink / raw)
  To: vda; +Cc: Andrea 'Fyre Wyzard' Bocci, gcc, gcc-help

On Tue, Dec 11, 2001 at 05:11:41PM -0200, vda wrote:
> On Tuesday 11 December 2001 13:02, Andrea 'Fyre Wyzard' Bocci wrote:
> > At 16.22 11/12/2001 (GMT -0200), vda wrote:
> > >I need a bunch of static executables for linux initial ramdisk.
> > >I have all needed executables but some of them require .so libs.
> > >I know that static binaries can be made at compile time (ld -static)
> > >but do I really need to download source for all my binaries?
> > >
> > >There must be a way to make static binary from shared one
> >
> > Silly as it may sound - can't you just put everything (binaries & .so libs)
> > in the ramdisk ?
> 
> Yes I can but most shared binaries need (guess what?....) libc
> which isn't exactly small :-(

Are you using glibc? I have a sglibc on sourceforge.net.


H.J.

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11  6:23 Is there a way to make static executable out of ELF shared one? vda
  2001-12-11  7:01 ` Andrea 'Fyre Wyzard' Bocci
@ 2001-12-11 17:31 ` Ricardo Derbes
  2001-12-12  6:46   ` vda
  1 sibling, 1 reply; 8+ messages in thread
From: Ricardo Derbes @ 2001-12-11 17:31 UTC (permalink / raw)
  To: vda, gcc, gcc-help

Hi
It´s possible to recompile all the sources as static, but your ramdisk will
be a lot bigger than compiling as shared and adding libc to the ramdisk...
it´s easier, too.. you can simply copy all what is needed (and shared
libraries, which you can find running ldd on each executable you want on the
ramdisk) to a new rootfilesystem, and then gzipping it (better done on a
loop). In addition, you can compile packages as Busybox, which provide a lot
of  basic functionality in a very small footprint. In as little as 2-3 Megs
you can build a very powerful system, without bells & whistles as X, but
with networking support and all the servers you may need (telnet, ftp,
http), and useful stuff. If you are really tight of space, you can build a
complete (well, almost) system in a 1.44M floppy, including a 2.4.x
kernel...
Regards

Ricardo Derbes
Altec SE
Albarracín 157 - San Carlos de Bariloche
+54-2944-426892
rmd@altec.com.ar
----- Original Message -----
From: "vda" <vda@port.imtp.ilyichevsk.odessa.ua>
To: <gcc@gcc.gnu.org>; <gcc-help@gcc.gnu.org>
Sent: Tuesday, December 11, 2001 3:22 PM
Subject: Is there a way to make static executable out of ELF shared one?


> Hi gcc folks,
>
> I need a bunch of static executables for linux initial ramdisk.
> I have all needed executables but some of them require .so libs.
> I know that static binaries can be made at compile time (ld -static)
> but do I really need to download source for all my binaries?
>
> There must be a way to make static binary from shared one
>
> Please CC me
> --
> Denis Vlasenko

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11  7:13   ` vda
  2001-12-11  8:50     ` H . J . Lu
@ 2001-12-11 23:54     ` Axel Kittenberger
  2001-12-12  6:39       ` vda
  1 sibling, 1 reply; 8+ messages in thread
From: Axel Kittenberger @ 2001-12-11 23:54 UTC (permalink / raw)
  To: vda, Andrea 'Fyre Wyzard' Bocci, gcc-help

> Yes I can but most shared binaries need (guess what?....) libc
> which isn't exactly small :-(

I do not now what your apps do but without a libc yoh have not interfacing in 
na way (except raising the kernel traps yourself), no printf, no puts, no 
exit, and argh you don't even have something that calls your main routine. 
(You'll have to make the sjstem jump in yourself) Until you aren't doing 
something very very special/crazy there will be na way aronud having any 
libc) It's like building an embedded processor without RAM.

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11 23:54     ` Axel Kittenberger
@ 2001-12-12  6:39       ` vda
  0 siblings, 0 replies; 8+ messages in thread
From: vda @ 2001-12-12  6:39 UTC (permalink / raw)
  To: Axel Kittenberger, Andrea 'Fyre Wyzard' Bocci, gcc-help

On Wednesday 12 December 2001 05:52, Axel Kittenberger wrote:
> > Yes I can but most shared binaries need (guess what?....) libc
> > which isn't exactly small :-(
>
> I do not now what your apps do but without a libc yoh have not interfacing
> in na way (except raising the kernel traps yourself), no printf, no puts,
> no exit, and argh you don't even have something that calls your main
> routine. (You'll have to make the sjstem jump in yourself) Until you aren't
> doing something very very special/crazy there will be na way aronud having
> any libc) It's like building an embedded processor without RAM.

Hmm.. My apps are standard things like modprobe.
I just want to link only those parts of libc which are used by modprobe
into static version of the binary and use it on a ramdisk.
What's wrong with my intention?

Some misunderstanding is here on your part.
--
vda

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

* Re: Is there a way to make static executable out of ELF shared one?
  2001-12-11 17:31 ` Ricardo Derbes
@ 2001-12-12  6:46   ` vda
  0 siblings, 0 replies; 8+ messages in thread
From: vda @ 2001-12-12  6:46 UTC (permalink / raw)
  To: Ricardo Derbes, gcc, gcc-help

On Tuesday 11 December 2001 23:37, Ricardo Derbes wrote:
> Hi
> Itб╢s possible to recompile all the sources as static, but your ramdisk will
> be a lot bigger than compiling as shared and adding libc to the ramdisk...
> itб╢s easier, too.. you can simply copy all what is needed (and shared
> libraries, which you can find running ldd on each executable you want on
> the ramdisk) to a new rootfilesystem, and then gzipping it (better done on
> a loop). In addition, you can compile packages as Busybox, which provide a
> lot of  basic functionality in a very small footprint. In as little as 2-3
> Megs you can build a very powerful system, without bells & whistles as X,
> but with networking support and all the servers you may need (telnet, ftp,
> http), and useful stuff. If you are really tight of space, you can build a
> complete (well, almost) system in a 1.44M floppy, including a 2.4.x
> kernel...

Thank you for your info.

My question was born when I tried to quickly hack together a ramdisk for 
little netboot experiment, it turned out I can't use modprobe 'coz in needs
libc, and glibc is too big for ramdisk.

I thought it is easy to 'relink' modprobe into static binary, but...
It turned out that setting up an umsdos is faster than downloading, 
configuring, building and testing of several source tarballs :-)
--
vda

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

end of thread, other threads:[~2001-12-12 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11  6:23 Is there a way to make static executable out of ELF shared one? vda
2001-12-11  7:01 ` Andrea 'Fyre Wyzard' Bocci
2001-12-11  7:13   ` vda
2001-12-11  8:50     ` H . J . Lu
2001-12-11 23:54     ` Axel Kittenberger
2001-12-12  6:39       ` vda
2001-12-11 17:31 ` Ricardo Derbes
2001-12-12  6:46   ` vda

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