Re: [ptxdist] Build U-Boot against host-openssl fails

2022-08-03 Thread Alexander Dahl
Hello Michael,

I tried building the same U-Boot 2022.04 for a different board in a different 
BSP now, which uses ptxdist 2021.06 already. This works at least somehow. More 
comments below.

Am Freitag, 29. Juli 2022, 08:40:19 CEST schrieb Michael Olbrich:
> On Tue, Jul 26, 2022 at 09:43:09AM +0200, Alexander Dahl wrote:
> > Am Montag, 25. Juli 2022, 21:09:35 CEST schrieb Alexander Dahl:
> > > Am Mon, Jul 25, 2022 at 05:36:57PM +0200 schrieb Michael Olbrich:
> > > > On Mon, Jul 25, 2022 at 04:41:45PM +0200, Alexander Dahl wrote:
> > > > > although claiming it's optional latest U-Boot versions require
> > > > > OpenSSL
> > > > > on the host.¹  I added an option to build host-openssl with commit
> > > > > 0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to
> > > > > depend
> > > > > on
> > > > > host-openssl") but ptxdist u-boot package still fails to link to
> > > > > host
> > > > > openssl package, message is always missing some openssl symbols.
> > > > > 
> > > > > I tried the same thing as barebox now in rules/u-boot.make like
> > > > > this:
> > > > > 
> > > > > +# use host pkg-config for host tools
> > > > > +U_BOOT_PATH:= PATH=$(HOST_PATH)
> > > > > 
> > > > > This does not help.

Adding this or not would make a difference in build behaviour if U-Boot would 
not have that fallback in its Makefile.  

If it's present '…/platform-v7a/sysroot-host/bin/pkg-config' is used.

If it's _not_ present '…/platform-v7a/sysroot-cross/bin/pkg-config' is used.

So it seems to be the right thing from a rule file point of view to add this. 
I will send a patch.

> > > > > 
> > > > > I'm somehow suspecting the wrong pkg-config is called.  Affected is
> > > > > not
> > > > > the
> > > > > target image, but the host tools (like mkimage) built alongside with
> > > > > the
> > > > > target stuff (which you 1) can not disable to build and 2) need for
> > > > > certain
> > > > > parts of the ptxdist package anyways, so not building those is no
> > > > > option).
> > > > > 
> > > > > I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and
> > > > > CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.

With ptxdist 2021.06 and setting both of those to 'yes', build is successful. 

(Note: At least U-Boot 2022.04 and 2022.07 are buggy and do not allow to build 
with CONFIG_TOOLS_LIBCRYPTO disabled and host libssl-dev absent [1].)

> > > > > 
> > > > > buildroot has a fix for building against host-openssl, but I don't
> > > > > understand it, and I'm not sure if the same approach would work in
> > > > > ptxdist.
> > > > > 
> > > > > Any ideas?
> > > > > 
> > > > > (Disclaimer: this only happens on a quite recent U-Boot, e.g. from
> > > > > 2022.)
> > > > > (More disclaimer: it does not happen if libssl-dev is installed on
> > > > > the
> > > > > build host.)

Did not try with libssl-dev installed on the host again.  It should work 
against host-openssl package from ptxdist, otherwise I would consider it 
broken anyways.

> > > > 
> > > > This sounds like u-boot is calling /usr/bin/pkg-config instead of
> > > > .../sysroot-host/bin/pkg-config (and not the cross pkg-config either).
> > > > 
> > > > Maybe /usr/bin/pkg-config is called explicitly with the whole path
> > > > somewhere? That could be a "feature" to avoid the cross pkg-config
> > > > when
> > > > cross-compiling.
> > > 
> > > Sorry, I wanted to paste the actual part from tools/Makefile (u-boot
> > > source) and this is it:
> > > 
> > > 174 # MXSImage needs LibSSL
> > > 175 ifneq
> > > ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPT
> > > O),
> > > ) 176 HOSTCFLAGS_kwbimage.o += \
> > > 177 $(shell pkg-config --cflags libssl libcrypto 2> /dev/null ||
> > > echo
> > > "") 178 HOSTLDLIBS_mkimage += \
> > > 179 $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo
> > > "-lssl -lcrypto") 180
> > > 181 # OS X deprecate openssl in favour of CommonCrypto, supress
> > > deprecation
> > > 182 # warnings on those systems
> > > 183 ifeq ($(HOSTOS),darwin)
> > > 184 HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations
> > > 185 HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations
> > > 186 HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
> > > 187 endif
> > > 188 endif
> > > 
> > > I'm not sure how I can verify what's actually called here?
> > 
> > Added this line in U-Boot source tools/Makefile to see what's going on:
> >   $(info HOSTLDLIBS_mkimage is $(HOSTLDLIBS_mkimage))
> > 
> > (directly after that is assigned)
> > 
> > Output is:
> >   HOSTLDLIBS_mkimage is -lssl -lcrypto

Still gives:

  HOSTLDLIBS_mkimage is -lssl -lcrypto

Even does that if I remove the '|| echo "-lssl -lcrypto"' fallback, so that's 
probably a good thing. (Is empty with removed fallback without the U_BOOT_PATH 
fix from above, then build fails.)

> >   
> > > Just had another look at what buildroot does.  Seems like
> > > host-pkg-config is required, IIRC that was not used by ptxdist.  Not
> > > sure how I can let ptxdist 

Re: [ptxdist] Build U-Boot against host-openssl fails

2022-07-29 Thread Michael Olbrich
On Tue, Jul 26, 2022 at 09:43:09AM +0200, Alexander Dahl wrote:
> Am Montag, 25. Juli 2022, 21:09:35 CEST schrieb Alexander Dahl:
> > Am Mon, Jul 25, 2022 at 05:36:57PM +0200 schrieb Michael Olbrich:
> > > On Mon, Jul 25, 2022 at 04:41:45PM +0200, Alexander Dahl wrote:
> > > > although claiming it's optional latest U-Boot versions require OpenSSL
> > > > on the host.¹  I added an option to build host-openssl with commit
> > > > 0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to depend
> > > > on
> > > > host-openssl") but ptxdist u-boot package still fails to link to host
> > > > openssl package, message is always missing some openssl symbols.
> > > > 
> > > > I tried the same thing as barebox now in rules/u-boot.make like this:
> > > > 
> > > > +# use host pkg-config for host tools
> > > > +U_BOOT_PATH:= PATH=$(HOST_PATH)
> > > > 
> > > > This does not help.
> > > > 
> > > > I'm somehow suspecting the wrong pkg-config is called.  Affected is not
> > > > the
> > > > target image, but the host tools (like mkimage) built alongside with the
> > > > target stuff (which you 1) can not disable to build and 2) need for
> > > > certain
> > > > parts of the ptxdist package anyways, so not building those is no
> > > > option).
> > > > 
> > > > I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and
> > > > CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.
> > > > 
> > > > buildroot has a fix for building against host-openssl, but I don't
> > > > understand it, and I'm not sure if the same approach would work in
> > > > ptxdist.
> > > > 
> > > > Any ideas?
> > > > 
> > > > (Disclaimer: this only happens on a quite recent U-Boot, e.g. from
> > > > 2022.)
> > > > (More disclaimer: it does not happen if libssl-dev is installed on the
> > > > build host.)
> > > 
> > > This sounds like u-boot is calling /usr/bin/pkg-config instead of
> > > .../sysroot-host/bin/pkg-config (and not the cross pkg-config either).
> > > 
> > > Maybe /usr/bin/pkg-config is called explicitly with the whole path
> > > somewhere? That could be a "feature" to avoid the cross pkg-config when
> > > cross-compiling.
> > 
> > Sorry, I wanted to paste the actual part from tools/Makefile (u-boot
> > source) and this is it:
> > 
> > 174 # MXSImage needs LibSSL
> > 175 ifneq
> > ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),
> > ) 176 HOSTCFLAGS_kwbimage.o += \
> > 177 $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo
> > "") 178 HOSTLDLIBS_mkimage += \
> > 179 $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo
> > "-lssl -lcrypto") 180
> > 181 # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
> > 182 # warnings on those systems
> > 183 ifeq ($(HOSTOS),darwin)
> > 184 HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations
> > 185 HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations
> > 186 HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
> > 187 endif
> > 188 endif
> > 
> > I'm not sure how I can verify what's actually called here?
> 
> Added this line in U-Boot source tools/Makefile to see what's going on: 
> 
>   $(info HOSTLDLIBS_mkimage is $(HOSTLDLIBS_mkimage))
> 
> (directly after that is assigned)
> 
> Output is:
> 
>   HOSTLDLIBS_mkimage is -lssl -lcrypto 
> 
> > Just had another look at what buildroot does.  Seems like
> > host-pkg-config is required, IIRC that was not used by ptxdist.  Not
> > sure how I can let ptxdist use host pkg-config, but I hope I'll find
> > out tomorrow.
> 
> Yeah well, it was late yesterday, what the barebox package does is setting 
> _PATH and I tried that already (as written before). So I tried calling 
> pkg-config with that path the same way the U-Boot Makefile does (redacted):
> 
> 
> % p print U_BOOT_PATH
> PATH=/home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/
> Work/bsp/***/***/platform-***/sysroot-host/sbin:/opt/
> OSELAS.Toolchain-2018.02.0/arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-
> binutils-2.30-kernel-4.15-sanitized/bin:/usr/local/lib/ptxdist-2018.05.0/bin:/
> home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/Work/
> bsp/***/***/platform-***/sysroot-host/sbin:/opt/OSELAS.Toolchain-2018.02.0/
> arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-binutils-2.30-kernel-4.15-
> sanitized/bin:/usr/local/lib/ptxdist-2022.05.0/bin:/home/adahl/bin:/home/
> adahl/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
> 
> % PATH=/home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/
> Work/bsp/***/***/platform-***/sysroot-host/sbin:/opt/
> OSELAS.Toolchain-2018.02.0/arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-
> binutils-2.30-kernel-4.15-sanitized/bin:/usr/local/lib/ptxdist-2018.05.0/bin:/
> home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/Work/
> bsp/***/***/platform-***/sysroot-host/sbin:/opt/OSELAS.Toolchain-2018.02.0/
> arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-binutils-2.30-kernel-4.15-
> 

Re: [ptxdist] Build U-Boot against host-openssl fails

2022-07-26 Thread Alexander Dahl
Good morning,

Am Montag, 25. Juli 2022, 21:09:35 CEST schrieb Alexander Dahl:
> Hello Michael,
> 
> Am Mon, Jul 25, 2022 at 05:36:57PM +0200 schrieb Michael Olbrich:
> > On Mon, Jul 25, 2022 at 04:41:45PM +0200, Alexander Dahl wrote:
> > > Hei hei,
> > > 
> > > although claiming it's optional latest U-Boot versions require OpenSSL
> > > on the host.¹  I added an option to build host-openssl with commit
> > > 0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to depend
> > > on
> > > host-openssl") but ptxdist u-boot package still fails to link to host
> > > openssl package, message is always missing some openssl symbols.
> > > 
> > > I tried the same thing as barebox now in rules/u-boot.make like this:
> > > 
> > > +# use host pkg-config for host tools
> > > +U_BOOT_PATH:= PATH=$(HOST_PATH)
> > > 
> > > This does not help.
> > > 
> > > I'm somehow suspecting the wrong pkg-config is called.  Affected is not
> > > the
> > > target image, but the host tools (like mkimage) built alongside with the
> > > target stuff (which you 1) can not disable to build and 2) need for
> > > certain
> > > parts of the ptxdist package anyways, so not building those is no
> > > option).
> > > 
> > > I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and
> > > CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.
> > > 
> > > buildroot has a fix for building against host-openssl, but I don't
> > > understand it, and I'm not sure if the same approach would work in
> > > ptxdist.
> > > 
> > > Any ideas?
> > > 
> > > (Disclaimer: this only happens on a quite recent U-Boot, e.g. from
> > > 2022.)
> > > (More disclaimer: it does not happen if libssl-dev is installed on the
> > > build host.)
> > 
> > This sounds like u-boot is calling /usr/bin/pkg-config instead of
> > .../sysroot-host/bin/pkg-config (and not the cross pkg-config either).
> > 
> > Maybe /usr/bin/pkg-config is called explicitly with the whole path
> > somewhere? That could be a "feature" to avoid the cross pkg-config when
> > cross-compiling.
> 
> Sorry, I wanted to paste the actual part from tools/Makefile (u-boot
> source) and this is it:
> 
> 174 # MXSImage needs LibSSL
> 175 ifneq
> ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),
> ) 176 HOSTCFLAGS_kwbimage.o += \
> 177 $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo
> "") 178 HOSTLDLIBS_mkimage += \
> 179 $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo
> "-lssl -lcrypto") 180
> 181 # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
> 182 # warnings on those systems
> 183 ifeq ($(HOSTOS),darwin)
> 184 HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations
> 185 HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations
> 186 HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
> 187 endif
> 188 endif
> 
> I'm not sure how I can verify what's actually called here?

Added this line in U-Boot source tools/Makefile to see what's going on: 

  $(info HOSTLDLIBS_mkimage is $(HOSTLDLIBS_mkimage))

(directly after that is assigned)

Output is:

  HOSTLDLIBS_mkimage is -lssl -lcrypto 

> Just had another look at what buildroot does.  Seems like
> host-pkg-config is required, IIRC that was not used by ptxdist.  Not
> sure how I can let ptxdist use host pkg-config, but I hope I'll find
> out tomorrow.

Yeah well, it was late yesterday, what the barebox package does is setting 
_PATH and I tried that already (as written before). So I tried calling 
pkg-config with that path the same way the U-Boot Makefile does (redacted):


% p print U_BOOT_PATH
PATH=/home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/
Work/bsp/***/***/platform-***/sysroot-host/sbin:/opt/
OSELAS.Toolchain-2018.02.0/arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-
binutils-2.30-kernel-4.15-sanitized/bin:/usr/local/lib/ptxdist-2018.05.0/bin:/
home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/Work/
bsp/***/***/platform-***/sysroot-host/sbin:/opt/OSELAS.Toolchain-2018.02.0/
arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-binutils-2.30-kernel-4.15-
sanitized/bin:/usr/local/lib/ptxdist-2022.05.0/bin:/home/adahl/bin:/home/
adahl/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

% PATH=/home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/
Work/bsp/***/***/platform-***/sysroot-host/sbin:/opt/
OSELAS.Toolchain-2018.02.0/arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-
binutils-2.30-kernel-4.15-sanitized/bin:/usr/local/lib/ptxdist-2018.05.0/bin:/
home/adahl/Work/bsp/***/***/platform-***/sysroot-host/bin:/home/adahl/Work/
bsp/***/***/platform-***/sysroot-host/sbin:/opt/OSELAS.Toolchain-2018.02.0/
arm-v7a-linux-gnueabihf/gcc-7.3.1-glibc-2.27-binutils-2.30-kernel-4.15-
sanitized/bin:/usr/local/lib/ptxdist-2022.05.0/bin:/home/adahl/bin:/home/
adahl/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games pkg-
config --libs libssl libcrypto

Re: [ptxdist] Build U-Boot against host-openssl fails

2022-07-25 Thread Alexander Dahl
Hello Michael,

Am Mon, Jul 25, 2022 at 05:36:57PM +0200 schrieb Michael Olbrich:
> On Mon, Jul 25, 2022 at 04:41:45PM +0200, Alexander Dahl wrote:
> > Hei hei,
> > 
> > although claiming it's optional latest U-Boot versions require OpenSSL on 
> > the 
> > host.¹  I added an option to build host-openssl with commit 
> > 0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to depend on 
> > host-openssl") but ptxdist u-boot package still fails to link to host 
> > openssl 
> > package, message is always missing some openssl symbols.
> > 
> > I tried the same thing as barebox now in rules/u-boot.make like this:
> > 
> > +# use host pkg-config for host tools
> > +U_BOOT_PATH:= PATH=$(HOST_PATH)
> > 
> > This does not help. 
> > 
> > I'm somehow suspecting the wrong pkg-config is called.  Affected is not the 
> > target image, but the host tools (like mkimage) built alongside with the 
> > target stuff (which you 1) can not disable to build and 2) need for certain 
> > parts of the ptxdist package anyways, so not building those is no option).
> > 
> > I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and 
> > CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.
> > 
> > buildroot has a fix for building against host-openssl, but I don't 
> > understand 
> > it, and I'm not sure if the same approach would work in ptxdist.
> > 
> > Any ideas?
> > 
> > (Disclaimer: this only happens on a quite recent U-Boot, e.g. from 2022.)
> > (More disclaimer: it does not happen if libssl-dev is installed on the 
> > build 
> > host.)
> 
> This sounds like u-boot is calling /usr/bin/pkg-config instead of
> .../sysroot-host/bin/pkg-config (and not the cross pkg-config either).
> 
> Maybe /usr/bin/pkg-config is called explicitly with the whole path
> somewhere? That could be a "feature" to avoid the cross pkg-config when
> cross-compiling.

Sorry, I wanted to paste the actual part from tools/Makefile (u-boot
source) and this is it:

174 # MXSImage needs LibSSL
175 ifneq 
($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),)
176 HOSTCFLAGS_kwbimage.o += \
177 $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
178 HOSTLDLIBS_mkimage += \
179 $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl 
-lcrypto")
180
181 # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
182 # warnings on those systems
183 ifeq ($(HOSTOS),darwin)
184 HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations
185 HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations
186 HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
187 endif
188 endif

I'm not sure how I can verify what's actually called here?

Just had another look at what buildroot does.  Seems like
host-pkg-config is required, IIRC that was not used by ptxdist.  Not
sure how I can let ptxdist use host pkg-config, but I hope I'll find
out tomorrow.

Greets
Alex

> 
> Michael
> 
> > ¹ I consider this a bug, and I'm not the only one, but several attempts to 
> > fix 
> > this in upstream U-Boot did not lead to merge any fix.
> > 
> > 
> > 
> > 
> > 
> 
> -- 
> Pengutronix e.K.   | |
> Steuerwalder Str. 21   | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
> Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
 X  AGAINST  | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL| (Jean-Luc Picard, quoting Judge Aaron Satie)


signature.asc
Description: PGP signature


Re: [ptxdist] Build U-Boot against host-openssl fails

2022-07-25 Thread Michael Olbrich
On Mon, Jul 25, 2022 at 04:41:45PM +0200, Alexander Dahl wrote:
> Hei hei,
> 
> although claiming it's optional latest U-Boot versions require OpenSSL on the 
> host.¹  I added an option to build host-openssl with commit 
> 0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to depend on 
> host-openssl") but ptxdist u-boot package still fails to link to host openssl 
> package, message is always missing some openssl symbols.
> 
> I tried the same thing as barebox now in rules/u-boot.make like this:
> 
> +# use host pkg-config for host tools
> +U_BOOT_PATH:= PATH=$(HOST_PATH)
> 
> This does not help. 
> 
> I'm somehow suspecting the wrong pkg-config is called.  Affected is not the 
> target image, but the host tools (like mkimage) built alongside with the 
> target stuff (which you 1) can not disable to build and 2) need for certain 
> parts of the ptxdist package anyways, so not building those is no option).
> 
> I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and 
> CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.
> 
> buildroot has a fix for building against host-openssl, but I don't understand 
> it, and I'm not sure if the same approach would work in ptxdist.
> 
> Any ideas?
> 
> (Disclaimer: this only happens on a quite recent U-Boot, e.g. from 2022.)
> (More disclaimer: it does not happen if libssl-dev is installed on the build 
> host.)

This sounds like u-boot is calling /usr/bin/pkg-config instead of
.../sysroot-host/bin/pkg-config (and not the cross pkg-config either).

Maybe /usr/bin/pkg-config is called explicitly with the whole path
somewhere? That could be a "feature" to avoid the cross pkg-config when
cross-compiling.

Michael

> ¹ I consider this a bug, and I'm not the only one, but several attempts to 
> fix 
> this in upstream U-Boot did not lead to merge any fix.
> 
> 
> 
> 
> 

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |



[ptxdist] Build U-Boot against host-openssl fails

2022-07-25 Thread Alexander Dahl
Hei hei,

although claiming it's optional latest U-Boot versions require OpenSSL on the 
host.¹  I added an option to build host-openssl with commit 
0c779a60e50c40d522b1e9c20b5c75b2e57fde5a ("u-boot: Add option to depend on 
host-openssl") but ptxdist u-boot package still fails to link to host openssl 
package, message is always missing some openssl symbols.

I tried the same thing as barebox now in rules/u-boot.make like this:

+# use host pkg-config for host tools
+U_BOOT_PATH:= PATH=$(HOST_PATH)

This does not help. 

I'm somehow suspecting the wrong pkg-config is called.  Affected is not the 
target image, but the host tools (like mkimage) built alongside with the 
target stuff (which you 1) can not disable to build and 2) need for certain 
parts of the ptxdist package anyways, so not building those is no option).

I tried each combination of PTXCONF_U_BOOT_NEEDS_HOST_OPENSSL and 
CONFIG_TOOLS_LIBCRYPTO in U-Boot kconfig, all fail.

buildroot has a fix for building against host-openssl, but I don't understand 
it, and I'm not sure if the same approach would work in ptxdist.

Any ideas?

(Disclaimer: this only happens on a quite recent U-Boot, e.g. from 2022.)
(More disclaimer: it does not happen if libssl-dev is installed on the build 
host.)

Greets
Alex

¹ I consider this a bug, and I'm not the only one, but several attempts to fix 
this in upstream U-Boot did not lead to merge any fix.