Skip to content

[Driver] Allow -fbasic-block-address-map for AArch64 ELF #82662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

dhoekwater
Copy link
Contributor

Emitting the basic block address map with
-fbasic-block-sections=labels is allowed for AArch64 ELF since
7eaf94f. Allow doing so with
-fbasic-block-address-map.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Feb 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2024

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Daniel Hoekwater (dhoekwater)

Changes

Emitting the basic block address map with
-fbasic-block-sections=labels is allowed for AArch64 ELF since
7eaf94f. Allow doing so with
-fbasic-block-address-map.


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

1 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Clang.cpp (+1-1)
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 7c0409f0c3097a..22c9b5e76710db 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5958,7 +5958,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   if (Arg *A = Args.getLastArg(options::OPT_fbasic_block_address_map,
                                options::OPT_fno_basic_block_address_map)) {
-    if (Triple.isX86() && Triple.isOSBinFormatELF()) {
+    if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF()) {
       if (A->getOption().matches(options::OPT_fbasic_block_address_map))
         A->render(Args, CmdArgs);
     } else {

@dhoekwater dhoekwater marked this pull request as draft February 22, 2024 17:46
@dhoekwater dhoekwater force-pushed the basic-block-address-map-on-arm branch from 9efc078 to 42348f1 Compare February 23, 2024 22:00
@dhoekwater dhoekwater requested a review from rlavaee February 23, 2024 22:01
@dhoekwater dhoekwater marked this pull request as ready for review February 23, 2024 22:02
@dhoekwater dhoekwater force-pushed the basic-block-address-map-on-arm branch 4 times, most recently from 07316bf to 6f03717 Compare February 27, 2024 17:22
@dhoekwater
Copy link
Contributor Author

None of the failing checks seem to be due to my change, so I'm going to keep rebasing onto HEAD until something sticks. If there's a better way than force pushing to my fork, I don't know of it.

Emitting the basic block address map with
`-fbasic-block-sections=labels` is allowed for AArch64 ELF since
7eaf94f. Allow doing so with
`-fbasic-block-address-map`.
@dhoekwater dhoekwater force-pushed the basic-block-address-map-on-arm branch from 6f03717 to 11c8f1f Compare February 27, 2024 21:24
@dhoekwater dhoekwater merged commit e9e7aea into llvm:main Feb 28, 2024
@mysterymath
Copy link
Contributor

mysterymath commented Mar 8, 2024

Hi, we've narrowed down a LLDB test failure on Fuchsia's AArch64 builders to this change:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-arm64/b8754880571862677073/overview

There were only three likely culprits in the blamelist (this change, #83201, #83214, and), but reverting each only produces a successful run if this change is reverted. Can you think of why this change would break that test?

@mysterymath
Copy link
Contributor

I'm terribly sorry, this was the wrong change from the blamelist. NAR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants