Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 21754 [details]
Unzip attached test case.
+ CLANG='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch arm64 -miphoneos-version-min=10.0'
+ /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/LLVM/bin/llc -O0 -data-sections -asm-verbose=false -mtriple=arm64-ios -enable-pie -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_testApp_eh_frame -relocation-model=static -filetype=obj -o testApp.exe-llvm.o testApp.exe.s.opt.bc
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch arm64 -miphoneos-version-min=10.0 -c -x objective-c++ -o main.o main.m
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch arm64 -miphoneos-version-min=10.0 main.o testApp.exe-llvm.o -o testApp
0 0x109f5753b __assert_rtn + 129
1 0x109fc249c ld::tool::makeLDR_literal(ld::tool::LoadStoreInfo const&, unsigned long long, unsigned long long) + 402
2 0x109fbf4d7 ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 6245
3 0x109fc2a1c ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 330
4 0x109fbafa2 ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 858
5 0x109fb46bc ld::tool::OutputFile::write(ld::Internal&) + 178
6 0x109f583fc main + 1096
A linker snapshot was created at:
ld: Assertion failed: ((instructionAddress & 0x3) == 0), function makeLDR_literal, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-278.4/src/ld/OutputFile.cpp, line 835.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that llc has a problem when compiling a .o from a .bc. If I compile the .bc to .s, and then use clang to compile the .s to .o, then the native linker does not complain (this is explained in the test.sh script as well, with sample commands).
It's possible to work around this by passing -Wl,-ignore_optimization_hints to clang.
Bump llvm to 975e3a6903003d7dba1b01f8a3c4a42a55049842, that should fix it.
@Rolf, could you check if bumping llvm fixes it?
PR master https://github.com/xamarin/xamarin-macios/pull/2059
@Ludovic, I can confirm the llvm fix fixes the problem.
The fix is only in master so moving milestone to 15.3
Since we have a workaround (and it's late to bump llvm) I do not think we need to backport it to 15.2.
I have run the provided sample on terminal for the below configuration and no such clang error was observed. looks good to me. Marking this as verified.
Build info: https://gist.github.com/raghorteprasad/d1bd993f287b2b06e49be1263e97a74a