* [Buildroot] [git commit] minidlna: fix static linking
@ 2014-01-08 8:00 Peter Korsgaard
2014-01-28 21:16 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2014-01-08 8:00 UTC (permalink / raw)
To: buildroot
commit: http://git.buildroot.net/buildroot/commit/?id=822b3f0b0f705c49b50f40abc73a8e274e972f46
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master
The configure script / Makefile forgets to link with some of the dependent
libraries breaking static linking, so help it along.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/minidlna/Config.in | 2 --
package/minidlna/minidlna.mk | 8 +++++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/package/minidlna/Config.in b/package/minidlna/Config.in
index 9ec4bb4..1fcecde 100644
--- a/package/minidlna/Config.in
+++ b/package/minidlna/Config.in
@@ -4,8 +4,6 @@ config BR2_PACKAGE_MINIDLNA
depends on BR2_INET_IPV6 # ffmpeg
depends on BR2_USE_MMU # fork
depends on BR2_TOOLCHAIN_HAS_THREADS
- # static build is broken w.r.t libgcc_s
- depends on !BR2_PREFER_STATIC_LIB
select BR2_PACKAGE_FFMPEG
select BR2_PACKAGE_FLAC
select BR2_PACKAGE_LIBVORBIS # selects libogg
diff --git a/package/minidlna/minidlna.mk b/package/minidlna/minidlna.mk
index df9c3bb..94c2641 100644
--- a/package/minidlna/minidlna.mk
+++ b/package/minidlna/minidlna.mk
@@ -13,8 +13,14 @@ MINIDLNA_DEPENDENCIES = \
ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite \
host-xutil_makedepend
-# static build is broken w.r.t libgcc_s
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+# the configure script / Makefile forgets to link with some of the dependent
+# libraries breaking static linking, so help it along
+MINIDLNA_CONF_ENV = \
+ LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
+else
MINIDLNA_CONF_OPT = \
--disable-static
+endif
$(eval $(autotools-package))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [git commit] minidlna: fix static linking
2014-01-08 8:00 [Buildroot] [git commit] minidlna: fix static linking Peter Korsgaard
@ 2014-01-28 21:16 ` Thomas Petazzoni
2014-01-28 21:21 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 21:16 UTC (permalink / raw)
To: buildroot
Dear Peter Korsgaard,
On Wed, 8 Jan 2014 09:00:11 +0100, Peter Korsgaard wrote:
> -# static build is broken w.r.t libgcc_s
> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> +# the configure script / Makefile forgets to link with some of the dependent
> +# libraries breaking static linking, so help it along
> +MINIDLNA_CONF_ENV = \
> + LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
> +else
I know we're doing this in a bunch of cases, but I believe we should
rather fix the package itself, rather than encoding into the
Buildroot .mk file the list of libraries to link with. Because if
libogg or libavutil becomes unnecessary in a future version of
minidlna, we may not notice, and still link needlessly against them.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [git commit] minidlna: fix static linking
2014-01-28 21:16 ` Thomas Petazzoni
@ 2014-01-28 21:21 ` Peter Korsgaard
2014-01-28 21:28 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2014-01-28 21:21 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> Dear Peter Korsgaard,
> On Wed, 8 Jan 2014 09:00:11 +0100, Peter Korsgaard wrote:
>> -# static build is broken w.r.t libgcc_s
>> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
>> +# the configure script / Makefile forgets to link with some of the dependent
>> +# libraries breaking static linking, so help it along
>> +MINIDLNA_CONF_ENV = \
>> + LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
>> +else
> I know we're doing this in a bunch of cases, but I believe we should
> rather fix the package itself, rather than encoding into the
> Buildroot .mk file the list of libraries to link with. Because if
> libogg or libavutil becomes unnecessary in a future version of
> minidlna, we may not notice, and still link needlessly against them.
True. Patches are welcome ;)
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [git commit] minidlna: fix static linking
2014-01-28 21:21 ` Peter Korsgaard
@ 2014-01-28 21:28 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 21:28 UTC (permalink / raw)
To: buildroot
Dear Peter Korsgaard,
On Tue, 28 Jan 2014 22:21:01 +0100, Peter Korsgaard wrote:
> >> -# static build is broken w.r.t libgcc_s
> >> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> >> +# the configure script / Makefile forgets to link with some of the dependent
> >> +# libraries breaking static linking, so help it along
> >> +MINIDLNA_CONF_ENV = \
> >> + LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
> >> +else
>
> > I know we're doing this in a bunch of cases, but I believe we should
> > rather fix the package itself, rather than encoding into the
> > Buildroot .mk file the list of libraries to link with. Because if
> > libogg or libavutil becomes unnecessary in a future version of
> > minidlna, we may not notice, and still link needlessly against them.
>
> True. Patches are welcome ;)
Well. When the static linking requires such weirdness to fix upstream
breakage, and nobody cares about linking statically the package, then
marking it as depends on !BR2_PREFER_STATIC_LIB is probably a better
solution.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-28 21:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 8:00 [Buildroot] [git commit] minidlna: fix static linking Peter Korsgaard
2014-01-28 21:16 ` Thomas Petazzoni
2014-01-28 21:21 ` Peter Korsgaard
2014-01-28 21:28 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox