More Swift 3 Raspberry Pi 2 build problems

I temporarily hacked around the NSXMLNode.swift integer literal
overflow error I mentioned in the other thread to continue the build.
I hit a few more problems afterwards.

First, there was some kind of segmentation fault. It looks like swift
crashed trying to build libXCTest.so.

···

==================

+ pushd /home/pi/Source/SWIFT/swift-corelibs-foundation
~/Source/SWIFT/swift-corelibs-foundation ~/Source/SWIFT/swift
+ /home/pi/Source/SWIFT/build/buildbot_linux/ninja-build/ninja
[146/146] Link:
../build/buildbot_linux/fo...on-linux-armv7/Foundation/libFoundation.so
+ popd
~/Source/SWIFT/swift
xctest: using gold linker
+ /home/pi/Source/SWIFT/swift-corelibs-xctest/build_script.py
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
--foundation-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-src-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--release
xctest-build: mkdir -p
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
xctest-build: /home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
-Xcc -fblocks -c -O -emit-object -emit-module -module-name XCTest
-module-link-name XCTest -parse-as-library -emit-module-path
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.swiftmodule
-force-single-frontend-invocation -I
/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
-I /home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation/usr/lib/swift
-I /home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7/src
-I /home/pi/Source/SWIFT/swift-corelibs-libdispatch
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/ObjectWrapper.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCTestCaseSuite.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCPredicateExpectation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCTestInternalObservation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/TestFiltering.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/PrintObserver.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/PerformanceMeter.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/WallClockTimeMetric.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/ArgumentParser.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTAssert.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestSuite.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCaseRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCNotificationExpectationHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase+Performance.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestObservation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestObservationCenter.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase+Asynchronous.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCPredicateExpectationHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestSuiteRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestErrors.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestExpectation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCWaitCompletionHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCAbstractTest.swift
-o /home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.o
xctest-build: /home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
-emit-library /home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.o
-L /home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
-lswiftGlibc -lswiftCore -lFoundation -lm -Xlinker -rpath=\$ORIGIN -o
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/libXCTest.so
xctest-build: Done.
swiftpm: using gold linker
+ /home/pi/Source/SWIFT/swiftpm/Utilities/bootstrap
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--sbt=/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
--build=/home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7
--foundation=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-source-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--xctest=/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f /home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

I changed the build flags from using the build-bot linux armv7, to
specifying flags so I could skip the XCTest. I then got another crash.
It looks like it is Swift-Build.

~/Source/SWIFT/swift
+ pushd /home/pi/Source/SWIFT/swift-corelibs-foundation
~/Source/SWIFT/swift-corelibs-foundation ~/Source/SWIFT/swift
+ /home/pi/Source/SWIFT/build/buildbot_linux/ninja-build/ninja
[114/114] Link:
../build/buildbot_linux/fo...on-linux-armv7/Foundation/libFoundation.so
+ popd
~/Source/SWIFT/swift
swiftpm: using gold linker
+ /home/pi/Source/SWIFT/swiftpm/Utilities/bootstrap
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--sbt=/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
--build=/home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7
--foundation=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-source-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f /home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

==================

I skipped the Swift Build stuff. Finally it gets to the packaging
phase, and something in the packaging phase fails. I think it has
something to do with Python 2.7. I checked the directories and I seem
to have a python 3.4 subdirectory that was created in the Swift
package, but the python 2.7 directory it refers to doesn't exist. (My
Pi has the Python 2.7 packages installed. I think 3 is also
installed.)

==================

- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/LanguageCategory.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/StringPrinter.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/TypeCategory.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/VectorIterator.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/TypeFormat.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/FormatManager.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/FormattersContainer.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/CXXFunctionPointer.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/DataVisualization.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/DumpValueObjectOptions.h
CMake Error at scripts/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "/home/pi/Source/SWIFT/build/buildbot_linux/lldb-linux-armv7/lib/python2.7".
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

FAILED: cd /home/pi/Source/SWIFT/build/buildbot_linux/lldb-linux-armv7
&& /home/pi/usr/local/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

==================

I would appreciate any guidance on these.

Thanks,
Eric

And here is one more problem I found. I get a compiler assertion
failure on some code that used to work for me in Swift 2.3 on Pi, and
also compiles fine under Xcode 8/Swift 3. I filed a formal radar for
this one.

swift: /home/pi/Source/SWIFT/swift/lib/IRGen/GenCall.cpp:1886: void
swift::irgen::CallEmission::setArgs(swift::irgen::Explosion &,
swift::irgen::WitnessMetadata *): Assertion `LastArgWritten >=
adjustedArg.size()' failed.

Thanks,
Eric

Hi Eric,

Can you check whether what you're building on has this commit? Fixes ‘Illegal instruction’ crash caused by SR-2339 (#605) · apple/swift-package-manager@0268214 · GitHub

There was a truncation of a bit pattern that was causing a trap on arm.

It looks like you're using qemu, so it's possible that it's handling the trap strangely.

Also, for arm-specific build issues and the like, the swift-arm slack channel may be helpful http://dev.iachieved.it:9909 <http://dev.iachieved.it:9909/&gt;

- Will

···

On Sep 19, 2016, at 7:18 AM, Eric Wing via swift-dev <swift-dev@swift.org> wrote:

I temporarily hacked around the NSXMLNode.swift integer literal
overflow error I mentioned in the other thread to continue the build.
I hit a few more problems afterwards.

First, there was some kind of segmentation fault. It looks like swift
crashed trying to build libXCTest.so.

+ pushd /home/pi/Source/SWIFT/swift-corelibs-foundation
~/Source/SWIFT/swift-corelibs-foundation ~/Source/SWIFT/swift
+ /home/pi/Source/SWIFT/build/buildbot_linux/ninja-build/ninja
[146/146] Link:
../build/buildbot_linux/fo...on-linux-armv7/Foundation/libFoundation.so
+ popd
~/Source/SWIFT/swift
xctest: using gold linker
+ /home/pi/Source/SWIFT/swift-corelibs-xctest/build_script.py
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
--foundation-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-src-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--release
xctest-build: mkdir -p
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
xctest-build: /home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
-Xcc -fblocks -c -O -emit-object -emit-module -module-name XCTest
-module-link-name XCTest -parse-as-library -emit-module-path
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.swiftmodule
-force-single-frontend-invocation -I
/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
-I /home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation/usr/lib/swift
-I /home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7/src
-I /home/pi/Source/SWIFT/swift-corelibs-libdispatch
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/ObjectWrapper.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCTestCaseSuite.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCPredicateExpectation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/XCTestInternalObservation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/TestFiltering.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/PrintObserver.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/PerformanceMeter.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/WallClockTimeMetric.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Private/ArgumentParser.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTAssert.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestSuite.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCaseRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCNotificationExpectationHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase+Performance.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestObservation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestObservationCenter.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase+Asynchronous.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCPredicateExpectationHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestCase.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestSuiteRun.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestErrors.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestExpectation.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCWaitCompletionHandler.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift
/home/pi/Source/SWIFT/swift-corelibs-xctest/Sources/XCTest/Public/XCAbstractTest.swift
-o /home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.o
xctest-build: /home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
-emit-library /home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/XCTest.o
-L /home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
-lswiftGlibc -lswiftCore -lFoundation -lm -Xlinker -rpath=\$ORIGIN -o
/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7/libXCTest.so
xctest-build: Done.
swiftpm: using gold linker
+ /home/pi/Source/SWIFT/swiftpm/Utilities/bootstrap
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--sbt=/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
--build=/home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7
--foundation=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-source-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--xctest=/home/pi/Source/SWIFT/build/buildbot_linux/xctest-linux-armv7
--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f /home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

I changed the build flags from using the build-bot linux armv7, to
specifying flags so I could skip the XCTest. I then got another crash.
It looks like it is Swift-Build.

~/Source/SWIFT/swift
+ pushd /home/pi/Source/SWIFT/swift-corelibs-foundation
~/Source/SWIFT/swift-corelibs-foundation ~/Source/SWIFT/swift
+ /home/pi/Source/SWIFT/build/buildbot_linux/ninja-build/ninja
[114/114] Link:
../build/buildbot_linux/fo...on-linux-armv7/Foundation/libFoundation.so
+ popd
~/Source/SWIFT/swift
swiftpm: using gold linker
+ /home/pi/Source/SWIFT/swiftpm/Utilities/bootstrap
--swiftc=/home/pi/Source/SWIFT/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--sbt=/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
--build=/home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7
--foundation=/home/pi/Source/SWIFT/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-source-dir=/home/pi/Source/SWIFT/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFT/build/buildbot_linux/libdispatch-linux-armv7
--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f /home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

==================

I skipped the Swift Build stuff. Finally it gets to the packaging
phase, and something in the packaging phase fails. I think it has
something to do with Python 2.7. I checked the directories and I seem
to have a python 3.4 subdirectory that was created in the Swift
package, but the python 2.7 directory it refers to doesn't exist. (My
Pi has the Python 2.7 packages installed. I think 3 is also
installed.)

==================

- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/LanguageCategory.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/StringPrinter.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/TypeCategory.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/VectorIterator.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/TypeFormat.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/FormatManager.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/FormattersContainer.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/CXXFunctionPointer.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/DataVisualization.h
-- Installing: /home/pi/swift/usr/include/lldb/DataFormatters/DumpValueObjectOptions.h
CMake Error at scripts/cmake_install.cmake:36 (file):
file INSTALL cannot find
"/home/pi/Source/SWIFT/build/buildbot_linux/lldb-linux-armv7/lib/python2.7".
Call Stack (most recent call first):
cmake_install.cmake:42 (include)

FAILED: cd /home/pi/Source/SWIFT/build/buildbot_linux/lldb-linux-armv7
&& /home/pi/usr/local/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

==================

I would appreciate any guidance on these.

Thanks,
Eric
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

- Yes, that commit is in my tree.
- I used qemu to build Swift itself, however, I'm using Swift to
compile on a real Pi (which is where that assertion is hit).
- I don't think I'm using Swift package manager. That is a direct
invocation using swift -frontend -c

Thanks,
Eric

···

On 9/20/16, william <william@housedillon.com> wrote:

Hi Eric,

Can you check whether what you're building on has this commit?
Fixes ‘Illegal instruction’ crash caused by SR-2339 (#605) · apple/swift-package-manager@0268214 · GitHub
<https://github.com/apple/swift-package-manager/commit/0268214b5477ca338b502c90aaa3e9ba50b68e18&gt;

There was a truncation of a bit pattern that was causing a trap on arm.

It looks like you're using qemu, so it's possible that it's handling the
trap strangely.

Also, for arm-specific build issues and the like, the swift-arm slack
channel may be helpful http://dev.iachieved.it:9909
<http://dev.iachieved.it:9909/&gt;

- Will

Interesting... It's this part of your logs that got me thinking about that:

--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f /home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

···

On Sep 20, 2016, at 1:01 PM, Eric Wing <ewmailing@gmail.com> wrote:

On 9/20/16, william <william@housedillon.com> wrote:

Hi Eric,

Can you check whether what you're building on has this commit?
https://github.com/apple/swift-package-manager/commit/0268214b5477ca338b502c90aaa3e9ba50b68e18
<https://github.com/apple/swift-package-manager/commit/0268214b5477ca338b502c90aaa3e9ba50b68e18&gt;

There was a truncation of a bit pattern that was causing a trap on arm.

It looks like you're using qemu, so it's possible that it's handling the
trap strangely.

Also, for arm-specific build issues and the like, the swift-arm slack
channel may be helpful http://dev.iachieved.it:9909
<http://dev.iachieved.it:9909/&gt;

- Will

- Yes, that commit is in my tree.
- I used qemu to build Swift itself, however, I'm using Swift to
compile on a real Pi (which is where that assertion is hit).
- I don't think I'm using Swift package manager. That is a direct
invocation using swift -frontend -c

Thanks,
Eric

==================

I thought that swift-build-tool is what is responsible for `swift build`

- Will

Sorry for the confusion.
To clarify, the bug SR-2706 was on a real Pi, invoking swift -frontend
-c directly.
The other build failures were part of the normal building Swift from
source, which was on QEMU, which may use Swift package manager. The
source tree does include the commit you asked about.

Thanks,
Eric

···

On 9/20/16, William Dillon <william@housedillon.com> wrote:

On Sep 20, 2016, at 1:01 PM, Eric Wing <ewmailing@gmail.com> wrote:

On 9/20/16, william <william@housedillon.com> wrote:

Hi Eric,

Can you check whether what you're building on has this commit?
https://github.com/apple/swift-package-manager/commit/0268214b5477ca338b502c90aaa3e9ba50b68e18
<https://github.com/apple/swift-package-manager/commit/0268214b5477ca338b502c90aaa3e9ba50b68e18&gt;

There was a truncation of a bit pattern that was causing a trap on arm.

It looks like you're using qemu, so it's possible that it's handling the
trap strangely.

Also, for arm-specific build issues and the like, the swift-arm slack
channel may be helpful http://dev.iachieved.it:9909
<http://dev.iachieved.it:9909/&gt;

- Will

- Yes, that commit is in my tree.
- I used qemu to build Swift itself, however, I'm using Swift to
compile on a real Pi (which is where that assertion is hit).
- I don't think I'm using Swift package manager. That is a direct
invocation using swift -frontend -c

Thanks,
Eric

Interesting... It's this part of your logs that got me thinking about
that:

--- bootstrap: note: building stage1:
/home/pi/Source/SWIFT/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
-f
/home/pi/Source/SWIFT/build/buildbot_linux/swiftpm-linux-armv7/.bootstrap/build.swift-build
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
--- bootstrap: error: build failed with exit status -11
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero
exit status 1, aborting

I thought that swift-build-tool is what is responsible for `swift build`

- Will

Since you spotted a problem using QEMU, I did a rebuild on a real Pi
2. I think the segfaults during the build went away.

However, I still get the install error about
CMake Error at scripts/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "/home/pi/Source/SWIFT/build/Ninja-Release/lldb-linux-armv7/lib/python2.7".
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

Removing the --install-lldb flag allows me to skip past this for now.

But when I actually try to use swiftc to compile a test program, I get
an error about swift-autolink-extract:

swiftc -v main.swift
Swift version 3.0-dev (LLVM 1defb1946c, Clang ef0a699416, Swift 870b785219)
Target: armv7--linux-gnueabihf
/home/pi/swift/usr/bin/swift -frontend -c -primary-file main.swift
-target armv7--linux-gnueabihf -disable-objc-interop
-color-diagnostics -module-name main -o /tmp/main-ea93b4.o
swift-autolink-extract /tmp/main-ea93b4.o -o /tmp/main-1ae7d8.autolink
<unknown>:0: error: swift-autolink-extract command failed with exit
code 127 (use -v to see invocation)

Any ideas?
I just spotted the GitHub - iachievedit/package-swift: Set of scripts for building and packaging Swift on Ubuntu Linux repo
which I presume has additional patches you've made. I'm about to try
this (another 12 hour cycle) hoping it helps.

Thanks,
Eric

Hi Eric,

I'm glad you're making progress.

I've seen the swift-autolink-extract issue before. For some reason that symlink to swift isn't being made for you. You can try making a new symlink to `swift` and see if that gets you forward.

I'd recommend using the github swift-arm repos, specifically the swift-3.0-branch branch. Checkout by cloning the swift repo, then use ./swift/utils/update-checkout --clone --branch swift-3.0-branch. That's what I'm using currently.

Hope that helps!
- Will

···

On Sep 21, 2016, at 1:09 PM, Eric Wing <ewmailing@gmail.com> wrote:

Since you spotted a problem using QEMU, I did a rebuild on a real Pi
2. I think the segfaults during the build went away.

However, I still get the install error about
CMake Error at scripts/cmake_install.cmake:36 (file):
file INSTALL cannot find
"/home/pi/Source/SWIFT/build/Ninja-Release/lldb-linux-armv7/lib/python2.7".
Call Stack (most recent call first):
cmake_install.cmake:42 (include)

Removing the --install-lldb flag allows me to skip past this for now.

But when I actually try to use swiftc to compile a test program, I get
an error about swift-autolink-extract:

swiftc -v main.swift
Swift version 3.0-dev (LLVM 1defb1946c, Clang ef0a699416, Swift 870b785219)
Target: armv7--linux-gnueabihf
/home/pi/swift/usr/bin/swift -frontend -c -primary-file main.swift
-target armv7--linux-gnueabihf -disable-objc-interop
-color-diagnostics -module-name main -o /tmp/main-ea93b4.o
swift-autolink-extract /tmp/main-ea93b4.o -o /tmp/main-1ae7d8.autolink
<unknown>:0: error: swift-autolink-extract command failed with exit
code 127 (use -v to see invocation)

Any ideas?
I just spotted the GitHub - iachievedit/package-swift: Set of scripts for building and packaging Swift on Ubuntu Linux repo
which I presume has additional patches you've made. I'm about to try
this (another 12 hour cycle) hoping it helps.

Thanks,
Eric

Hi Eric,

I'm glad you're making progress.

I've seen the swift-autolink-extract issue before. For some reason that
symlink to swift isn't being made for you. You can try making a new symlink
to `swift` and see if that gets you forward.

Thank you. The symlink trick fixed that problem. I can now compile
multiple programs and it works.

Unfortunately, a slightly less trivial program I tried segfaults at
runtime. This program works under Xcode 8 and the official Ubuntu 15
Linux build. I'm hoping that arm branch and patches will clear this
up.

I'd recommend using the github swift-arm repos, specifically the
swift-3.0-branch branch. Checkout by cloning the swift repo, then use
./swift/utils/update-checkout --clone --branch swift-3.0-branch. That's
what I'm using currently.

Hope that helps!
- Will

So I was just going to follow the instructions documented here:

I think it already clones your repos and uses the swift-3.0-branch.
If I use the command you suggest:
./swift/utils/update-checkout --clone --branch swift-3.0-branch
It will try to make all the other repos switch to a branch called
swift-3.0-branch which doesn't exist.

Do you recommend I not follow that guide?

Thanks,
Eric

···

On 9/21/16, William Dillon <william@housedillon.com> wrote:

Well, I finished the full rebuild, but I seemed to have come across a
lot of the same problems again.

(1) First, building everything via the package.sh, I hit some error I
think connected to xctest or maybe swiftpm:

···

========
+ /home/pi/Source/SWIFTARM/package-swift/swiftpm/Utilities/bootstrap
--swiftc=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/swift-linux-armv7/bin/swiftc
--sbt=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool
--build=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/swiftpm-linux-armv7
--foundation=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/foundation-linux-armv7/Foundation
--libdispatch-source-dir=/home/pi/Source/SWIFTARM/package-swift/swift-corelibs-libdispatch
--libdispatch-build-dir=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/libdispatch-linux-armv7
--xctest=/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/xctest-linux-armv7
*** Error in `/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/llbuild-linux-armv7/bin/swift-build-tool./swift/utils/build-script:
fatal error: command terminated with a non-zero exit status 1,
aborting
cp: cannot create directory
‘/home/pi/Source/SWIFTARM/package-swift/install/usr/lib/swift’: No
such file or directory
cp: cannot create regular file
‘/home/pi/Source/SWIFTARM/package-swift/install/usr/lib/swift/linux/armv7/’:
No such file or directory
cp: cannot create regular file
‘/home/pi/Source/SWIFTARM/package-swift/install/usr/lib/swift/linux/armv7/’:
No such file or directory
cp: cannot create regular file
‘/home/pi/Source/SWIFTARM/package-swift/install/usr/lib/swift/linux/’:
No such file or directory
cp: cannot create regular file
‘/home/pi/Source/SWIFTARM/package-swift/install/usr/lib/swift/linux’:
No such file or directory

===========

(2) Removing those from the build, I then return to the installing
lldb/python2.7 error I mentioned before.

===============
-- Installing: /home/pi/Source/SWIFTARM/package-swift/install/usr/include/lldb/Utility/AnsiTerminal.h
-- Installing: /home/pi/Source/SWIFTARM/package-swift/install/usr/include/lldb/lldb-forward.h
CMake Error at scripts/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "/home/pi/Source/SWIFTARM/package-swift/build/buildbot_linux/lldb-linux-armv7/lib/python2.7".
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

===============

(3) Finally, removing lldb from the build and using the created Swift
compiler, I can build and run trivial test programs, but I get that
irgen::CallEmission assertion failure on my less trivial programs.

I actually don't need xctest and lldb right now, but this one is a
blocker for me.

Thanks,
Eric