[Buildroot] [PATCH 1/2] package/irrlicht: fix libraries linking
b.bilas at grinn-global.com
Mon Jun 22 11:59:21 UTC 2020
On 21.06.2020 22:02, Yann E. MORIN wrote:
> Bartosz, All,
> On 2020-06-21 15:10 +0200, Bartosz Bilas spake thusly:
>> /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'
>> Signed-off-by: Bartosz Bilas <b.bilas at grinn-global.com>
>> +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...
> Thanks! :-)
> Yann E. MORIN.
>> + #OSX specific options
>> 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
>> +# 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
>> buildroot mailing list
>> buildroot at busybox.net
More information about the buildroot