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

Missing ARMv7 architecture in file libclang_rt.cc_kext.a #41

Open
johnothwolo opened this issue Dec 30, 2017 · 10 comments
Open

Missing ARMv7 architecture in file libclang_rt.cc_kext.a #41

johnothwolo opened this issue Dec 30, 2017 · 10 comments

Comments

@johnothwolo
Copy link

johnothwolo commented Dec 30, 2017

I'm having this compiling error:

LD mach_kernel.sys
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.cc_kext.a, missing required architecture armv7 in file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.cc_kext.a (3 slices)
ld: no supported runtime hi16 relocation in ___cxx_global_var_init from /Users/mac/xnu/xnu-arm/BUILD/obj//DEBUG_ARM_OMAP3530/libkern/DEBUG/OSDebug.cpo to ___stack_chk_guard for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/mac/xnu/xnu-arm/BUILD/obj/DEBUG_ARM_OMAP3530/./mach_kernel] Error 1
make[1]: *** [build_all] Error 2
make: *** [all] Error 2
@mithrandir2008-zz
Copy link

Any updates on this?

@johnothwolo
Copy link
Author

Nope, there was no response from anyone!

@mithrandir2008-zz
Copy link

TBH, I hit this error in a completely different context. I have a feeling it's LLVM specific, just stirring the pot in hope for some clues...

@johnothwolo
Copy link
Author

What exactly did you do?

@mithrandir2008-zz
Copy link

Ok, so the context is probably completely unrelated.

I have a piece of ARM code I'm compiling for a Cortex-M4 which calls into a specific function. This function references the pointer to a specific section(call it __test sitting in the RAM) by pointing to the label directly. Note that the labels exist in a .s assembler file(but I don't think this is relevant).

During link-time, it throws the hi16 relocation error, pointing to the __test line. Ultimately, I got around the issue by #defining the address instead of a direct pointer to the section. I got past the error but I'm not sure it actually 'works' yet. Still in the middle of functional testing.

Not sure if that made any sense to you, so apologies in advance...

@adalric
Copy link

adalric commented Jul 20, 2018

You guys are trying to use macOS libclang_rt.cc_kext.a, in my .travis.yml, line 38 and 39 shows you a quick workaround. Please tell me if it works.

@johnothwolo
Copy link
Author

It doesn't work, I still get:

ld: no supported runtime hi16 relocation in ___cxx_global_var_init from /Users/Mac/xnu/xnu-arm/BUILD/obj//DEBUG_ARM_ARMPBA8/libkern/DEBUG/./OSDebug.cpo to ___stack_chk_guard for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@mithrandir2008-zz
Copy link

Hi John,

Can you try appending a "-mlong-calls" to your linker call? I found that it does fix some issues(although I haven't tested it for this one).

@johnothwolo
Copy link
Author

I tried commenting out -fstack-protector-all but got:

ld: no supported runtime hi16 relocation in _trace_backtrace from /Users/mac/xnu/xnu-arm/BUILD/obj//DEBUG_ARM_OMAP3530/libkern/DEBUG/./OSDebug.cpo to ___stack_chk_guard for architecture armv7

@joanne6601
Copy link

llvm is compromising my computer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants