All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] prefer static libraries question
@ 2011-03-28 21:49 ANDY KENNEDY
  2011-04-12  6:48 ` Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: ANDY KENNEDY @ 2011-03-28 21:49 UTC (permalink / raw)
  To: buildroot

Understanding that "prefer static libraries" is "highly experimental at
the moment", should this export some default LDFLAGS=-static?  I
attempted this with a very minimal set of tools (kexec, ssh, and
busybox) and I found that busybox _does_ build statically, however, ssh
and kexec don't.  Furthermore, openssl gets installed to the target
(which is expected since ssh is built dynamically).  Preferring static
libs would indicate (to me) that the _whole_ system will not have any
libraries and each util would be linked statically.

Based upon the "at the moment" clause in the help:  is this an effort
that is currently underway?  If yes, who is doing it and would you like
help?  If no, since I have to do it anyway, should I start with the
tools that I'm using and should I key off of the BR2_PREFER_STATIC_LIB
for kexec, ssh, and anything else I run across to set *_CONF_ENV =
LDFLAGS="-static" in the *.mk files?

Comments?

Thanks,
Andy

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

* [Buildroot] prefer static libraries question
  2011-03-28 21:49 [Buildroot] prefer static libraries question ANDY KENNEDY
@ 2011-04-12  6:48 ` Mike Frysinger
  2011-04-12 15:20   ` ANDY KENNEDY
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2011-04-12  6:48 UTC (permalink / raw)
  To: buildroot

On Monday, March 28, 2011 17:49:56 ANDY KENNEDY wrote:
> Understanding that "prefer static libraries" is "highly experimental at
> the moment", should this export some default LDFLAGS=-static?  I
> attempted this with a very minimal set of tools (kexec, ssh, and
> busybox) and I found that busybox _does_ build statically, however, ssh
> and kexec don't.  Furthermore, openssl gets installed to the target
> (which is expected since ssh is built dynamically).  Preferring static
> libs would indicate (to me) that the _whole_ system will not have any
> libraries and each util would be linked statically.
> 
> Based upon the "at the moment" clause in the help:  is this an effort
> that is currently underway?  If yes, who is doing it and would you like
> help?  If no, since I have to do it anyway, should I start with the
> tools that I'm using and should I key off of the BR2_PREFER_STATIC_LIB
> for kexec, ssh, and anything else I run across to set *_CONF_ENV =
> LDFLAGS="-static" in the *.mk files?

the config option is "prefer" not "use only".  so the behavior tends to lean 
towards static, but not always use it.  thus things like -static are not 
enforced, and shared libs still get installed.

then again, it seems that sometimes people interpret this to mean "only do 
static", so there might be some inconsistencies in the tree.  but this is just 
a vague recollection ... i dont have any examples off the top of my head.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110412/bdc34926/attachment.asc>

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

* [Buildroot] prefer static libraries question
  2011-04-12  6:48 ` Mike Frysinger
@ 2011-04-12 15:20   ` ANDY KENNEDY
  2011-04-12 22:36     ` Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: ANDY KENNEDY @ 2011-04-12 15:20 UTC (permalink / raw)
  To: buildroot

> -----Original Message-----
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> Sent: Tuesday, April 12, 2011 1:48 AM
> To: buildroot at busybox.net
> Cc: ANDY KENNEDY
> Subject: Re: [Buildroot] prefer static libraries question
> 
> On Monday, March 28, 2011 17:49:56 ANDY KENNEDY wrote:
> > Understanding that "prefer static libraries" is "highly
> experimental at
> > the moment", should this export some default LDFLAGS=-static?  I
> > attempted this with a very minimal set of tools (kexec, ssh, and
> > busybox) and I found that busybox _does_ build statically,
> however, ssh
> > and kexec don't.  Furthermore, openssl gets installed to the
> target
> > (which is expected since ssh is built dynamically).  Preferring
> static
> > libs would indicate (to me) that the _whole_ system will not have
> any
> > libraries and each util would be linked statically.
> >
> > Based upon the "at the moment" clause in the help:  is this an
> effort
> > that is currently underway?  If yes, who is doing it and would
> you like
> > help?  If no, since I have to do it anyway, should I start with
> the
> > tools that I'm using and should I key off of the
> BR2_PREFER_STATIC_LIB
> > for kexec, ssh, and anything else I run across to set *_CONF_ENV
> =
> > LDFLAGS="-static" in the *.mk files?
> 
> the config option is "prefer" not "use only".  so the behavior
> tends to lean
> towards static, but not always use it.  thus things like -static
> are not
> enforced, and shared libs still get installed.
> 
> then again, it seems that sometimes people interpret this to mean
> "only do
> static", so there might be some inconsistencies in the tree.  but
> this is just
> a vague recollection ... i dont have any examples off the top of my
> head.

Yeah, well at the moment it isn't on my plate as I'm writing kernel
code attempting to get a PHY up and running, so I'll get back to
this later.  I will probably go forth with the mentality of "only
do static" and attempt to make things work in a sensible manner.

Question:  Where should I put the libs?  I'm guessing that I should
have all libs install to STAGING_DIR, but I want to make sure I'm
doing the right thing.

> -mike

Andy

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

* [Buildroot] prefer static libraries question
  2011-04-12 15:20   ` ANDY KENNEDY
@ 2011-04-12 22:36     ` Mike Frysinger
  2011-04-22 13:25       ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2011-04-12 22:36 UTC (permalink / raw)
  To: buildroot

On Tuesday, April 12, 2011 11:20:38 ANDY KENNEDY wrote:
> Yeah, well at the moment it isn't on my plate as I'm writing kernel
> code attempting to get a PHY up and running, so I'll get back to
> this later.

np.  i was just trying to fill out some of your "unknowns".

> I will probably go forth with the mentality of "only
> do static" and attempt to make things work in a sensible manner.

might be better to rename or add a new option.  then the build logic is clear: 
if user *prefers* static linking, we'll still build/install shared libs, but 
we'll generate static programs everywhere.  if the user *only* wants static 
builds, then we can skip the shared lib stuff entirely.

> Question:  Where should I put the libs?  I'm guessing that I should
> have all libs install to STAGING_DIR, but I want to make sure I'm
> doing the right thing.

i believe that is correct.  staging is where all the generated stuff goes that 
you need to link other packages against, but it isnt the target rootfs tree 
which is used at runtime on the target hardware.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110412/9d3be647/attachment-0001.asc>

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

* [Buildroot] prefer static libraries question
  2011-04-12 22:36     ` Mike Frysinger
@ 2011-04-22 13:25       ` Thomas Petazzoni
  2011-05-14  9:38         ` Peter Korsgaard
  2011-06-18 18:47         ` Mike Frysinger
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2011-04-22 13:25 UTC (permalink / raw)
  To: buildroot

On Tue, 12 Apr 2011 18:36:54 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> might be better to rename or add a new option.  then the build logic
> is clear: if user *prefers* static linking, we'll still build/install
> shared libs, but we'll generate static programs everywhere.  if the
> user *only* wants static builds, then we can skip the shared lib
> stuff entirely.

Does the "prefers" use case really makes sense ? I have always found
our BR2_PREFER_STATIC_LIB a bit odd, and I think it should be
BR2_USE_STATIC_LIB instead, and compile everything statically.

What do you think ?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] prefer static libraries question
  2011-04-22 13:25       ` Thomas Petazzoni
@ 2011-05-14  9:38         ` Peter Korsgaard
  2011-06-18 18:47         ` Mike Frysinger
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2011-05-14  9:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 Thomas> Does the "prefers" use case really makes sense ? I have always found
 Thomas> our BR2_PREFER_STATIC_LIB a bit odd, and I think it should be
 Thomas> BR2_USE_STATIC_LIB instead, and compile everything statically.

 Thomas> What do you think ?

I agree (where it makes sense atleast, not all upstream projects might
allow static linking).

-- 
Bye, Peter Korsgaard

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

* [Buildroot] prefer static libraries question
  2011-04-22 13:25       ` Thomas Petazzoni
  2011-05-14  9:38         ` Peter Korsgaard
@ 2011-06-18 18:47         ` Mike Frysinger
  2011-06-18 19:38           ` Bernhard Reutner-Fischer
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2011-06-18 18:47 UTC (permalink / raw)
  To: buildroot

On Friday, April 22, 2011 09:25:27 Thomas Petazzoni wrote:
> On Tue, 12 Apr 2011 18:36:54 -0400 Mike Frysinger wrote:
> > might be better to rename or add a new option.  then the build logic
> > is clear: if user *prefers* static linking, we'll still build/install
> > shared libs, but we'll generate static programs everywhere.  if the
> > user *only* wants static builds, then we can skip the shared lib
> > stuff entirely.
> 
> Does the "prefers" use case really makes sense ? I have always found
> our BR2_PREFER_STATIC_LIB a bit odd, and I think it should be
> BR2_USE_STATIC_LIB instead, and compile everything statically.
> 
> What do you think ?

i agree on all points
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110618/4c3aff69/attachment.asc>

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

* [Buildroot] prefer static libraries question
  2011-06-18 18:47         ` Mike Frysinger
@ 2011-06-18 19:38           ` Bernhard Reutner-Fischer
  2011-06-20 14:53             ` ANDY KENNEDY
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Reutner-Fischer @ 2011-06-18 19:38 UTC (permalink / raw)
  To: buildroot

On Jun 18, 2011 8:47 PM, "Mike Frysinger" <vapier@gentoo.org> wrote:
>
> On Friday, April 22, 2011 09:25:27 Thomas Petazzoni wrote:
> > On Tue, 12 Apr 2011 18:36:54 -0400 Mike Frysinger wrote:
> > > might be better to rename or add a new option.  then the build logic
> > > is clear: if user *prefers* static linking, we'll still build/install
> > > shared libs, but we'll generate static programs everywhere.  if the
> > > user *only* wants static builds, then we can skip the shared lib
> > > stuff entirely.
> >
> > Does the "prefers" use case really makes sense ? I have always found
> > our BR2_PREFER_STATIC_LIB a bit odd, and I think it should be
> > BR2_USE_STATIC_LIB instead, and compile everything statically.
> >
> > What do you think ?
>
> i agree on all points

Iirc it was me who added it and the initial intention was to only end up
with everything static, yes.

> -mike
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110618/2b4f27c7/attachment.html>

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

* [Buildroot] prefer static libraries question
  2011-06-18 19:38           ` Bernhard Reutner-Fischer
@ 2011-06-20 14:53             ` ANDY KENNEDY
  0 siblings, 0 replies; 9+ messages in thread
From: ANDY KENNEDY @ 2011-06-20 14:53 UTC (permalink / raw)
  To: buildroot

> -----Original Message-----
> From: buildroot-bounces at busybox.net [mailto:buildroot-
> bounces at busybox.net] On Behalf Of Bernhard Reutner-Fischer
> Sent: Saturday, June 18, 2011 2:38 PM
> To: Mike Frysinger
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] prefer static libraries question
> 
> 
> On Jun 18, 2011 8:47 PM, "Mike Frysinger" <vapier@gentoo.org>
> wrote:
> >
> > On Friday, April 22, 2011 09:25:27 Thomas Petazzoni wrote:
> > > On Tue, 12 Apr 2011 18:36:54 -0400 Mike Frysinger wrote:
> > > > might be better to rename or add a new option.  then the
> build logic
> > > > is clear: if user *prefers* static linking, we'll still
> build/install
> > > > shared libs, but we'll generate static programs everywhere.
> if the
> > > > user *only* wants static builds, then we can skip the shared
> lib
> > > > stuff entirely.
> > >
> > > Does the "prefers" use case really makes sense ? I have always
> found
> > > our BR2_PREFER_STATIC_LIB a bit odd, and I think it should be
> > > BR2_USE_STATIC_LIB instead, and compile everything statically.
> > >
> > > What do you think ?
> >
> > i agree on all points
> 
> Iirc it was me who added it and the initial intention was to only
> end up with everything static, yes.
> 
> > -mike

My old thread still lingers!  I'm about to get back to this
within the next couple of days.  The need is rising.


Andy

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-28 21:49 [Buildroot] prefer static libraries question ANDY KENNEDY
2011-04-12  6:48 ` Mike Frysinger
2011-04-12 15:20   ` ANDY KENNEDY
2011-04-12 22:36     ` Mike Frysinger
2011-04-22 13:25       ` Thomas Petazzoni
2011-05-14  9:38         ` Peter Korsgaard
2011-06-18 18:47         ` Mike Frysinger
2011-06-18 19:38           ` Bernhard Reutner-Fischer
2011-06-20 14:53             ` ANDY KENNEDY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.