Skip to content

Conversation

patrick-rivos
Copy link
Contributor

@patrick-rivos patrick-rivos commented Apr 8, 2024

Targets with no -fstack-split support now emit ld.lld: error: target doesn't support split stacks instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061

@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2024

@llvm/pr-subscribers-lld-elf

Author: Patrick O'Neill (patrick-rivos)

Changes

Targets with no -fstack-split support now emit ld.lld: error: Target doesn't support split stacks. instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061


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

1 Files Affected:

  • (modified) lld/ELF/Target.cpp (+1-1)
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index d879a427e9c096..735b2a82d851b4 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -141,7 +141,7 @@ bool TargetInfo::needsThunk(RelExpr expr, RelType type, const InputFile *file,
 
 bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
                                                   uint8_t stOther) const {
-  llvm_unreachable("Target doesn't support split stacks.");
+  fatal("Target doesn't support split stacks.");
 }
 
 bool TargetInfo::inBranchRange(RelType type, uint64_t src, uint64_t dst) const {

@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2024

@llvm/pr-subscribers-lld

Author: Patrick O'Neill (patrick-rivos)

Changes

Targets with no -fstack-split support now emit ld.lld: error: Target doesn't support split stacks. instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061


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

1 Files Affected:

  • (modified) lld/ELF/Target.cpp (+1-1)
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index d879a427e9c096..735b2a82d851b4 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -141,7 +141,7 @@ bool TargetInfo::needsThunk(RelExpr expr, RelType type, const InputFile *file,
 
 bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
                                                   uint8_t stOther) const {
-  llvm_unreachable("Target doesn't support split stacks.");
+  fatal("Target doesn't support split stacks.");
 }
 
 bool TargetInfo::inBranchRange(RelType type, uint64_t src, uint64_t dst) const {

Copy link

github-actions bot commented Apr 8, 2024

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

@MaskRay
Copy link
Member

MaskRay commented Apr 8, 2024

Test?

@patrick-rivos
Copy link
Contributor Author

Will do - I'm not familiar with stack splitting/how to write a concise testcase that triggers it so it might take me some time.

Targets with no `-fstack-split` support now emit `ld.lld: error: Target doesn't support split stacks.` instead of `UNREACHABLE executed` with a backtrace asking the user to report a bug.

Resolves llvm#88061
@patrick-rivos patrick-rivos force-pushed the lld-split-stack-error branch from 45e78c7 to 9bc9fb0 Compare April 9, 2024 01:51
@patrick-rivos
Copy link
Contributor Author

Added testcase and force-pushed to get rid of the github email address from the commit.

@patrick-rivos
Copy link
Contributor Author

Ping.

@patrick-rivos
Copy link
Contributor Author

Thanks for the review!
I don't have write permission. Could you land these changes for me?

@MaskRay MaskRay merged commit 96aac67 into llvm:main May 4, 2024
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.

[LLD] Unreachable executed with -fsplit-stack
3 participants