From patchwork Wed Jan 2 20:56:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 1020073 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43VNdb2CYVz9s7T for ; Thu, 3 Jan 2019 07:56:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A34E885B06; Wed, 2 Jan 2019 20:56:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KFT+typOrDrP; Wed, 2 Jan 2019 20:56:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1FDF085784; Wed, 2 Jan 2019 20:56:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 625641C31C9 for ; Wed, 2 Jan 2019 20:56:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5DC0C85784 for ; Wed, 2 Jan 2019 20:56:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eO4QuRs83bhQ for ; Wed, 2 Jan 2019 20:56:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9C3368489F for ; Wed, 2 Jan 2019 20:56:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gportay) with ESMTPSA id 8C1BA279A11 From: =?utf-8?q?Ga=C3=ABl_PORTAY?= To: buildroot@buildroot.org, "Thomas Petazzoni" , "Arnout Vandecappelle" Date: Wed, 2 Jan 2019 15:56:28 -0500 Message-Id: <20190102205630.18725-2-gael.portay@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190102205630.18725-1-gael.portay@collabora.com> References: <20190102205630.18725-1-gael.portay@collabora.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/3] leveldb: install memenv static library and header X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ga=C3=ABl_PORTAY?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The project builds a tiny static library that consists of a single symbol which creates an in-memory LevelDB database. That library is not installed by default and may be used by other projects. This commit installs in the staging directory the libmemenv.a static library and the memenv.h header file. Signed-off-by: Gaël PORTAY --- package/leveldb/leveldb.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/leveldb/leveldb.mk b/package/leveldb/leveldb.mk index 54942a0f27..7999373770 100644 --- a/package/leveldb/leveldb.mk +++ b/package/leveldb/leveldb.mk @@ -25,6 +25,8 @@ define LEVELDB_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE) \ INSTALL_ROOT=$(STAGING_DIR) INSTALL_PREFIX=/usr \ $(LEVELDB_MAKE_ARGS) -C $(@D) install + $(INSTALL) -D -m 0644 $(@D)/out-static/libmemenv.a $(STAGING_DIR)/usr/lib/libmemenv.a + $(INSTALL) -D -m 0644 $(@D)/helpers/memenv/memenv.h $(STAGING_DIR)/usr/include/helpers/memenv/memenv.h endef define LEVELDB_INSTALL_TARGET_CMDS From patchwork Wed Jan 2 20:56:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 1020074 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43VNdg0TGnz9s2P for ; Thu, 3 Jan 2019 07:56:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3722E855FE; Wed, 2 Jan 2019 20:56:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WG3uJxzW5FW9; Wed, 2 Jan 2019 20:56:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D9DCB85550; Wed, 2 Jan 2019 20:56:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 77F601C31C9 for ; Wed, 2 Jan 2019 20:56:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 75B5C854FC for ; Wed, 2 Jan 2019 20:56:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhejGLpCj2yk for ; Wed, 2 Jan 2019 20:56:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 492CA85233 for ; Wed, 2 Jan 2019 20:56:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gportay) with ESMTPSA id 32A222607EA From: =?utf-8?q?Ga=C3=ABl_PORTAY?= To: buildroot@buildroot.org, "Thomas Petazzoni" , "Arnout Vandecappelle" Date: Wed, 2 Jan 2019 15:56:29 -0500 Message-Id: <20190102205630.18725-3-gael.portay@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190102205630.18725-1-gael.portay@collabora.com> References: <20190102205630.18725-1-gael.portay@collabora.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 2/3] leveldb: generate pic for static libraries X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ga=C3=ABl_PORTAY?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The project's static libraries are not compiled with the -fPIC compiler flag that prevents any libraries to link against those libraries. This commit adds a patch that sets the -fPIC compiler flag to the list of CFLAGS/CXXFLAGS. The project now generates position independant code for all of its outputs (i.e. not limited anymore to its shared libraries). Fixes: /home/gportay/src/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: /home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a(memenv.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status Signed-off-by: Gaël PORTAY --- ...n-independant-code-for-static-librar.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 package/leveldb/0001-Generate-position-independant-code-for-static-librar.patch diff --git a/package/leveldb/0001-Generate-position-independant-code-for-static-librar.patch b/package/leveldb/0001-Generate-position-independant-code-for-static-librar.patch new file mode 100644 index 0000000000..dce06ec725 --- /dev/null +++ b/package/leveldb/0001-Generate-position-independant-code-for-static-librar.patch @@ -0,0 +1,52 @@ +From 6ed1b57ef6bcee0d497c181730710b2b0fafbfb3 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= +Date: Fri, 31 Aug 2018 12:23:46 -0400 +Subject: [PATCH] Generate position independant code for static library +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +Currently, only shared libraries are using the PIC flag. + +Generalize this flag for static libraries in order to let them linkable +by dynamic libraries. + +Fixes: + + /home/gportay/src/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: /home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a(memenv.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC + /home/gportay/src/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libmemenv.a: error adding symbols: Bad value + collect2: error: ld returned 1 exit status + +Upstream-Status: Inappropriate [upstream has migrated to cmake] +Signed-off-by: Gaël PORTAY +--- + build_detect_platform | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/build_detect_platform b/build_detect_platform +index d2a20ce..4839444 100755 +--- a/build_detect_platform ++++ b/build_detect_platform +@@ -55,8 +55,8 @@ fi + + COMMON_FLAGS= + CROSS_COMPILE= +-PLATFORM_CCFLAGS= +-PLATFORM_CXXFLAGS= ++PLATFORM_CCFLAGS="-fPIC" ++PLATFORM_CXXFLAGS="-fPIC" + PLATFORM_LDFLAGS= + PLATFORM_LIBS= + PLATFORM_SHARED_EXT="so" +@@ -197,7 +197,7 @@ else + EOF + if [ "$?" = 0 ]; then + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT" +- PLATFORM_CXXFLAGS="-std=c++0x" ++ PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS -std=c++0x" + else + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX" + fi +-- +2.18.0 + From patchwork Wed Jan 2 20:56:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 1020075 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43VNdg3dfWz9s4s for ; Thu, 3 Jan 2019 07:56:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8A3F521544; Wed, 2 Jan 2019 20:56:53 +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 suTXoigcJag4; Wed, 2 Jan 2019 20:56:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8A31721FF8; Wed, 2 Jan 2019 20:56:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 1F4531C14FF for ; Wed, 2 Jan 2019 20:56:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1928185569 for ; Wed, 2 Jan 2019 20:56:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JNidU-NooN4Z for ; Wed, 2 Jan 2019 20:56:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6FD9E854A7 for ; Wed, 2 Jan 2019 20:56:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gportay) with ESMTPSA id 94928279A11 From: =?utf-8?q?Ga=C3=ABl_PORTAY?= To: buildroot@buildroot.org, "Thomas Petazzoni" , "Arnout Vandecappelle" Date: Wed, 2 Jan 2019 15:56:30 -0500 Message-Id: <20190102205630.18725-4-gael.portay@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190102205630.18725-1-gael.portay@collabora.com> References: <20190102205630.18725-1-gael.portay@collabora.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 3/3] qt5webkit: select leveldb package and memenv X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ga=C3=ABl_PORTAY?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch fixes the build issue reported by autobuilder [0]. /home/naourr/work/instance-2/output/build/qt5webkit-5.9.1/Source/WebCore//.obj/platform/leveldb/LevelDBDatabase.o: In function `WebCore::LevelDBDatabase::openInMemory(WebCore::LevelDBComparator const*)': LevelDBDatabase.cpp.text._ZN7WebCore15LevelDBDatabase12openInMemoryEPKNS_17LevelDBComparatorE+0x34): undefined reference to `leveldb::NewMemEnv(leveldb::Env*)' collect2: error: ld returned 1 exit status make[3]: *** [Makefile.api:97: ../lib/libQt5WebKit.so.5.9.1] Error 1 The issue happens when both packages leveldb and qt5webkit are enabled. QtWebKit builds its own copy of leveldb [1] (as a third-party) if the system does not provided it (i.e. buildroot). It builds it differently and this is the origin of that issue. Instead of using the Makefile provided by leveldb [2], QtWebKit uses qmake to build that library [3]. The missing symbol issue happens because the symbol leveldb::NewMemEnv is bundled in the static library libmemenv.a (aside libleveldb.so). This static library consists of this single symbol which is like an extra that is built but *NOT* shipped by default at installation in the staging directory. Unfortunatly, that symbol is required later by WebCore [4]. The copy built by QtWebKit is an all-in-one library including both libleveldb and libmemenv; thus QtWebKit links against libleveldb only. Also, the linker finds the buildroot's copy first (not the third-party): that explains why it is complaining about a missing symbol. That copy does not have the symbol leveldb::NewMemEnv. Fortunatly, QtWebKit provides a facility to link against the system leveldb package. The qmake flag WEBKIT_CONFIG+=use_system_leveldb tells Qt5WebKit to link against libleveldb *AND* libmemenv [5]. To fix that issue, this commit selects the package leveldb that now installs the libmemenv static library and its header. It ensures that QtWebKit has every thing it needs to be built. It also sets the appropriate qmake configure flags to tells QtWebKit to use the leveldb copy build by the system (instead of the one that can be build internaly as a third-party). [0]: http://autobuild.buildroot.net/results/8afc8771741f62da3b2117d2124d1c6f2d941903/ [1]: https://github.com/qt/qtwebkit/tree/5.9/Source/ThirdParty/leveldb [2]: https://github.com/qt/qtwebkit/blob/5.9/Source/ThirdParty/leveldb/Makefile#L167-L169 [3]: https://github.com/qt/qtwebkit/blob/5.9/Source/ThirdParty/leveldb/Target.pri#L80 [4]: https://github.com/qt/qtwebkit/blob/5.9/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp#L185 [5]: https://github.com/qt/qtwebkit/blob/5.9/Source/WebCore/WebCore.pri#L254 [6]: https://github.com/google/leveldb/commit/739c25100e46576cdcdfff2d6f43f9f7008103c7 Signed-off-by: Gaël PORTAY --- package/qt5/qt5webkit/Config.in | 3 +++ package/qt5/qt5webkit/qt5webkit.mk | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/qt5/qt5webkit/Config.in b/package/qt5/qt5webkit/Config.in index 72c641b9f7..e8008f7bab 100644 --- a/package/qt5/qt5webkit/Config.in +++ b/package/qt5/qt5webkit/Config.in @@ -3,10 +3,13 @@ config BR2_PACKAGE_QT5WEBKIT depends on !BR2_STATIC_LIBS depends on BR2_PACKAGE_QT5_JSCORE_AVAILABLE depends on BR2_HOST_GCC_AT_LEAST_4_8 # icu + depends on BR2_INSTALL_LIBSTDCPP # leveldb depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # icu + depends on BR2_TOOLCHAIN_HAS_THREADS # leveldb depends on !BR2_BINFMT_FLAT # icu # assumes a FPU is available on MIPS depends on !BR2_MIPS_SOFT_FLOAT + select BR2_PACKAGE_LEVELDB select BR2_PACKAGE_QT5BASE select BR2_PACKAGE_QT5BASE_ICU select BR2_PACKAGE_QT5BASE_GUI diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk index e8d368fb01..a0a0998d12 100644 --- a/package/qt5/qt5webkit/qt5webkit.mk +++ b/package/qt5/qt5webkit/qt5webkit.mk @@ -16,7 +16,7 @@ endif QT5WEBKIT_SOURCE = qtwebkit-opensource-src-$(QT5WEBKIT_VERSION).tar.xz QT5WEBKIT_DEPENDENCIES = \ host-bison host-flex host-gperf host-python host-ruby \ - qt5base sqlite + leveldb qt5base sqlite QT5WEBKIT_INSTALL_STAGING = YES QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1 @@ -45,7 +45,7 @@ endef QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK define QT5WEBKIT_CONFIGURE_CMDS - (cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/bin/qmake) + (cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/bin/qmake WEBKIT_CONFIG+=use_system_leveldb) endef define QT5WEBKIT_BUILD_CMDS