Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] boot/barebox: Fix building of internal scripts
@ 2023-07-21  6:37 Alexander Shiyan
  2023-07-21 20:55 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shiyan @ 2023-07-21  6:37 UTC (permalink / raw)
  To: buildroot; +Cc: Alexander Shiyan

Some barebox targets need to use internal scripts, for example rockchip64
uses scripts/rkimage which requires the pkg-config package to look up the
openssl options. Since the buildroot uses its own pkkconf package for this
purpose, the scripts cannot be built correctly.
To fix this situation, let's use the CONFIGURATOR_MAKE_ENV wrapper.

  HOSTCC  scripts/rkimage
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'virtual:world', not found
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccN8Xyaj.o: in function `main':
rkimage.c:(.text.startup+0x218): undefined reference to `SHA256_Init'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: rkimage.c:(.text.startup+0x22b): undefined reference to `SHA256_Update'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: rkimage.c:(.text.startup+0x23e): undefined reference to `SHA256_Final'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: rkimage.c:(.text.startup+0x253): undefined reference to `SHA256_Init'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: rkimage.c:(.text.startup+0x265): undefined reference to `SHA256_Update'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: rkimage.c:(.text.startup+0x275): undefined reference to `SHA256_Final'
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:107: scripts/rkimage] Error 1
make[1]: *** [Makefile:976: scripts] Error 2

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 boot/barebox/Config.in  | 1 +
 boot/barebox/barebox.mk | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 3961c69c56..9a8291c944 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -1,5 +1,6 @@
 config BR2_TARGET_BAREBOX
 	bool "Barebox"
+	select BR2_PACKAGE_HOST_PKGCONF
 	help
 	  The Barebox bootloader, formerly known as U-Boot v2.
 
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index d7bcafe436..a521887cca 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -128,7 +128,9 @@ endef
 
 define $(1)_BUILD_CMDS
 	$$($(1)_BUILD_BAREBOXENV_CMDS)
-	$$($(1)_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
+# In order to compile some barebox target tools we need to use pkg-config,
+# so lets always use CONFIGURATOR_MAKE_ENV wrapper.
+	$$($(1)_CONFIGURATOR_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
 	$$($(1)_BUILD_CUSTOM_ENV)
 endef
 
-- 
2.39.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-07-23 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21  6:37 [Buildroot] [PATCH] boot/barebox: Fix building of internal scripts Alexander Shiyan
2023-07-21 20:55 ` Thomas Petazzoni via buildroot
2023-07-23 18:33   ` Alexander Shiyan

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