Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/netsurf: use HOST_CFLAGS/HOST_LDFLAGS
@ 2018-12-27 13:18 Thomas Petazzoni
  2018-12-28 10:51 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2018-12-27 13:18 UTC (permalink / raw)
  To: buildroot

In commit 9b0ac875385e3bcb052fc2f376f45fa61e102673 ("package/netsurf:
make sure host libpng can be found"), the netsurf package was modified
to pass -L$(HOST_DIR)/lib so that libpng is found at link time.

However, this is not sufficient: for the host tool to work at runtime,
we need to have the proper RPATH encoded in the host
binary. Otherwise, building netsurf fails with:

build/Linux-framebuffer/tools/convert_image: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
make[3]: *** [build/Linux-framebuffer/image-caret_image.c] Error 127

So basically, we need to build not only with -L$(HOST_DIR)/lib, but
with the complete HOST_LDFLAGS provided by Buildroot.

For consistency, we also use HOST_CFLAGS instead of hardcoding
-I$(HOST_DIR)/include.

It is worth mentioning that we must use single quotes here, because
the NETSURF_CONFIG variable value then gets put within double quotes
to be passed to the netsurf build system.

Fixes:

  http://autobuild.buildroot.net/results/4ff6a8c4017d006a4b6b9ca369a569fa72862900/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/netsurf/netsurf.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/netsurf/netsurf.mk b/package/netsurf/netsurf.mk
index e5a251b9c1..2e17c5768f 100644
--- a/package/netsurf/netsurf.mk
+++ b/package/netsurf/netsurf.mk
@@ -36,8 +36,8 @@ ifeq ($(BR2_PACKAGE_NETSURF_SDL),y)
 NETSURF_DEPENDENCIES += sdl host-libpng
 NETSURF_FRONTEND = framebuffer
 NETSURF_CONFIG = \
-	HOST_CFLAGS=-I$(HOST_DIR)/include \
-	HOST_LDFLAGS='-lpng -L$(HOST_DIR)/lib'
+	HOST_CFLAGS='$(HOST_CFLAGS)' \
+	HOST_LDFLAGS='$(HOST_LDFLAGS) -lpng'
 ifeq ($(BR2_PACKAGE_FREETYPE),y)
 NETSURF_DEPENDENCIES += freetype
 define NETSURF_FONTLIB_CONFIGURE_CMDS
-- 
2.20.1

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

* [Buildroot] [PATCH] package/netsurf: use HOST_CFLAGS/HOST_LDFLAGS
  2018-12-27 13:18 [Buildroot] [PATCH] package/netsurf: use HOST_CFLAGS/HOST_LDFLAGS Thomas Petazzoni
@ 2018-12-28 10:51 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-12-28 10:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 27 Dec 2018 14:18:17 +0100, Thomas Petazzoni wrote:
> In commit 9b0ac875385e3bcb052fc2f376f45fa61e102673 ("package/netsurf:
> make sure host libpng can be found"), the netsurf package was modified
> to pass -L$(HOST_DIR)/lib so that libpng is found at link time.
> 
> However, this is not sufficient: for the host tool to work at runtime,
> we need to have the proper RPATH encoded in the host
> binary. Otherwise, building netsurf fails with:
> 
> build/Linux-framebuffer/tools/convert_image: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
> make[3]: *** [build/Linux-framebuffer/image-caret_image.c] Error 127
> 
> So basically, we need to build not only with -L$(HOST_DIR)/lib, but
> with the complete HOST_LDFLAGS provided by Buildroot.
> 
> For consistency, we also use HOST_CFLAGS instead of hardcoding
> -I$(HOST_DIR)/include.
> 
> It is worth mentioning that we must use single quotes here, because
> the NETSURF_CONFIG variable value then gets put within double quotes
> to be passed to the netsurf build system.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/4ff6a8c4017d006a4b6b9ca369a569fa72862900/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/netsurf/netsurf.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-12-28 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-27 13:18 [Buildroot] [PATCH] package/netsurf: use HOST_CFLAGS/HOST_LDFLAGS Thomas Petazzoni
2018-12-28 10:51 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox