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

Update to Rust 1.39.0 #155

Closed

Conversation

dylanmckay
Copy link
Member

No description provided.

@dylanmckay dylanmckay force-pushed the avr-support-1.39.0-4560ea788c branch 3 times, most recently from 365524b to c848ae0 Compare November 27, 2019 06:27
shepmaster and others added 9 commits November 27, 2019 21:05
This commit fixes debug printing of function pointers on AVR. AVR does
not support `addrspacecast` instructions, and so this patch modifies
libcore so that a `ptrtoint` IR instruction is used and the address
space cast is avoided.
Add extra steps for macOS, as noted in #131
Evidently there's some difference, see #144 (comment)
@dylanmckay
Copy link
Member Author

Can compile blink as is with just a rebase, except I did have to cherry-pick https://reviews.llvm.org/D68524 to fix #92.

@dylanmckay
Copy link
Member Author

It compiled all of libcore - in all 146,564 lines of unoptimized avr asm glory:

core.avr.s.txt

…onvention"

This fixes #92.

At the time of cherry-picking, this patch has not yet been upstreamed.
@shepmaster
Copy link
Member

I say to push it!

@Rahix
Copy link

Rahix commented Jan 11, 2020

Hey @dylanmckay, @shepmaster, thanks for all your work on this! What is still missing for this version to be fully released?

@shepmaster
Copy link
Member

@Rahix can you pull this branch, compile it, and see if it still compiles your local test programs? That would probably prove useful.

@dylanmckay
Copy link
Member Author

I agree - if this branch still works (why shouldn't it), let's update the HEADs.

Also need to submit PRs upstream for avr-rust things. Start unforking this thing.

@Rahix
Copy link

Rahix commented Jan 16, 2020

Might just have been too late at night and me doing something stupid, but I can't seem to compile libcore with this branch. Running

$ xargo build --target avr-atmega32u4

, I get a segfault :/ Stacktrace:

#0  0x00007f4fde5b1cc7 in (anonymous namespace)::RAGreedy::addSplitConstraints(llvm::InterferenceCache::Cursor, llvm::BlockFrequency&) [clone .isra.0] () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007f4fde5ba5a5 in (anonymous namespace)::RAGreedy::selectOrSplitImpl(llvm::LiveInterval&, llvm::SmallVectorImpl<unsigned int>&, llvm::SmallSet<unsigned int, 16u, std::less<unsigned int> >&, unsigned int) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007f4fde5bbf68 in (anonymous namespace)::RAGreedy::selectOrSplit(llvm::LiveInterval&, llvm::SmallVectorImpl<unsigned int>&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007f4fde5a1c80 in llvm::RegAllocBase::allocatePhysRegs() () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007f4fde5b4001 in (anonymous namespace)::RAGreedy::runOnMachineFunction(llvm::MachineFunction&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007f4fde4af7d3 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00007f4fdf0bc778 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00007f4fdf0bc801 in llvm::FPPassManager::runOnModule(llvm::Module&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#8  0x00007f4fdf0bbac8 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00007f4fdd7a92a6 in LLVMRustWriteOutputFile () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#10 0x00007f4fdd74729c in rustc_codegen_llvm::back::write::write_output_file () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#11 0x00007f4fdd66e180 in rustc_codegen_llvm::back::write::codegen::{{closure}} () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#12 0x00007f4fdd663731 in rustc::util::common::time_ext () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#13 0x00007f4fdd75879b in <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::write::WriteBackendMethods>::codegen () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#14 0x00007f4fdd637058 in rustc_codegen_ssa::back::write::execute_work_item () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#15 0x00007f4fdd6fda56 in std::sys_common::backtrace::__rust_begin_short_backtrace () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#16 0x00007f4fdd65d754 in std::panicking::try::do_call () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#17 0x00007f4fe72a000a in __rust_maybe_catch_panic () from /build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-34dd0cab9bff80f1.so
#18 0x00007f4fdd65def3 in core::ops::function::FnOnce::call_once{{vtable-shim}} () from /build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#19 0x00007f4fe7299a5f in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once () from /build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-34dd0cab9bff80f1.so
#20 0x00007f4fe726c2d0 in std::sys_common::thread::start_thread () from /build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-34dd0cab9bff80f1.so
#21 0x00007f4fe729cdb6 in std::sys::unix::thread::Thread::new::thread_start () from /build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-34dd0cab9bff80f1.so
#22 0x00007f4fe6f4f4cf in start_thread () from /usr/lib/libpthread.so.0
#23 0x00007f4fe70f52d3 in clone () from /usr/lib/libc.so.6

Anything else I should provide to help?

@Rahix
Copy link

Rahix commented Feb 17, 2020

Adding RUSTFLAGS='-C opt-level=s' seems to make libcore build. From a bit more testing, opt-level={2,3} seems to lead to a SIGSEGV ...

@dylanmckay dylanmckay closed this Feb 2, 2021
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

Successfully merging this pull request may close these issues.

3 participants