public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: mark.yang@lge.com
To: openembedded-core@lists.openembedded.org
Cc: "mark.yang" <mark.yang@lge.com>
Subject: [PATCH] package.py: warn if target is not a valid ELF file in dwarfsrcfiles
Date: Fri, 26 Dec 2025 16:35:45 +0900	[thread overview]
Message-ID: <20251226073545.11152-1-mark.yang@lge.com> (raw)

From: "mark.yang" <mark.yang@lge.com>

When using the Clang toolchain with LTO, intermediate .o files are generated as
LLVM bitcode files instead of ELF files. While .so libraries are ultimately
ELF, .a files are not. In this case, dwarfsrcfiles always fails.

Adding the -ffat-lto-objects option allows the Clang toolchain to produce .o
files that are recognized as ELF, but this is not always a suitable solution
as it causes issues when used in conjunction with -fsanitize=cfi.

Therefore, we need to handle cases where dwarfsrcfiles encounters a file that
is not a valid ELF. Change the behavior from a fatal error to a warning to
notify the user.

Signed-off-by: mark.yang <mark.yang@lge.com>
---
 meta/lib/oe/package.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index baaa0cba02..56b9bcd546 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -782,8 +782,12 @@ def source_info(file, d, fatal=True):
     if retval != 0 and retval != 255:
         msg = "dwarfsrcfiles failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")
         if fatal:
-            bb.fatal(msg)
-        bb.note(msg)
+            if "not a valid ELF file" in output:
+                bb.warn(msg)
+            else:
+                bb.fatal(msg)
+        else:
+            bb.note(msg)
 
     debugsources = parse_debugsources_from_dwarfsrcfiles_output(output)
 


             reply	other threads:[~2025-12-26  7:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26  7:35 mark.yang [this message]
2025-12-26 18:31 ` [OE-core] [PATCH] package.py: warn if target is not a valid ELF file in dwarfsrcfiles Alexander Kanavin
2025-12-27  8:46   ` mark.yang
2025-12-27 17:34     ` [OE-core] " Alexander Kanavin
2025-12-28  3:21       ` mark.yang

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=20251226073545.11152-1-mark.yang@lge.com \
    --to=mark.yang@lge.com \
    --cc=openembedded-core@lists.openembedded.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