This is using nlvm on git master, hash c308bf9
My test case: A really basic test.nim file that contains one line:
echo "SSSSSSSSSS"
This command works fine:
nlvm c test
This command fails:
nlvm c --nlvm.target:i386-linux-musl test
With this error:
Hint: used config file '/home/david/dev/misc/github/nlvm/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/david/dev/misc/github/nlvm/Nim/config/config.nims' [Conf]
.......................................................nlvm: /home/david/dev/misc/github/nlvm/ext/llvm-14.0.0.src/lib/IR/Constants.cpp:1280: llvm::ConstantAggregate::ConstantAggregate(llvm::Type*, llvm::Value::ValueTy, llvm::ArrayRefllvm::Constant*): Assertion `V[I]->getType() == ST->getTypeAtIndex(I) && "Initializer for struct element doesn't match!"' failed.
Traceback (most recent call last)
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(320) nlvm
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(279) handleCmdLine
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(230) mainCommand
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(185) commandCompile
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(177) compileProject
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(153) compileSystemModule
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(98) compileModule
/home/david/dev/misc/github/nlvm/Nim/compiler/passes.nim(180) processModule
/home/david/dev/misc/github/nlvm/Nim/compiler/passes.nim(73) processTopLevelStmt
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7548) myProcess
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7081) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(6335) genNodeAsgn
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4243) genAsgn
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4124) genCallOrNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5699) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5480) genMagic
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4610) genMagicBinOpOverflow
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4590) genMagicBinOp
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5699) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5462) genMagic
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4313) genMagicIncDec
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2709) callBinOpWithOver
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2670) callRaise
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2545) callCompilerProc
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7099) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(6863) genNodeRaiseStmt
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7064) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5775) genNodeObjConstr
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4332) rawGenNew
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2183) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2121) genNodeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2016) genObjectNodeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(1965) genObjectNodeInfoInit
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(1924) constNimNodeList
/home/david/dev/misc/github/nlvm/llvm/llvm.nim(365) constNamedStruct
SIGABRT: Abnormal termination.
Aborted
This is using nlvm on git master, hash c308bf9
My test case: A really basic test.nim file that contains one line:
echo "SSSSSSSSSS"
This command works fine:
nlvm c test
This command fails:
nlvm c --nlvm.target:i386-linux-musl test
With this error:
Hint: used config file '/home/david/dev/misc/github/nlvm/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/david/dev/misc/github/nlvm/Nim/config/config.nims' [Conf]
.......................................................nlvm: /home/david/dev/misc/github/nlvm/ext/llvm-14.0.0.src/lib/IR/Constants.cpp:1280: llvm::ConstantAggregate::ConstantAggregate(llvm::Type*, llvm::Value::ValueTy, llvm::ArrayRefllvm::Constant*): Assertion `V[I]->getType() == ST->getTypeAtIndex(I) && "Initializer for struct element doesn't match!"' failed.
Traceback (most recent call last)
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(320) nlvm
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(279) handleCmdLine
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(230) mainCommand
/home/david/dev/misc/github/nlvm/nlvm/nlvm.nim(185) commandCompile
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(177) compileProject
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(153) compileSystemModule
/home/david/dev/misc/github/nlvm/Nim/compiler/modules.nim(98) compileModule
/home/david/dev/misc/github/nlvm/Nim/compiler/passes.nim(180) processModule
/home/david/dev/misc/github/nlvm/Nim/compiler/passes.nim(73) processTopLevelStmt
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7548) myProcess
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7081) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(6335) genNodeAsgn
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4243) genAsgn
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4124) genCallOrNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5699) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5480) genMagic
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4610) genMagicBinOpOverflow
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4590) genMagicBinOp
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7104) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7043) genSons
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5699) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5462) genMagic
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4313) genMagicIncDec
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2709) callBinOpWithOver
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2670) callRaise
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2545) callCompilerProc
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7059) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5701) genNodeCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3706) genCall
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7054) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5633) genNodeSym
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(3242) genFunctionWithBody
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7099) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(6863) genNodeRaiseStmt
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(7064) genNode
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(5775) genNodeObjConstr
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(4332) rawGenNew
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2182) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2137) genTypeInfoBase
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2183) genTypeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2121) genNodeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(2016) genObjectNodeInfo
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(1965) genObjectNodeInfoInit
/home/david/dev/misc/github/nlvm/nlvm/llgen.nim(1924) constNimNodeList
/home/david/dev/misc/github/nlvm/llvm/llvm.nim(365) constNamedStruct
SIGABRT: Abnormal termination.
Aborted