Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] u-boot: do not pass O=$B, if $B = $S
@ 2024-07-04 19:18 joerg.sommer
  2024-07-04 19:38 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: joerg.sommer @ 2024-07-04 19:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

The u-boot Makefile (even v2024.07) doesn't like it, when `O=…` is the same
directory as the source directory and complains about a dirty source
directory; see below. This happens when `UBOOT_MACHINE` is set and not
`UBOOT_CONFIG`.

```
% make O=$PWD all
make[1]: Entering directory '/home/joerg/git/u-boot'
  UPD     include/generated/timestamp_autogenerated.h
  Using /home/joerg/git/u-boot as source for U-Boot
  /home/joerg/git/u-boot is not clean, please run 'make mrproper'
  in the '/home/joerg/git/u-boot' directory.
make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
make[1]: Leaving directory '/home/joerg/git/u-boot'
make: *** [Makefile:177: sub-make] Error 2
```

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


Would it be possible to get this patch into kirkstone and scarthgap?


diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index fc36c21ec2..8172551c0c 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -82,11 +82,15 @@ do_compile () {
         done
         unset i
     else
-        oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
+        if [ "${S}" != "${B}" ]; then
+            O="O=${B}"
+        fi
+
+        oe_runmake -C ${S} ${O:+"$O"} ${UBOOT_MAKE_TARGET}
 
         # Generate the uboot-initial-env
         if [ -n "${UBOOT_INITIAL_ENV}" ]; then
-            oe_runmake -C ${S} O=${B} u-boot-initial-env
+            oe_runmake -C ${S} ${O:+"$O"} u-boot-initial-env
         fi
     fi
 
-- 
2.34.1



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

* Re: [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S
  2024-07-04 19:18 [PATCH] u-boot: do not pass O=$B, if $B = $S joerg.sommer
@ 2024-07-04 19:38 ` Richard Purdie
  2024-07-05  9:36   ` [PATCH] u-boot: set B = WORKDIR/build joerg.sommer
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Richard Purdie @ 2024-07-04 19:38 UTC (permalink / raw)
  To: joerg.sommer, openembedded-core

On Thu, 2024-07-04 at 21:18 +0200, Jörg Sommer via
lists.openembedded.org wrote:
> From: Jörg Sommer <joerg.sommer@navimatix.de>
> 
> The u-boot Makefile (even v2024.07) doesn't like it, when `O=…` is
> the same
> directory as the source directory and complains about a dirty source
> directory; see below. This happens when `UBOOT_MACHINE` is set and
> not
> `UBOOT_CONFIG`.
> 
> ```
> % make O=$PWD all
> make[1]: Entering directory '/home/joerg/git/u-boot'
>   UPD     include/generated/timestamp_autogenerated.h
>   Using /home/joerg/git/u-boot as source for U-Boot
>   /home/joerg/git/u-boot is not clean, please run 'make mrproper'
>   in the '/home/joerg/git/u-boot' directory.
> make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
> make[1]: Leaving directory '/home/joerg/git/u-boot'
> make: *** [Makefile:177: sub-make] Error 2
> ```
> 
> Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> ---
>  meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Can we not just always ensure B is set to somewhere different to S?

Building in S is generally a bad idea and we try to avoid that with
anything that supports it.

Cheers,

Richard


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

* [PATCH] u-boot: set B = WORKDIR/build
  2024-07-04 19:38 ` [OE-core] " Richard Purdie
@ 2024-07-05  9:36   ` joerg.sommer
  2024-07-05  9:39   ` [PATCH v2] " joerg.sommer
  2024-07-05  9:41   ` [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S Jörg Sommer
  2 siblings, 0 replies; 8+ messages in thread
From: joerg.sommer @ 2024-07-05  9:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

The build of u-boot fails, if `UBOOT_MACHINE` (instead of `UBOOT_CONFIG`) is
used. U-boot doe not like the setting of `O=$S` in the make call, which
happen when `UBOOT_MACHINE` is used. Therefore, use a dedicated build
directory to circumvent the conflict `$B == $S`.

Yocto build message:

```
| if [ -f /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/.config -o -d /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/include/config ]; then \
| 	echo >&2 "  /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'"; \
| 	echo >&2 "  in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.";\
| 	/bin/false; \
| fi;
|   /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'
|   in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.
| make[1]: Leaving directory '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git'
| make[1]: *** [/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/Makefile:1928: prepare3] Error 1
| ERROR: oe_runmake failed
```

U-Boot test:

```
% make O=$PWD all
make[1]: Entering directory '/home/joerg/git/u-boot'
  UPD     include/generated/timestamp_autogenerated.h
  Using /home/joerg/git/u-boot as source for U-Boot
  /home/joerg/git/u-boot is not clean, please run 'make mrproper'
  in the '/home/joerg/git/u-boot' directory.
make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
make[1]: Leaving directory '/home/joerg/git/u-boot'
make: *** [Makefile:177: sub-make] Error 2
```

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 54ea2e9e50..2f808d659a 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
 
 DEPENDS += "swig-native"
 
+B = "${WORKDIR}/build"
+
 EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
 EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
-- 
2.34.1



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

* [PATCH v2] u-boot: set B = WORKDIR/build
  2024-07-04 19:38 ` [OE-core] " Richard Purdie
  2024-07-05  9:36   ` [PATCH] u-boot: set B = WORKDIR/build joerg.sommer
@ 2024-07-05  9:39   ` joerg.sommer
  2024-07-05 10:03     ` [OE-core] " Richard Purdie
  2024-07-05  9:41   ` [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S Jörg Sommer
  2 siblings, 1 reply; 8+ messages in thread
From: joerg.sommer @ 2024-07-05  9:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

The build of u-boot fails, if `UBOOT_MACHINE` (instead of `UBOOT_CONFIG`) is
used. U-boot doe not like the setting of `O=$S` in the make call, which
happen when `UBOOT_MACHINE` is used. Therefore, use a dedicated build
directory to circumvent the conflict `$B == $S`.

Yocto build message:

```
| if [ -f /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/.config -o -d /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/include/config ]; then \
| 	echo >&2 "  /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'"; \
| 	echo >&2 "  in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.";\
| 	/bin/false; \
| fi;
|   /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'
|   in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.
| make[1]: Leaving directory '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git'
| make[1]: *** [/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/Makefile:1928: prepare3] Error 1
| ERROR: oe_runmake failed
```

U-Boot test:

```
% make O=$PWD all
make[1]: Entering directory '/home/joerg/git/u-boot'
  UPD     include/generated/timestamp_autogenerated.h
  Using /home/joerg/git/u-boot as source for U-Boot
  /home/joerg/git/u-boot is not clean, please run 'make mrproper'
  in the '/home/joerg/git/u-boot' directory.
make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
make[1]: Leaving directory '/home/joerg/git/u-boot'
make: *** [Makefile:177: sub-make] Error 2
```

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index fc36c21ec2..bdc4b60e43 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
 
 DEPENDS += "swig-native"
 
+B = "${WORKDIR}/build"
+
 EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}" V=1'
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
 EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
-- 
2.34.1



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

* Re: [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S
  2024-07-04 19:38 ` [OE-core] " Richard Purdie
  2024-07-05  9:36   ` [PATCH] u-boot: set B = WORKDIR/build joerg.sommer
  2024-07-05  9:39   ` [PATCH v2] " joerg.sommer
@ 2024-07-05  9:41   ` Jörg Sommer
  2024-07-05  9:50     ` Richard Purdie
  2 siblings, 1 reply; 8+ messages in thread
From: Jörg Sommer @ 2024-07-05  9:41 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]

Richard Purdie schrieb am Do 04. Jul, 20:38 (GMT):
> On Thu, 2024-07-04 at 21:18 +0200, Jörg Sommer via
> lists.openembedded.org wrote:
> > From: Jörg Sommer <joerg.sommer@navimatix.de>
> > 
> > The u-boot Makefile (even v2024.07) doesn't like it, when `O=…` is
> > the same
> > directory as the source directory and complains about a dirty source
> > directory; see below. This happens when `UBOOT_MACHINE` is set and
> > not
> > `UBOOT_CONFIG`.
> > 
> > ```
> > % make O=$PWD all
> > make[1]: Entering directory '/home/joerg/git/u-boot'
> >   UPD     include/generated/timestamp_autogenerated.h
> >   Using /home/joerg/git/u-boot as source for U-Boot
> >   /home/joerg/git/u-boot is not clean, please run 'make mrproper'
> >   in the '/home/joerg/git/u-boot' directory.
> > make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
> > make[1]: Leaving directory '/home/joerg/git/u-boot'
> > make: *** [Makefile:177: sub-make] Error 2
> > ```
> > 
> > Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> > ---
> >  meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> Can we not just always ensure B is set to somewhere different to S?
> 
> Building in S is generally a bad idea and we try to avoid that with
> anything that supports it.

I did some tests and yes, setting $B solves my build issue and does not harm
a build with UBOOT_CONFIG. But I must admit, I could only test this with
kirkstone.

Would it be possible to get this patch in kirkstone and scarthgap, too?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5068 bytes --]

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

* Re: [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S
  2024-07-05  9:41   ` [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S Jörg Sommer
@ 2024-07-05  9:50     ` Richard Purdie
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2024-07-05  9:50 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: openembedded-core

On Fri, 2024-07-05 at 11:41 +0200, Jörg Sommer wrote:
> Richard Purdie schrieb am Do 04. Jul, 20:38 (GMT):
> > On Thu, 2024-07-04 at 21:18 +0200, Jörg Sommer via
> > lists.openembedded.org wrote:
> > > From: Jörg Sommer <joerg.sommer@navimatix.de>
> > > 
> > > The u-boot Makefile (even v2024.07) doesn't like it, when `O=…` is
> > > the same
> > > directory as the source directory and complains about a dirty source
> > > directory; see below. This happens when `UBOOT_MACHINE` is set and
> > > not
> > > `UBOOT_CONFIG`.
> > > 
> > > ```
> > > % make O=$PWD all
> > > make[1]: Entering directory '/home/joerg/git/u-boot'
> > >   UPD     include/generated/timestamp_autogenerated.h
> > >   Using /home/joerg/git/u-boot as source for U-Boot
> > >   /home/joerg/git/u-boot is not clean, please run 'make mrproper'
> > >   in the '/home/joerg/git/u-boot' directory.
> > > make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
> > > make[1]: Leaving directory '/home/joerg/git/u-boot'
> > > make: *** [Makefile:177: sub-make] Error 2
> > > ```
> > > 
> > > Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> > > ---
> > >  meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > Can we not just always ensure B is set to somewhere different to S?
> > 
> > Building in S is generally a bad idea and we try to avoid that with
> > anything that supports it.
> 
> I did some tests and yes, setting $B solves my build issue and does not harm
> a build with UBOOT_CONFIG. But I must admit, I could only test this with
> kirkstone.
> 
> Would it be possible to get this patch in kirkstone and scarthgap, too?

A patch setting B is more likely to get merged than the one you
originally posted. To get into kirkstone/scarthgap, we need to fix
master first, then backport as appropriate. Any patch does really need
to be tested with master first too. 

Whilst not essential, it would also be nice to understand whether there
is automated tests we should have to cover any particular scenarios
which are missing.

Cheers,

Richard




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

* Re: [OE-core] [PATCH v2] u-boot: set B = WORKDIR/build
  2024-07-05  9:39   ` [PATCH v2] " joerg.sommer
@ 2024-07-05 10:03     ` Richard Purdie
  2024-07-05 10:35       ` Jörg Sommer
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2024-07-05 10:03 UTC (permalink / raw)
  To: joerg.sommer, openembedded-core

On Fri, 2024-07-05 at 11:39 +0200, Jörg Sommer via lists.openembedded.org wrote:
> From: Jörg Sommer <joerg.sommer@navimatix.de>
> 
> The build of u-boot fails, if `UBOOT_MACHINE` (instead of `UBOOT_CONFIG`) is
> used. U-boot doe not like the setting of `O=$S` in the make call, which
> happen when `UBOOT_MACHINE` is used. Therefore, use a dedicated build
> directory to circumvent the conflict `$B == $S`.
> 
> Yocto build message:
> 
> ```
> > if [ -f /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/.config -o -d /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/include/config ]; then \
> > 	echo >&2 "  /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'"; \
> > 	echo >&2 "  in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.";\
> > 	/bin/false; \
> > fi;
> >   /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'
> >   in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.
> > make[1]: Leaving directory '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git'
> > make[1]: *** [/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/Makefile:1928: prepare3] Error 1
> > ERROR: oe_runmake failed
> ```
> 
> U-Boot test:
> 
> ```
> % make O=$PWD all
> make[1]: Entering directory '/home/joerg/git/u-boot'
>   UPD     include/generated/timestamp_autogenerated.h
>   Using /home/joerg/git/u-boot as source for U-Boot
>   /home/joerg/git/u-boot is not clean, please run 'make mrproper'
>   in the '/home/joerg/git/u-boot' directory.
> make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
> make[1]: Leaving directory '/home/joerg/git/u-boot'
> make: *** [Makefile:177: sub-make] Error 2
> ```
> 
> Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> ---
>  meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
> index fc36c21ec2..bdc4b60e43 100644
> --- a/meta/recipes-bsp/u-boot/u-boot.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> @@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
>  
>  DEPENDS += "swig-native"
>  
> +B = "${WORKDIR}/build"
> +
>  EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}" V=1'
>  EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
>  EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
> 

I did a little digging as I wondered why this wasn't already the case.
That variable is set in u-boot-common.inc along with a cleandirs for B.
Are you able to use that common inc file? I didn't check the situation
on older releases.

Cheers,

Richard






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

* Re: [OE-core] [PATCH v2] u-boot: set B = WORKDIR/build
  2024-07-05 10:03     ` [OE-core] " Richard Purdie
@ 2024-07-05 10:35       ` Jörg Sommer
  0 siblings, 0 replies; 8+ messages in thread
From: Jörg Sommer @ 2024-07-05 10:35 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3783 bytes --]

Richard Purdie schrieb am Fr 05. Jul, 11:03 (GMT):
> On Fri, 2024-07-05 at 11:39 +0200, Jörg Sommer via lists.openembedded.org wrote:
> > From: Jörg Sommer <joerg.sommer@navimatix.de>
> > 
> > The build of u-boot fails, if `UBOOT_MACHINE` (instead of `UBOOT_CONFIG`) is
> > used. U-boot doe not like the setting of `O=$S` in the make call, which
> > happen when `UBOOT_MACHINE` is used. Therefore, use a dedicated build
> > directory to circumvent the conflict `$B == $S`.
> > 
> > Yocto build message:
> > 
> > ```
> > > if [ -f /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/.config -o -d /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/include/config ]; then \
> > > 	echo >&2 "  /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'"; \
> > > 	echo >&2 "  in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.";\
> > > 	/bin/false; \
> > > fi;
> > >   /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'
> > >   in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.
> > > make[1]: Leaving directory '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git'
> > > make[1]: *** [/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/Makefile:1928: prepare3] Error 1
> > > ERROR: oe_runmake failed
> > ```
> > 
> > U-Boot test:
> > 
> > ```
> > % make O=$PWD all
> > make[1]: Entering directory '/home/joerg/git/u-boot'
> >   UPD     include/generated/timestamp_autogenerated.h
> >   Using /home/joerg/git/u-boot as source for U-Boot
> >   /home/joerg/git/u-boot is not clean, please run 'make mrproper'
> >   in the '/home/joerg/git/u-boot' directory.
> > make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
> > make[1]: Leaving directory '/home/joerg/git/u-boot'
> > make: *** [Makefile:177: sub-make] Error 2
> > ```
> > 
> > Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> > ---
> >  meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
> > index fc36c21ec2..bdc4b60e43 100644
> > --- a/meta/recipes-bsp/u-boot/u-boot.inc
> > +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> > @@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
> >  
> >  DEPENDS += "swig-native"
> >  
> > +B = "${WORKDIR}/build"
> > +
> >  EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}" V=1'
> >  EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
> >  EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
> > 
> 
> I did a little digging as I wondered why this wasn't already the case.
> That variable is set in u-boot-common.inc along with a cleandirs for B.
> Are you able to use that common inc file? I didn't check the situation
> on older releases.

Interesting. So this is a bug in the variscite layer. They supersede the
u-boot-common.inc with there own which does not set B:
https://github.com/varigit/meta-variscite-bsp-imx/blob/kirkstone/recipes-bsp/u-boot/u-boot-common.inc

So, we can drop the patch and I ask variscite to fix the issue.

Many thanks for your help!

Kind regards, Jörg

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5068 bytes --]

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

end of thread, other threads:[~2024-07-05 10:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 19:18 [PATCH] u-boot: do not pass O=$B, if $B = $S joerg.sommer
2024-07-04 19:38 ` [OE-core] " Richard Purdie
2024-07-05  9:36   ` [PATCH] u-boot: set B = WORKDIR/build joerg.sommer
2024-07-05  9:39   ` [PATCH v2] " joerg.sommer
2024-07-05 10:03     ` [OE-core] " Richard Purdie
2024-07-05 10:35       ` Jörg Sommer
2024-07-05  9:41   ` [OE-core] [PATCH] u-boot: do not pass O=$B, if $B = $S Jörg Sommer
2024-07-05  9:50     ` Richard Purdie

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