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

Stable: Compatibility fixes for LLVM 3.5 #25739

Closed
wants to merge 2 commits into from

Conversation

davidvoit
Copy link
Contributor

Based on the pull request from Luca Bruno (#21588)

I'm trying to get the 1.0.0 release running on a Fedora system using the system supplied llvm.
It's still not running, but i getting somewhere.

Is this patch correct? This was my first practical contact with Rust code, and "hey, it's the rust compiler itself" :-)

Now i'm having a dynamical system llvm linked stage1 rustc, which can compile small rust programms. Next stages still don't work - not the referenced ICE, i get here illegal instructions, but only if i activate optimizations in rustc - need to investigate this.

lucab and others added 2 commits May 23, 2015 23:21
This commit introduce a third parameter for compatible_ifn!, as new
intrinsics are being added in recent LLVM releases and there is no
need to hardcode a specific case.

Signed-off-by: Luca Bruno <lucab@debian.org>
Based on the patch from Luca Bruno.

Instead of creating an empty C function in the rt, this version creates an shim
noop function using llvm. This function is declared as internal, and the
unsupported assume intrinsic and the shim gets completly removed by the
optimizer.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@alexcrichton
Copy link
Member

This looks pretty good to me, thanks! I'm somewhat hesitant about landing before you have a local build completed first, though, as it may indicate that something else is awry internally.

@davidvoit
Copy link
Contributor Author

Hi Alex,

Thanks for reviewing!

I'm lost for now. Will look in the comming days again. Maybe this Problem is known to you?

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f855dfff700 (LWP 27801)]
llvm::APFloat::initFromPPCDoubleDoubleAPInt (this=0x7f855dff6db0, api=...) at APFloat.cpp:3155
3155 uint64_t i1 = api.getRawData()[0];

Backtrace:
#0 llvm::APFloat::initFromPPCDoubleDoubleAPInt (this=0x7f855dff6db0, api=...) at APFloat.cpp:3155
#1 0x00007f85603819a7 in llvm::Constant::getNullValue (Ty=0x7f855ada7f90) at Constants.cpp:155
#2 0x00007f8560381f08 in llvm::Constant::getAggregateElement (this=this@entry=0x7f8558007020, Elt=Elt@entry=0) at Constants.cpp:216
#3 0x00007f8560d435c2 in ConstantFoldLoadThroughBitcast (DL=0x7f855ada7f90, CE=0x7f8559024a68) at ConstantFolding.cpp:515
#4 llvm::ConstantFoldLoadFromConstPtr (C=0x7f8559024a68, TD=TD@entry=0x7f855ada7f90) at ConstantFolding.cpp:547
#5 0x00007f8560d47db3 in ConstantFoldLoadInst (TD=0x7f855ada7f90, LI=0x7f8558cb03c8) at ConstantFolding.cpp:608
#6 llvm::ConstantFoldInstruction (I=I@entry=0x7f8558cb03c8, TD=TD@entry=0x7f855ada7f90, TLI=TLI@entry=0x7f85593a40c0) at ConstantFolding.cpp:949
#7 0x00007f8560d7655e in llvm::SimplifyInstruction (I=I@entry=0x7f8558cb03c8, DL=0x7f855ada7f90, TLI=0x7f85593a40c0, DT=)
at InstructionSimplify.cpp:3080
#8 0x00007f8560ac274c in (anonymous namespace)::EarlyCSE::processNode (this=this@entry=0x7f8558005650, Node=) at EarlyCSE.cpp:436
#9 0x00007f8560ac45ef in (anonymous namespace)::EarlyCSE::runOnFunction (this=0x7f8558005650, F=...) at EarlyCSE.cpp:599
#10 0x00007f856043e192 in llvm::FPPassManager::runOnFunction (this=0x7f8559a78f80, F=...) at LegacyPassManager.cpp:1545
#11 0x00007f856043ffa6 in llvm::legacy::FunctionPassManagerImpl::run (this=0x7f85581d8a50, F=...) at LegacyPassManager.cpp:1494
#12 0x00007f8560440094 in llvm::legacy::FunctionPassManager::run (this=this@entry=0x7f853b0da940, F=...) at LegacyPassManager.cpp:1412
#13 0x00007f8562d44520 in LLVMRustRunFunctionPassManager (PM=0x7f853b0da940, M=0x7f8558004ac0)
at /home/david/Programmieren/rust/rust/src/rustllvm/PassWrapper.cpp:175
#14 0x00007f856538f24d in back::write::execute_work_item::h3fed8cc1a8892c9232c ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_trans-4e7c5e5c.so
#15 0x00007f856538b1e6 in back::write::run_passes::h645a449c54a673bfNIc ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_trans-4e7c5e5c.so
#16 0x00007f856617be3a in driver::phase_5_run_llvm_passes::ha13f2e03706be9553Oa ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#17 0x00007f856615a814 in driver::compile_input::hf457c126b1a9fea7Qba ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#18 0x00007f85661f5a01 in run_compiler::haef3f67512da3269R4b ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#19 0x00007f85661f3a60 in boxed::F.FnBox$LT$A$GT$::call_box::h2713571525532118033 ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#20 0x00007f85661f326a in rt::unwind::try::try_fn::h15939112619814191331 ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#21 0x00007f8565cb2f89 in rust_try_inner () from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-4e7c5e5c.so
#22 0x00007f8565cb2f76 in rust_try () from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-4e7c5e5c.so
#23 0x00007f85661f34e9 in boxed::F.FnBox$LT$A$GT$::call_box::h15940292313648018812 ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-4e7c5e5c.so
#24 0x00007f8565c3759d in sys::thread::create::thread_start::h79b30af0bd177409Uxv ()
from /home/david/Programmieren/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-4e7c5e5c.so
#25 0x00007f856243752a in start_thread (arg=0x7f855dfff700) at pthread_create.c:310
#26 0x00007f856589622d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

@alexcrichton
Copy link
Member

Oh dear, that does look quite intimidating! Perhaps the ABI changed between LLVM versions and the signature listed in rustc_llvm/lib.rs is wrong somewhere?

@dotdash
Copy link
Contributor

dotdash commented May 27, 2015

@davidvoit which LLVM version is that exactly? This looks like a bug that @eddyb hit, and the fix for that is only in 3.5.2.

@davidvoit
Copy link
Contributor Author

@dotdash Thanks for the pointer!
Using llvm 3.5.2 and these two patches, all stages builded!

Next step is to make sure that all checks are working. I don't have the fastest machine here, and this takes ages. Will report after i have more infos.

@dotdash dotdash mentioned this pull request May 30, 2015
@sanxiyn
Copy link
Member

sanxiyn commented May 31, 2015

This needs rebase because LLVMVersionMinor does not exist any more since #24635.

@alexcrichton alexcrichton added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 2, 2015
@tamird tamird mentioned this pull request Jun 8, 2015
bors added a commit that referenced this pull request Jun 8, 2015
@bors bors closed this in #26088 Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants