All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking
@ 2020-06-21 13:10 Bartosz Bilas
  2020-06-21 13:10 ` [Buildroot] [PATCH 2/2] package/irrlicht: add patch to fix linking warning Bartosz Bilas
  2020-06-21 20:02 ` [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Bartosz Bilas @ 2020-06-21 13:10 UTC (permalink / raw)
  To: buildroot

Fixes:
 /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 <b.bilas@grinn-global.com>
---
 .../0003-makefile-override-LDFLAGS.patch      | 29 +++++++++++++++++++
 package/irrlicht/irrlicht.mk                  |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 package/irrlicht/0003-makefile-override-LDFLAGS.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 <b.bilas@grinn-global.com>
+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 <b.bilas@grinn-global.com>
+---
+ 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/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)
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] package/irrlicht: add patch to fix linking warning
  2020-06-21 13:10 [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Bartosz Bilas
@ 2020-06-21 13:10 ` Bartosz Bilas
  2020-06-21 20:02 ` [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Bartosz Bilas @ 2020-06-21 13:10 UTC (permalink / raw)
  To: buildroot

irrlicht uses the old path to X11R6 that's not available in Buildroot
in addition causes warning: library search path "/usr/X11R6/lib"
is unsafe for cross-compilation.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
---
 ...obsolete-X11R6-lib-include-directori.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch

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..e2d3d4be77
--- /dev/null
+++ b/package/irrlicht/0004-makefile-remove-obsolete-X11R6-lib-include-directori.patch
@@ -0,0 +1,32 @@
+From 60c23c894ddf219b25b3437284c9a572f128b0fe Mon Sep 17 00:00:00 2001
+From: Bartosz Bilas <b.bilas@grinn-global.com>
+Date: Sun, 21 Jun 2020 14:34:50 +0200
+Subject: [PATCH] makefile: remove obsolete X11R6 lib/include directories
+
+Remove this obsolete path that's not used in buildroot and causes
+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 <b.bilas@grinn-global.com>
+---
+ 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
+
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking
  2020-06-21 13:10 [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Bartosz Bilas
  2020-06-21 13:10 ` [Buildroot] [PATCH 2/2] package/irrlicht: add patch to fix linking warning Bartosz Bilas
@ 2020-06-21 20:02 ` Yann E. MORIN
  2020-06-22 11:59   ` Bartosz Bilas
  1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2020-06-21 20:02 UTC (permalink / raw)
  To: buildroot

Bartosz, All,

On 2020-06-21 15:10 +0200, Bartosz Bilas spake thusly:
> Fixes:
>  /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'
[--SNIP--]
> Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
[--SNIP--]
> +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

That's definitely incorrect: we do not want to use a library path that
points to the host system libraries.

I wonder why our paranoid wrapper does not catches that... :-/
So far, it would not catch it, because the LDFLAGS are from the command
line, so the -L/usr/X11R6/lib is not used. But with your patch, it would
be used now...

> + staticlib sharedlib: CXXINCS += -I/usr/X11R6/include

Ditto, we do not want to use include paths that points to the host
system headers.

Ah, I got it now: the wrapper only checks for a select list of known
host paths, but neither /usr/X11R6/include nor /usr/X11R6/lib are in
that list...

But now I see that your second patch does fix that for the linker, but
that's not our paranoid wrapper doing the check, but really the
cross linker ld.

Sigh... We need to expand our wrapper with those two paths...

Anyway: you should merge the two patches together into a single one, and
explain the above in thecommit log.

Also, could you investigate removing the CXXINCS += -I/usr/X11R6/include
line too? Normally, we should have the proper search paths already.

Oh, and one last point: in a post-commit message (after the --- line),
add a note that irrlicht uses CRLF line endings, and that the patch
will have to be fixed when applying, because patchwork drops all the
CR and keeps on LF.

Care to respin, please?

In the meantime, I'll send a patch to extend the list of unsafe paths in
our toolchain wrapper...

Thanks! :-)

Regards,
Yann E. MORIN.

> + #OSX specific options
> +-- 
> +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)
> -- 
> 2.27.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking
  2020-06-21 20:02 ` [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Yann E. MORIN
@ 2020-06-22 11:59   ` Bartosz Bilas
  0 siblings, 0 replies; 4+ messages in thread
From: Bartosz Bilas @ 2020-06-22 11:59 UTC (permalink / raw)
  To: buildroot

Hello Yann,

On 21.06.2020 22:02, Yann E. MORIN wrote:
> Bartosz, All,
>
> On 2020-06-21 15:10 +0200, Bartosz Bilas spake thusly:
>> Fixes:
>>   /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'
> [--SNIP--]
>> Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
> [--SNIP--]
>> +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
> That's definitely incorrect: we do not want to use a library path that
> points to the host system libraries.
>
> I wonder why our paranoid wrapper does not catches that... :-/
> So far, it would not catch it, because the LDFLAGS are from the command
> line, so the -L/usr/X11R6/lib is not used. But with your patch, it would
> be used now...
>
>> + staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
> Ditto, we do not want to use include paths that points to the host
> system headers.
I didn't want to combine everything in one patch therefore there is a 
second one there.
>
> Ah, I got it now: the wrapper only checks for a select list of known
> host paths, but neither /usr/X11R6/include nor /usr/X11R6/lib are in
> that list...
>
> But now I see that your second patch does fix that for the linker, but
> that's not our paranoid wrapper doing the check, but really the
> cross linker ld.
>
> Sigh... We need to expand our wrapper with those two paths...
>
> Anyway: you should merge the two patches together into a single one, and
> explain the above in thecommit log.
Should I split the makefile patches to the separate ones or just do 
everything in one? I mean adding override flag and removing those 
obsolete host paths.
>
> Also, could you investigate removing the CXXINCS += -I/usr/X11R6/include
> line too? Normally, we should have the proper search paths already.
Sure, I guess I did it but I've forgotten to include it in a patch :/
>
> Oh, and one last point: in a post-commit message (after the --- line),
> add a note that irrlicht uses CRLF line endings, and that the patch
> will have to be fixed when applying, because patchwork drops all the
> CR and keeps on LF.
>
> Care to respin, please?
Yes, I'll do that :)
>
> In the meantime, I'll send a patch to extend the list of unsafe paths in
> our toolchain wrapper...
Good ;)
>
> Thanks! :-)
>
> Regards,
> Yann E. MORIN.
>
>> + #OSX specific options
>> +--
>> +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)
>> -- 
>> 2.27.0
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
Best
Bartek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-22 11:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-21 13:10 [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Bartosz Bilas
2020-06-21 13:10 ` [Buildroot] [PATCH 2/2] package/irrlicht: add patch to fix linking warning Bartosz Bilas
2020-06-21 20:02 ` [Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking Yann E. MORIN
2020-06-22 11:59   ` Bartosz Bilas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.