I'm attempting to build Swift 4.2 on armv7. The swift-4.2-RELEASE tag, specifically. Unfortunately, after fixing a couple simple typecast issues I'm hitting a rather gnarly issue when I get to linking Swift.o itself for the stdlib, where the optimizer in the built swift binary goes south:
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
Interestingly, the built swift can't demangle this symbol, which may be related to my problem. The Xcode 10 build can demangle it though:
@generic specialization <preserving fragile attribute, Swift._UnmanagedString<Swift.UInt16>> of protocol witness for Swift.IteratorProtocol.next() -> A.Element? in conformance Swift.ReversedCollection<A>.Iterator : Swift.IteratorProtocol in Swift
Unfortunately, attempting to build swift in debug on this device appears to be out of the question if I want the LLVM pieces of the stack too. Building with
--release-debuginfo will exhaust VM address space when linking libLTO in llvm, and probably others downstream of that one. I've already confirmed swap is not the limiting factor in this case.
I've been attempting to bisect the development history, but this is currently slow going as the change happened prior to the 4.2 branch being created. The first development snapshot (
swift-4.2-DEVELOPMENT-SNAPSHOT-2018-04-23-a) has the bug as well. swift-4.1.3-RELEASE does not. Since I'm not really too familiar with the codebase, I'm not really sure where 4.1 forked off of master and stopped receiving regular merges. And I'm hitting a number of other breaks with the development snapshots which make it harder to track things back as it can take a day of effort just to wade through the breaks to find out if a snapshot tag is good or not.
I'm hoping someone might recognize this enough to help me figure out what window to look at in the master branch so I can save some time digging through the history. Or at the least can point me at some information that helps me understand when the version branches forked so I can hunt through the history more efficiently.