Skip to content
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

clang's missing -ffixed-REG, -fcall-used-REG, -fcall-saved-REG #9829

Closed
pageexec mannequin opened this issue Mar 11, 2011 · 3 comments
Closed

clang's missing -ffixed-REG, -fcall-used-REG, -fcall-saved-REG #9829

pageexec mannequin opened this issue Mar 11, 2011 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@pageexec
Copy link
Mannequin

pageexec mannequin commented Mar 11, 2011

Bugzilla Link 9457
Resolution FIXED
Resolved on Sep 25, 2018 10:04
Version trunk
OS Linux
Blocks #4440
CC @asl,@emaste,@jyknight,@nickdesaulniers,@pageexec,@stephenhines

Extended Description

in particular, -fcall-saved-REG is used by linux on x86 (i.e., both i386 and amd64) for an optimized ABI for a few specific functions. since clang ignores this switch (for completeness, i added the other two related switches too) the generated machine code is not correct and results in runtime failure. the workaround on the linux side is to disable CONFIG_ARCH_HWEIGHT_CFLAGS for now.

@jyknight
Copy link
Member

Not used anymore on x86 or x86-64 now, only arm64.

I'd recommend not implementing this in clang and having the kernel use one of the alternate calling conventions for these functions instead (e.g. "coldcc" or "preserve_allcc"), if desired.

@nickdesaulniers
Copy link
Member

aarch64:
-ffixed-* for LLVM: https://reviews.llvm.org/rL341706
-ffixed-* for Clang: https://reviews.llvm.org/rL342100

@nickdesaulniers
Copy link
Member

aarch64:
-fcall-saved: https://reviews.llvm.org/rL342824
-fcall-saved: https://reviews.llvm.org/rL342990

For aarch64, the arm64 kernel maintainers have agreed to drop the use of -fcall-used: http://lists.infradead.org/pipermail/linux-arm-kernel/2018-September/602609.html

The Clang/LLVM flags I've linked in this bug will ship in Clang-8. The above kernel patch will land in Linux-4.20.

Since these flags are no longer used for other archs, and only in the kernel, I'm closing this bug. Please open a new one if you'd like support for other archs or -fcall-used.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants