-
Notifications
You must be signed in to change notification settings - Fork 29
[DoNotMergeYet] fix cross compiling to ARM when using cmake #17
Conversation
and vice versa don't test the hard ABI on arm*-*-*-eabi targets. These tests wouldn't pass anyway and this avoids a build error on *eabihf targets.
the arm set is for targets that use the soft float (no FPU) ABI and the armhf set is for targets that use the hard float ABI. These *vfp intrinsics use FPU instructions so they can't be compiled for soft float targets.
Ok, so after cross compiling rustc for the three ARM targets mentioned above, this is the result:
Which looks like something I've seen before but I don't think I ever figured out why it happens.
Backtrace:
I don't know where this assertion came from, this was working fine last week! Could the cause be:
I checked if the unofficial rustc binaries have the same problem and they don't', but their latest release is 18 days old so they may not contain the change that could be causing the problem I'm seeing here. |
Okay, about the second problem: testing the cross compiled rustc on ARM. I just remember that rustc on ARM doesn't work when it's built with LLVM assertions enabled because it always hits that LLVM assertion about the attributes. That's the reason why, when I was running the ruststrap service, I disabled LLVM assertions on my builds. After the LLVM assertions were disabled rustc was able to build working binaries AFAICT. Now, rustc on ARM should work even when LLVM assertions are enabled but that's a regression that I never managed to bisect because building ARM compilers took such a long time. I'm going to confirm that the LLVM assertions are the cause of the problem I'm seeing here and report back. |
Thanks @japaric! This is getting significant enough that perhaps we can try to upstream some of these changes? Our fork seems to be diverging a little too much from upstream :( |
Disabling the LLVM assertions "fixed" the rustc for I can't test the rustc for As for
Does that mean that we have to wait until these changes land upstream? I was hoping to get official rustc binaries for ARM by the end of this week. |
bah oh well, if this fixes problems locally it's all pretty easy to rebase so we can deal with if we ever need to. That and once we're gating on this it'll naturally fall out of any upgrade as well :) Regardless, I shall merge! Do you wanna send a PR to rust-lang/rust to update the submodules? |
[DoNotMergeYet] fix cross compiling to ARM when using cmake
Done in rust-lang/rust#32280 |
update compiler-rt submodule fixes #32194 also see rust-lang/compiler-rt#17 r? @alexcrichton
@parched Before that commit we were using Makefiles to build compiler-rt for ARM and those Makefiles didn't compile the
That operation lowers to |
It shouldn't, provided a double precision fpu is specified. However, from my testing it doesn't use |
Oh, I misread. I thought you meant "soft float". None of the
Reading the LLVM source, it appears these |
Reading that source it's only for thumb, indeed testing I find |
Actually I think this can affect current rust, with |
Enable more ignores when we start crashing. Unwind in CHECK SIGSEGVs if happens early: FATAL: ThreadSanitizer CHECK failed: ../projects/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc:105 "((beg)) <= ((end))" (0x8000000000, 0x4000000000) Program received signal SIGSEGV, Segmentation fault. __tsan::MetaMap::GetAndLock (this=0x1337c88 <__tsan::ctx_placeholder+8>, thr=thr@entry=0x7ffff7f91800, pc=pc@entry=4639488, addr=addr@entry=140737339086992, write_lock=write_lock@entry=true, create=create@entry=true) at ../projects/compiler-rt/lib/tsan/rtl/tsan_sync.cc:208 208 u32 idx0 = *meta; (gdb) bt #0 __tsan::MetaMap::GetAndLock (this=0x1337c88 <__tsan::ctx_placeholder+8>, thr=thr@entry=0x7ffff7f91800, pc=pc@entry=4639488, addr=addr@entry=140737339086992, write_lock=write_lock@entry=true, create=create@entry=true) at ../projects/compiler-rt/lib/tsan/rtl/tsan_sync.cc:208 #1 0x00000000004a965f in __tsan::MetaMap::GetOrCreateAndLock (this=<optimized out>, thr=thr@entry=0x7ffff7f91800, pc=pc@entry=4639488, addr=addr@entry=140737339086992, write_lock=write_lock@entry=true) at ../projects/compiler-rt/lib/tsan/rtl/tsan_sync.cc:198 #2 0x00000000004a162a in __tsan::Release (thr=0x7ffff7f91800, pc=pc@entry=4639488, addr=addr@entry=140737339086992) at ../projects/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc:395 #3 0x000000000046cc40 in __interceptor_pthread_once (o=0x7ffff71a5890 <once_regsizes>, f=0x7ffff6f9d9c0 <init_dwarf_reg_size_table>) at ../projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1334 #4 0x00007ffff6f9fe86 in __gthread_once (__func=0x7ffff6f9d9c0 <init_dwarf_reg_size_table>, __once=0x7ffff71a5890 <once_regsizes>) at ./gthr-default.h:699 #5 uw_init_context_1 (context=context@entry=0x7fffffffd6d0, outer_cfa=outer_cfa@entry=0x7fffffffd980, outer_ra=0x437d13 <__sanitizer::BufferedStackTrace::SlowUnwindStack(unsigned long, unsigned int)+67>) at ../../../src/libgcc/unwind-dw2.c:1572 #6 0x00007ffff6fa06a8 in _Unwind_Backtrace (trace=0x437c30 <__sanitizer::Unwind_Trace(_Unwind_Context*, void*)>, trace_argument=0x7fffffffd980) at ../../../src/libgcc/unwind.inc:283 #7 0x0000000000437d13 in __sanitizer::BufferedStackTrace::SlowUnwindStack (this=0x7ffff6103208, pc=pc@entry=4863574, max_depth=max_depth@entry=256) at ../projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:125 #8 0x0000000000434f4a in __sanitizer::BufferedStackTrace::Unwind (this=this@entry=0x7ffff6103208, max_depth=max_depth@entry=256, pc=pc@entry=4863574, bp=bp@entry=0, context=context@entry=0x0, stack_top=stack_top@entry=0, stack_bottom=stack_bottom@entry=0, request_fast_unwind=request_fast_unwind@entry=false) at ../projects/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc:76 #9 0x00000000004a36b3 in PrintCurrentStackSlow (pc=4863574) at ../projects/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc:696 #10 __tsan::TsanCheckFailed (file=<optimized out>, line=<optimized out>, cond=<optimized out>, v1=<optimized out>, v2=<optimized out>) at ../projects/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc:44 #11 0x000000000042dfd6 in __sanitizer::CheckFailed (file=file@entry=0x4b9fd0 "../projects/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc", line=line@entry=105, cond=cond@entry=0x4ba049 "((beg)) <= ((end))", v1=v1@entry=549755813888, v2=v2@entry=274877906944) at ../projects/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc:79 #12 0x00000000004aa36c in ProtectRange (end=274877906944, beg=549755813888) at ../projects/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc:105 #13 __tsan::CheckAndProtect () at ../projects/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc:133 #14 0x00000000004a9e95 in __tsan::InitializePlatform () at ../projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc:280 #15 0x0000000000497e73 in __tsan::Initialize (thr=0x7ffff7f91800) at ../projects/compiler-rt/lib/tsan/rtl/tsan_rtl.cc:343 #16 0x00007ffff7dea25a in _dl_init (main_map=0x7ffff7ffe1c8, argc=1, argv=0x7fffffffdb88, env=0x7fffffffdb98) at dl-init.c:111 #17 0x00007ffff7ddb30a in _dl_start_user () at rtld.c:871 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281969 91177308-0d34-0410-b5e6-96231b3b80d8
The first commit fixes point (c) of rust-lang/rust#32194, and the second commit fixes point (b). See commit messages for details.
The first commit should let us use rustbuild to cross compile rustc for
arm(v7)-unknown-linux-gnueabihf
and the second commit should let us cross compile forarm-unknown-linux-gnueabi
.I'm still testing rustc cross compilation in the linux-cross docker image, so don't merge it just yet!
r? @alexcrichton
P.S. I wasn't sure to which branch send this PR, so feel free to cherry pick these commits to other branch if I got the wrong one.