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

LDC crashes in LLVM when compiling msgpack-d for Android #3437

Closed
ThomasBrixLarsen opened this issue May 20, 2020 · 3 comments
Closed

LDC crashes in LLVM when compiling msgpack-d for Android #3437

ThomasBrixLarsen opened this issue May 20, 2020 · 3 comments

Comments

@ThomasBrixLarsen
Copy link

Last good LDC is 1.20.

$ dub init .
Package recipe format (sdl/json) [json]: sdl
Name [temp]:
Description [A minimal D application.]:
Author name [tbl]:
License [proprietary]:
Copyright string [Copyright © 2020, tbl]:
Add dependency (leave empty to skip) []: msgpack-d
Adding dependency msgpack-d ~>1.0.2
Add dependency (leave empty to skip) []:
Successfully created an empty project in '/home/tbl/projects/temp'.
Package successfully created in .

$ PATH=ldc2-1.21.0-linux-x86_64/bin:$PATH dub build --arch=armv7a-unknown-linux-androideabi
Performing "debug" build using /home/tbl/projects/temp/ldc2-1.21.0-linux-x86_64/bin/ldc2 for arm, arm_softfloat.
msgpack-d 1.0.2: building configuration "default"...
/home/tbl/projects/temp/ldc2-1.21.0-linux-x86_64/bin/ldc2 failed with exit code -11.

bt from ldc crash:

#0 0x0000000000000002 in ?? ()
#1 0x000000000cc4e920 in ?? ()
#2 0x0000000000000008 in ?? ()
#3 0x00000000020975cb in llvm::DAGTypeLegalizer::run() ()
#4 0x000000000209b141 in llvm::SelectionDAG::LegalizeTypes() ()
#5 0x000000000204ada6 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() ()
#6 0x000000000204a877 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ()
#7 0x0000000002048146 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
#8 0x0000000001cac221 in (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
#9 0x00000000022d6e08 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ()
#10 0x0000000002c908f6 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#11 0x0000000002c90b83 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#12 0x0000000002c911d8 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#13 0x0000000000df275e in (anonymous namespace)::codegenModule(llvm::TargetMachine&, llvm::Module&, char const*, llvm::CodeGenFileType) ()
#14 0x0000000000df1a0f in writeModule(llvm::Module*, char const*) ()
#15 0x0000000000def814 in ldc::CodeGenerator::writeAndFreeLLModule(char const*) ()
#16 0x0000000000df06ca in ldc::CodeGenerator::emit(Module*) ()
#17 0x0000000000dc9761 in codegenModules(Array<Module*>&) ()
#18 0x0000000000cc3df7 in mars_mainBody(Param&, Array<char const*>&, Array<char const*>&) ()
#19 0x0000000000dc8dde in cppmain() ()
#20 0x0000000000f7efe0 in _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv ()
#21 0x0000000000f7ed10 in _d_run_main2 ()
#22 0x0000000000f7eb3e in _d_run_main ()
#23 0x0000000000dc64d5 in main ()
#24 0x00007ffff7aa4002 in __libc_start_main () from /usr/lib/libc.so.6
#25 0x0000000000aadff9 in _start ()

@kinke
Copy link
Member

kinke commented May 20, 2020

I can reproduce a crash when NOT specifying -mcpu=cortex-a8, with it, it compiles. This is mentioned in https://wiki.dlang.org/Cross-compiling_with_LDC and used in the prebuilt armv7a package.

kinke added a commit to kinke/ldc that referenced this issue May 20, 2020
Hardcoded instead of pre-setting ldc2.conf for the prebuilt Android
packages, and thus simplifying cross-compilation (e.g., issue ldc-developers#3437).

Also use `core2` instead of `x86-64` for Android x86_64.
@ThomasBrixLarsen
Copy link
Author

I see. It used to working without the mcpu flag.

@kinke
Copy link
Member

kinke commented May 26, 2020

Probably something's changed with LLVM 10 then.

kinke added a commit that referenced this issue Jun 1, 2020
Hardcoded instead of pre-setting ldc2.conf for the prebuilt Android
packages, and thus simplifying cross-compilation (e.g., issue #3437).

Also use `core2` instead of `x86-64` for Android x86_64.
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

2 participants