From patchwork Mon Jun 22 18:45:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Bilas X-Patchwork-Id: 1314687 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=grinn-global.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 49rJJC1LBVz9sSn for ; Tue, 23 Jun 2020 04:45:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 682C3263F2; Mon, 22 Jun 2020 18:45:29 +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 x1vYiwKiXC1F; Mon, 22 Jun 2020 18:45:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 80BA226411; Mon, 22 Jun 2020 18:45:23 +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 2F8011BF2FF for ; Mon, 22 Jun 2020 18:45:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2C77687469 for ; Mon, 22 Jun 2020 18:45:22 +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 Ck-Lg_Du2lZF for ; Mon, 22 Jun 2020 18:45:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.megiteam.pl (smtp.megiteam.pl [31.186.83.105]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 752E387389 for ; Mon, 22 Jun 2020 18:45:19 +0000 (UTC) Received: from host-81-161-202-55.oxylion.net.pl ([81.161.202.55] helo=bartekk-pc.lan) by smtp.megiteam.pl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86.2_XX) (envelope-from ) id 1jnRRV-0004bW-4W; Mon, 22 Jun 2020 20:45:17 +0200 From: Bartosz Bilas To: buildroot@buildroot.org Date: Mon, 22 Jun 2020 20:45:15 +0200 Message-Id: <20200622184515.312030-1-b.bilas@grinn-global.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/irrlicht: fix libraries linking 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: Bartosz Bilas , yann.morin.1998@free.fr Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" These patches fix the irrlicht makefile which contains the paths that point to the host system libraries that are not used and are not available in Buildroot what's unsafe for cross-compilation. In addition they fix linking to the X11 libraries and the following errors: /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `XSetSelectionOwner' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `glXGetProcAddress' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `glXMakeCurrent' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `XF86VidModeSetViewPort' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `XF86VidModeSwitchToMode' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `glClearDepth' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `XGetVisualInfo' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `XGrabKeyboard' /home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/bartekk/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libIrrlicht.so: undefined reference to `glMatrixMode' Signed-off-by: Bartosz Bilas --- Changes v1 -> v2: - patches merged into one - explained commit log IMPORTANT NOTE: Irrlicht uses CRLF line endings so the patches must be fixed when applying because patchwork drops all the CR and keeps on LF. .../0003-makefile-override-LDFLAGS.patch | 29 ++++++++++++++++ ...obsolete-X11R6-lib-include-directori.patch | 33 +++++++++++++++++++ package/irrlicht/irrlicht.mk | 4 ++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 package/irrlicht/0003-makefile-override-LDFLAGS.patch create mode 100644 package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch diff --git a/package/irrlicht/0003-makefile-override-LDFLAGS.patch b/package/irrlicht/0003-makefile-override-LDFLAGS.patch new file mode 100644 index 0000000000..16c38d5baa --- /dev/null +++ b/package/irrlicht/0003-makefile-override-LDFLAGS.patch @@ -0,0 +1,29 @@ +From f597ac417f0eefab8f388afe617a0d07d08d87bb Mon Sep 17 00:00:00 2001 +From: Bartosz Bilas +Date: Sun, 21 Jun 2020 12:57:47 +0200 +Subject: [PATCH] makefile: override LDFLAGS + +That's needed to fix proper linking to X11 libraries +within package makefile. + +Signed-off-by: Bartosz Bilas +--- + source/Irrlicht/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/Irrlicht/Makefile b/source/Irrlicht/Makefile +index 9a1bdbc..85eb264 100644 +--- a/source/Irrlicht/Makefile ++++ b/source/Irrlicht/Makefile +@@ -88,7 +88,7 @@ STATIC_LIB = libIrrlicht.a + LIB_PATH = ../../lib/$(SYSTEM) + INSTALL_DIR = /usr/local/lib + sharedlib install: SHARED_LIB = libIrrlicht.so +-sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm ++sharedlib: override LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm + staticlib sharedlib: CXXINCS += -I/usr/X11R6/include + + #OSX specific options +-- +2.27.0 + diff --git a/package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch b/package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch new file mode 100644 index 0000000000..b551905890 --- /dev/null +++ b/package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch @@ -0,0 +1,33 @@ +From 9a4109dfceccc2e702a6928ec612ee790a31dea7 Mon Sep 17 00:00:00 2001 +From: Bartosz Bilas +Date: Mon, 22 Jun 2020 20:26:51 +0200 +Subject: [PATCH] makefile: remove obsolete X11R6 lib/include directories + +Remove those non supported paths to lib/includes that are not used and +not available in buildroot and in addition point to the host system +libraries in a result cause the following warning: + +/home/bartekk/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/9.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: warning: library search path "/usr/X11R6/lib" is unsafe for cross-compilation + +Signed-off-by: Bartosz Bilas +--- + source/Irrlicht/Makefile | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/source/Irrlicht/Makefile b/source/Irrlicht/Makefile +index fed6c7e..b323237 100644 +--- a/source/Irrlicht/Makefile ++++ b/source/Irrlicht/Makefile +@@ -88,8 +88,7 @@ STATIC_LIB = libIrrlicht.a + LIB_PATH = ../../lib/$(SYSTEM) + INSTALL_DIR = /usr/local/lib + sharedlib install: SHARED_LIB = libIrrlicht.so +-sharedlib: override LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm +-staticlib sharedlib: CXXINCS += -I/usr/X11R6/include ++sharedlib: override LDFLAGS += -lGL -lXxf86vm + + #OSX specific options + staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX +-- +2.27.0 + diff --git a/package/irrlicht/irrlicht.mk b/package/irrlicht/irrlicht.mk index bd82815cde..e12d802ee7 100644 --- a/package/irrlicht/irrlicht.mk +++ b/package/irrlicht/irrlicht.mk @@ -38,12 +38,14 @@ ifeq ($(BR2_STATIC_LIBS),) IRRLICHT_CONF_OPTS += sharedlib endif +# set correct path for libraries linking +IRRLICHT_CONF_OPTS += LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" # Irrlicht fail to detect properly the NEON support on aarch64 or ARM with NEON FPU support. # While linking an application with libIrrlicht.so, we get an undefined reference to # png_init_filter_functions_neon. # Some files are missing in the libpng bundled in Irrlicht, in particular arm/arm_init.c, # so disable NEON support completely. -IRRLICHT_CONF_OPTS += CPPFLAGS="$(TARGET_CPPFLAGS) -DPNG_ARM_NEON_OPT=0" +IRRLICHT_CONF_OPTS += CPPFLAGS="$(TARGET_CPPFLAGS) -DPNG_ARM_NEON_OPT=0 -I$(STAGING_DIR)/usr/include/X11" define IRRLICHT_BUILD_CMDS $(TARGET_MAKE_ENV)