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

[objcopy] unknown argument '--prefix-alloc-sections=.init' #435

Closed
nickdesaulniers opened this issue Mar 27, 2019 · 7 comments
Closed

[objcopy] unknown argument '--prefix-alloc-sections=.init' #435

nickdesaulniers opened this issue Mar 27, 2019 · 7 comments
Labels
[ARCH] arm64 This bug impacts ARCH=arm64 [BUG] llvm A bug that should be fixed in upstream LLVM [FIXED][LLVM] 9 This bug was fixed in LLVM 9.0 [TOOL] llvm-objcopy The issue is relevant to LLVM objcopy

Comments

@nickdesaulniers
Copy link
Member

set in drivers/firmware/efi/libstub/Makefile:

75:STUBCOPY_FLAGS-$(CONFIG_ARM64)	+= --prefix-alloc-sections=.init \

via: https://travis-ci.com/ClangBuiltLinux/continuous-integration/jobs/188279167

llvm-objcopy-9: error: unknown argument '--prefix-alloc-sections=.init'
make[5]: *** [drivers/firmware/efi/libstub/Makefile:80: drivers/firmware/efi/libstub/arm-stub.stub.o] Error 1

cc @rupprecht @ardbiesheuvel @smithp35

@nickdesaulniers nickdesaulniers added [BUG] llvm A bug that should be fixed in upstream LLVM [ARCH] arm64 This bug impacts ARCH=arm64 [TOOL] llvm-strip The issue is relevant to LLVM strip low priority This bug is not critical and not a priority labels Mar 27, 2019
@rupprecht
Copy link

rupprecht commented Mar 27, 2019

Filed as an upstream bug for you: https://llvm.org/pr41266. I haven't looked but it's probably straightforward to add.

btw, elsewhere in that file is a silent failure (it may fail in a later build step):

STUBCOPY_RM-y			:= -R *ksymtab* -R *kcrctab*
...
cmd_stubcopy = if $(STRIP) --strip-debug $(STUBCOPY_RM-y) -o $@ $<; \

By default, llvm-objcopy/strip doesn't support globs, and only supports removing by regex (and then only with the --regex flag). So either you'll have to change that to:

STUBCOPY_RM-y := --regex -R .*ksymtab.* -R .*kcrctab.*

or someone will have to support globs in llvm-objcopy.

A second issue is that efi targets are not supported, see https://llvm.org/pr40618. I'm not sure if this affects you -- there doesn't seem to be an explicit efi-* target listed anywhere, but EFI is listed elsewhere in that file. Just something to take note of.

@rupprecht
Copy link

rupprecht commented Mar 28, 2019

Filed https://llvm.org/pr41268 so that you'll know that -R *ksymtab* doesn't actually work.

@ardbiesheuvel
Copy link

I wonder if we still need to strip ksymtab and kcrctab sections now that I have added -D__DISABLE_EXPORTS

@nickdesaulniers
Copy link
Member Author

Note to self: @ardbiesheuvel sent a patch to remove ksymtab/kcrctab stripping: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=next&id=a72f65180feb446cc59616aab400475679b6ffce

I still think it would be good to fail hard in the presence of wildcard characters until it (or something else) is implemented, but the functionality itself is now less important than --prefix-alloc-sections=.

@nickdesaulniers
Copy link
Member Author

patch: https://reviews.llvm.org/D60042

@nickdesaulniers nickdesaulniers added [PATCH] Submitted A patch has been submitted for review [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Apr 5, 2019
@nickdesaulniers nickdesaulniers added [TOOL] llvm-objcopy The issue is relevant to LLVM objcopy and removed [TOOL] llvm-strip The issue is relevant to LLVM strip labels Apr 16, 2019
@nickdesaulniers
Copy link
Member Author

landed: https://reviews.llvm.org/rL360233

@nickdesaulniers nickdesaulniers added [FIXED][LLVM] 9 This bug was fixed in LLVM 9.0 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels May 8, 2019
@nickdesaulniers
Copy link
Member Author

looks resolved locally for arm64 defconfig. 😺 😈

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] llvm A bug that should be fixed in upstream LLVM [FIXED][LLVM] 9 This bug was fixed in LLVM 9.0 [TOOL] llvm-objcopy The issue is relevant to LLVM objcopy
Projects
None yet
Development

No branches or pull requests

4 participants