diff mbox series

syslinux: clean old object and dependency files before do_install

Message ID 20250926073618.4162662-1-haixiao.yan.cn@windriver.com
State New
Headers show
Series syslinux: clean old object and dependency files before do_install | expand

Commit Message

Haixiao Yan Sept. 26, 2025, 7:36 a.m. UTC
From: Haixiao Yan <haixiao.yan.cn@windriver.com>

Remove all previous .o and .d files from OBJ directories before
running do_install. This prevents stale build artifacts from
interfering with the installation of new binaries and modules,
especially after GCC upgrades that can invalidate existing dependency
files, such as:

make[4]: *** No rule to make target
'/build/tmp-glibc/work/corei7-64-wrs-linux/syslinux/6.04-pre2-r1/recipe-sysroot-native/
usr/lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/12.4.0/include/stdarg.h',
needed by 'zlib/adler32.o'.  Stop.

Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
---
 meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexander Kanavin Sept. 26, 2025, 7:43 a.m. UTC | #1
On Fri, 26 Sept 2025 at 09:37, Yan, Haixiao (CN) via
lists.openembedded.org
<Haixiao.Yan.CN=windriver.com@lists.openembedded.org> wrote:
> make[4]: *** No rule to make target
> '/build/tmp-glibc/work/corei7-64-wrs-linux/syslinux/6.04-pre2-r1/recipe-sysroot-native/
> usr/lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/12.4.0/include/stdarg.h',
> needed by 'zlib/adler32.o'.  Stop.
>
> Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
> ---
>  meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
> index 449a75ebf8ab..ea4bf6e6a88b 100644
> --- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
> +++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
> @@ -107,6 +107,7 @@ do_compile:class-target() {
>  }
>
>  do_install:class-target() {
> +       oe_runmake firmware="bios" clean
>         oe_runmake firmware="bios" install INSTALLROOT="${D}"

I'm not sure I understand what happens here. The issue seem to be that
Makefile refers to a file that no longer exists in the sysroot. How
would performing a 'make clean' address that issue?

Alex
Haixiao Yan Sept. 26, 2025, 7:57 a.m. UTC | #2
On 2025/9/26 15:43, Alexander Kanavin wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Fri, 26 Sept 2025 at 09:37, Yan, Haixiao (CN) via
> lists.openembedded.org
> <Haixiao.Yan.CN=windriver.com@lists.openembedded.org> wrote:
>> make[4]: *** No rule to make target
>> '/build/tmp-glibc/work/corei7-64-wrs-linux/syslinux/6.04-pre2-r1/recipe-sysroot-native/
>> usr/lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/12.4.0/include/stdarg.h',
>> needed by 'zlib/adler32.o'.  Stop.
>>
>> Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
>> ---
>>   meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
>> index 449a75ebf8ab..ea4bf6e6a88b 100644
>> --- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
>> +++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
>> @@ -107,6 +107,7 @@ do_compile:class-target() {
>>   }
>>
>>   do_install:class-target() {
>> +       oe_runmake firmware="bios" clean
>>          oe_runmake firmware="bios" install INSTALLROOT="${D}"
> I'm not sure I understand what happens here. The issue seem to be that
> Makefile refers to a file that no longer exists in the sysroot. How
> would performing a 'make clean' address that issue?
Building syslinux normally works fine, but after upgrading GCC from 
12.4.0 to 12.5.0, rebuilding syslinux results in a build failure.
Listing the object and dependency files under 
syslinux/6.04-pre2-r1/syslinux-6.04-pre2/bios/com32/lib/zlib shows:

./            compress.o     deflate.o     inffast.o inftrees.o     
uncompr.o
../           .compress.o.d  .deflate.o.d  .inffast.o.d .inftrees.o.d  
.uncompr.o.d
adler32.o     crc32.o        infback.o     inflate.o trees.o        zutil.o
.adler32.o.d  .crc32.o.d     .infback.o.d  .inflate.o.d .trees.o.d     
.zutil.o.d

The dependency file .adler32.o.d references an outdated header:
/build/tmp-glibc/work/corei7-64-wrs-linux/syslinux/6.04-pre2-r1/recipe-sysroot-native/usr/lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/12.4.0/include/stdarg.h

Since stdarg.h cannot be found, the build fails.

Executing `make clean` deletes all existing .o and .d files from the OBJ 
directories, ensuring that zlib is rebuilt from scratch and preventing 
stale dependencies from causing build errors.

Thanks,

Haixiao

> Alex
Alexander Kanavin Sept. 26, 2025, 8:27 a.m. UTC | #3
On Fri, 26 Sept 2025 at 10:03, Haixiao Yan <haixiao.yan.cn@windriver.com> wrote:

> Executing `make clean` deletes all existing .o and .d files from the OBJ
> directories, ensuring that zlib is rebuilt from scratch and preventing
> stale dependencies from causing build errors.

Thanks for the explanation. The next question I had was why the
standard clean mechanism that is usually triggered in do_configure()
isn't working, and indeed I am seeing this in the recipe:

do_configure() {
        oe_runmake firmware="bios" clean
}
...

do_configure:class-target() {
        # No need to do anything as we're mostly shipping the
precompiled binaries
        :
}

Should this second function be removed instead, so that the standard
one takes over and does the cleaning?

Alex
Khem Raj Sept. 26, 2025, 5:05 p.m. UTC | #4
On 9/26/25 1:27 AM, Alexander Kanavin via lists.openembedded.org wrote:
> On Fri, 26 Sept 2025 at 10:03, Haixiao Yan <haixiao.yan.cn@windriver.com> wrote:
> 
>> Executing `make clean` deletes all existing .o and .d files from the OBJ
>> directories, ensuring that zlib is rebuilt from scratch and preventing
>> stale dependencies from causing build errors.
> 
> Thanks for the explanation. The next question I had was why the
> standard clean mechanism that is usually triggered in do_configure()
> isn't working, and indeed I am seeing this in the recipe:
> 
> do_configure() {
>          oe_runmake firmware="bios" clean
> }
> ...
> 
> do_configure:class-target() {
>          # No need to do anything as we're mostly shipping the
> precompiled binaries
>          :
> }
> 
> Should this second function be removed instead, so that the standard
> one takes over and does the cleaning?

I wonder, if it is cleaning the pre-compiled stuff too, it seems
the intent is to use pre-compiled binaries for target. So checking
if those are kept intact after clean might be prudent.

> 
> Alex
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#224063): https://lists.openembedded.org/g/openembedded-core/message/224063
> Mute This Topic: https://lists.openembedded.org/mt/115444935/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
index 449a75ebf8ab..ea4bf6e6a88b 100644
--- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
+++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
@@ -107,6 +107,7 @@  do_compile:class-target() {
 }
 
 do_install:class-target() {
+	oe_runmake firmware="bios" clean
 	oe_runmake firmware="bios" install INSTALLROOT="${D}"
 
 	install -d ${D}${datadir}/syslinux/