* [Buildroot] [PATCH] BINFMT_FLAT_SHARED: is not really shared for buildroot purposes
@ 2015-03-27 20:55 Arnout Vandecappelle
2015-03-27 21:07 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Arnout Vandecappelle @ 2015-03-27 20:55 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
Although BINFMT_FLAT_SHARED is indeed a shared library format, it does
not support dynamic library loading with dlopen(). So for buildroot
purposes, BR2_STATIC_LIBS shouldn't be selected.
As it happens, the compiler options that are added for
BINFMT_FLAT_SHARED also make the compiler ignore the -static option, so
we can simply force BR2_STATIC_LIBS and things work out perfectly.
Therefore, remove the select of BR2_BINFMT_SUPPORTS_SHARED from
BINFMT_FLAT_SHARED, which in turn makes sure that BR2_STATIC_LIBS is
selected.
[Arnout: rewrite commit message, add explanatory comment]
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
arch/Config.in | 7 ++++++-
docs/manual/adding-packages-generic.txt | 5 +++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/Config.in b/arch/Config.in
index 16ad8be..59bf84a 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -295,7 +295,12 @@ config BR2_BINFMT_FLAT_SEP_DATA
config BR2_BINFMT_FLAT_SHARED
bool "Shared binary"
- select BR2_BINFMT_SUPPORTS_SHARED
+ # Even though this really generates shared binaries, there is no libdl
+ # and dlopen() cannot be used. So packages that require shared
+ # libraries cannot be built. Therefore, we don't select
+ # BR2_BINFMT_SUPPORTS_SHARED and therefore force BR2_STATIC_LIBS.
+ # Although this adds -static to the compilation, that's not a problem
+ # because the -mid-shared-library option overrides it.
help
Allow to load and link indiviual FLAT binaries at run time.
diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index b6615ce..7508cfa 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -208,8 +208,9 @@ information is (assuming the package name is +libfoo+) :
which Buildroot will use to download the tarball from
+LIBFOO_SITE+. If +HOST_LIBFOO_SOURCE+ is not specified, it defaults
to +LIBFOO_SOURCE+. If none are specified, then the value is assumed
- to be +libfoo-$(LIBFOO_VERSION).tar.gz+. + Example: +LIBFOO_SOURCE =
- foobar-$(LIBFOO_VERSION).tar.bz2+
+ to be +libfoo-$(LIBFOO_VERSION).tar.gz+.
+ +
+ Example: +LIBFOO_SOURCE = foobar-$(LIBFOO_VERSION).tar.bz2+
* +LIBFOO_PATCH+ may contain a space-separated list of patch file
names, that Buildroot will download and apply to the package source
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] BINFMT_FLAT_SHARED: is not really shared for buildroot purposes
2015-03-27 20:55 [Buildroot] [PATCH] BINFMT_FLAT_SHARED: is not really shared for buildroot purposes Arnout Vandecappelle
@ 2015-03-27 21:07 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-03-27 21:07 UTC (permalink / raw)
To: buildroot
Dear Arnout Vandecappelle (Essensium/Mind),
On Fri, 27 Mar 2015 21:55:07 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> index b6615ce..7508cfa 100644
> --- a/docs/manual/adding-packages-generic.txt
> +++ b/docs/manual/adding-packages-generic.txt
> @@ -208,8 +208,9 @@ information is (assuming the package name is +libfoo+) :
> which Buildroot will use to download the tarball from
> +LIBFOO_SITE+. If +HOST_LIBFOO_SOURCE+ is not specified, it defaults
> to +LIBFOO_SOURCE+. If none are specified, then the value is assumed
> - to be +libfoo-$(LIBFOO_VERSION).tar.gz+. + Example: +LIBFOO_SOURCE =
> - foobar-$(LIBFOO_VERSION).tar.bz2+
> + to be +libfoo-$(LIBFOO_VERSION).tar.gz+.
> + +
> + Example: +LIBFOO_SOURCE = foobar-$(LIBFOO_VERSION).tar.bz2+
>
> * +LIBFOO_PATCH+ may contain a space-separated list of patch file
> names, that Buildroot will download and apply to the package source
Probably this part was not meant to be part of the patch, right? :-)
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-27 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-27 20:55 [Buildroot] [PATCH] BINFMT_FLAT_SHARED: is not really shared for buildroot purposes Arnout Vandecappelle
2015-03-27 21:07 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox