Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: buildroot@buildroot.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [Buildroot] [PATCH] boot/barebox: Fix building of internal scripts
Date: Fri, 21 Jul 2023 09:37:55 +0300	[thread overview]
Message-ID: <20230721063755.315887-1-eagle.alexander923@gmail.com> (raw)

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

             reply	other threads:[~2023-07-21  6:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  6:37 Alexander Shiyan [this message]
2023-07-21 20:55 ` [Buildroot] [PATCH] boot/barebox: Fix building of internal scripts Thomas Petazzoni via buildroot
2023-07-23 18:33   ` Alexander Shiyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230721063755.315887-1-eagle.alexander923@gmail.com \
    --to=eagle.alexander923@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox