uraimo / buildSwiftOnARM

All you need to build Swift on a RaspberryPi or other ARM boards, updated to Swift 5.1.5
489 stars 37 forks source link

[arm32] [4.2] assertion 'hasVal' failed linking Swift.o #26

Closed Kaiede closed 5 years ago

Kaiede commented 6 years ago

I've been hitting this one after fixing the other issue. Don't know how much time I'll get to look at it. I'll see what I can do on my end, but mostly wanted to make sure this gets tracked somewhere and people know it is an issue if coming in new.


swift: /home/pi/buildSwiftOnARM/llvm/include/llvm/ADT/Optional.h:160: T &&llvm::Optional<swift::ProjectionKind>::operator*() &&[T = swift::ProjectionKind]: Assertion 'hasVal' failed.

2. .      While running pass #418236 SILFunctionTransform "RedundantLoadElimination" on SILFunction "@$Ss18ReversedCollectionV8IteratorVyx_Gs0C8ProtocolsSt4next7ElementQzSgyFTWs16_UnmanagedStringVys6UInt16VG_Tgq5".
 for 'next()' at /home/pi/buildSwiftOnARM/swift/stdlib/public/core/Reverse.swift:91:19```
uraimo commented 6 years ago

That's the same point I've reached after applying #25. I've checked for recent modifications to name mangling/demangling and there shouldn't be any.

Kaiede commented 6 years ago

Probably not recent. I started trying to bisect the 4.2 development history, and the earliest snapshot tag (4.2-DEVELOPMENT-SNAPSHOT-2018-04-23-a) also fails to build in the same spot. Impressive that it's been this long without someone stumbling on it.

Kaiede commented 6 years ago

Cause by commit 7c096c9f264075d1f38e2621f3659e25c0b78233 ( https://github.com/apple/swift/commit/7c096c9f264075d1f38e2621f3659e25c0b78233)

Reversing it appears to fix the issue, but reveals another one that I can confirm existed prior to this commit. #30

Kaiede commented 6 years ago

That’s the wrong commit, that commit fixed the other stdlib build failure.

This was introduced between Jan 25 and Jan 21, still tracking down.

Kaiede commented 6 years ago

Fix available here: https://github.com/apple/swift/pull/19600