From patchwork Fri Mar 27 20:55:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 455578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 0DDE11400DE for ; Sat, 28 Mar 2015 07:55:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D8597308E7; Fri, 27 Mar 2015 20:55:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2fziAhScQdf0; Fri, 27 Mar 2015 20:55:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 9CBCA30825; Fri, 27 Mar 2015 20:55:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 30A7A1C1E80 for ; Fri, 27 Mar 2015 20:55:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2D6D895CAC for ; Fri, 27 Mar 2015 20:55:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S+5pQxsF3UfR for ; Fri, 27 Mar 2015 20:55:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by hemlock.osuosl.org (Postfix) with ESMTPS id AAFAE95CA8 for ; Fri, 27 Mar 2015 20:55:12 +0000 (UTC) Received: from [172.16.2.6] (helo=vandecaa-laptop) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1YbbHZ-0002sa-Iv; Fri, 27 Mar 2015 21:55:09 +0100 Received: from arnout by vandecaa-laptop with local (Exim 4.84) (envelope-from ) id 1YbbHX-0005uu-Oo; Fri, 27 Mar 2015 21:55:07 +0100 From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Fri, 27 Mar 2015 21:55:07 +0100 Message-Id: <1427489707-22707-1-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.1.4 Cc: Sonic Zhang Subject: [Buildroot] [PATCH] BINFMT_FLAT_SHARED: is not really shared for buildroot purposes X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Sonic Zhang 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 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- 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