Skip to content

Conversation

@yingcong-wu
Copy link
Contributor

@yingcong-wu yingcong-wu commented Sep 2, 2025

In #154902, the test failed with llvm-clang-win-x-aarch64(it is a cross-build, which builds on Windows and run on Linux, "Win to Aarch64 Linux Ubuntu Cross Toolchain"), and objdump is not available on Windows(the build env).
Set to require x86 Linux instead.

@yingcong-wu yingcong-wu requested a review from a team as a code owner September 2, 2025 01:45
@yingcong-wu yingcong-wu requested review from fmayer and removed request for a team September 2, 2025 01:46
@llvmbot
Copy link
Member

llvmbot commented Sep 2, 2025

@llvm/pr-subscribers-libunwind

Author: Wu Yingcong (yingcong-wu)

Changes

In #154902, the test failed with llvm-clang-win-x-aarch64(it pretends to be a Linux build?), and objdump is not available there.
Change the test to use llvm-objdump instead of objdump, it should be available in this case.


Full diff: https://github.com/llvm/llvm-project/pull/156383.diff

1 Files Affected:

  • (modified) libunwind/test/eh_frame_fde_pc_range.pass.cpp (+2-2)
diff --git a/libunwind/test/eh_frame_fde_pc_range.pass.cpp b/libunwind/test/eh_frame_fde_pc_range.pass.cpp
index d8bcb3939913c..28f4ae1efed31 100644
--- a/libunwind/test/eh_frame_fde_pc_range.pass.cpp
+++ b/libunwind/test/eh_frame_fde_pc_range.pass.cpp
@@ -19,9 +19,9 @@
 // XFAIL: msan
 
 // RUN: %{build}
-// RUN: objcopy --dump-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
+// RUN: llvm-objcopy --dump-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
 // RUN: echo -ne '\xFF' | dd of=%t_ehf_hdr.bin bs=1 seek=2 count=2 conv=notrunc status=none 
-// RUN: objcopy --update-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
+// RUN: llvm-objcopy --update-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
 // RUN: %{exec} %t.exe
 
 // clang-format on

@yingcong-wu yingcong-wu changed the title [libunwind][test] change to use llvm-objdump [libunwind][test] unsupport a test in aarch64 for aarch64 has corss toolchain build Sep 2, 2025
@yingcong-wu
Copy link
Contributor Author

Add arm as armv7 also have the cross-toolchain build(https://lab.llvm.org/buildbot/#/builders/38/builds/5190).

@yingcong-wu yingcong-wu changed the title [libunwind][test] unsupport a test in aarch64 for aarch64 has corss toolchain build [libunwind][test] set fed test to require x86 as others arch may have cross toolchain build Sep 2, 2025
Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming the CI is happy to get that green again. Though I'm not sure we want to keep the test as-is. It seems to have quite a few assumptions about the environment baked in.

@yingcong-wu yingcong-wu merged commit 1af1977 into llvm:main Sep 2, 2025
77 checks passed
@yingcong-wu
Copy link
Contributor Author

I admit that this test is not well-written, but it is also hard to write the test that meet the condition. If we simply does not emit .eh_frame_hdr section, then libunwind simply won't work because it gets the .eh_frame addr from it. And I don't have any clue how to make the linker generate a .eh_frame_hdr that only contains the .eh_frame addr and no search table. I would happily open to any suggestions.

// clang-format off

// REQUIRES: linux
// REQUIRES: target={{x86_64-.+-linux-gnu}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we use llvm-objcopy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good suggestion. I will give it a try later.

yingcong-wu added a commit that referenced this pull request Oct 1, 2025
…#161112)

Previously, we only used `objcopy`, which is not available for some
build configurations. With this patch, we not only try to use `objcopy`,
but also try to use `llvm-objcopy` if available.

This is a follow-up of #156383.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Oct 2, 2025
…mpatibility (#161112)

Previously, we only used `objcopy`, which is not available for some
build configurations. With this patch, we not only try to use `objcopy`,
but also try to use `llvm-objcopy` if available.

This is a follow-up of llvm/llvm-project#156383.
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…llvm#161112)

Previously, we only used `objcopy`, which is not available for some
build configurations. With this patch, we not only try to use `objcopy`,
but also try to use `llvm-objcopy` if available.

This is a follow-up of llvm#156383.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants