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

arm64 ld.lld: warning: stack frame size (2256) exceeds limit (2048) in function 'wlc_phy_txpwr_srom_read_ppr_nphy' #1554

Open
emojifreak opened this issue Dec 23, 2021 · 7 comments
Labels
[ARCH] arm64 This bug impacts ARCH=arm64 [BUG] Untriaged Something isn't working [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization

Comments

@emojifreak
Copy link

All built-in configuration similar to #1550 gives a build warning at the final stage

  LTO     vmlinux.o
ld.lld: warning: stack frame size (2256) exceeds limit (2048) in function 'wlc_phy_txpwr_srom_read_ppr_nphy'

This probably causes build failure with CONFIG_WERROR=y. .config and a reproducing script are attached. It is unclear to me why it is not caught by clang.
config.txt.gz
clang-build-arch30.sh.gz

@nickdesaulniers nickdesaulniers added [ARCH] arm64 This bug impacts ARCH=arm64 [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization [BUG] Untriaged Something isn't working labels Dec 23, 2021
@nickdesaulniers
Copy link
Member

If you run this on the vmlinux, it might be able to help us spot if there's a large stack allocation, or lots of little ones.

@emojifreak
Copy link
Author

Thank you. I will try to provide further info. by https://github.com/ClangBuiltLinux/frame-larger-than

@emojifreak
Copy link
Author

@nickdesaulniers It didn't work as

ryutaroh@bookworm-amd64:/var/tmp/tmp30/arm64/linux-5.16-rc6$ python3 /var/tmp/frame_larger_than.py drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.\
o wlc_phy_txpwr_srom_read_ppr_nphy
failed to parse elf: Magic number does not match
ryutaroh@bookworm-amd64:/var/tmp/tmp30/arm64/linux-5.16-rc6$ file drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.o 
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.o: LLVM IR bitcode

@nickdesaulniers
Copy link
Member

@emojifreak right, you're running the script on a .o file which actually is LLVM bitcode (should be a .bc file). Since it's not an ELF object, an ELF parser will fail to find the ELF magic number at the expected location of an ELF object header. That's why I suggested running it on vmlinux, which will take longer, but is a fully linked ELF object.

@emojifreak
Copy link
Author

Thanks. The configuration causes this warning fails before making vmlinux and I don't have vmlinux, so I will seek a configuration building vmlinux with this warning... I will report it when I get a useful additional info.

@nickdesaulniers
Copy link
Member

Does ./scripts/config -d WERROR allow you to complete the build?

@emojifreak
Copy link
Author

No, so far. Because I can observe this symptom only with #1550. I need to reproduce this without seeing #1550 so that I can have vmlinux...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] arm64 This bug impacts ARCH=arm64 [BUG] Untriaged Something isn't working [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization
Projects
None yet
Development

No branches or pull requests

2 participants