Build swift on FreeBSD

Hello, I am a freebsd user. Swift interests me. I clone the swift git to freebsd os and build it then I don't know how to play with it, these are my experience:

mkdir swift-sources

cd swift-sources

git clone https://github.com/apple/swift

./swift/utils/update-checkout --clone

cd swift

./utils/build-script -R

After build finished, the swift has been generated:

$ cd ../

$ ls ./build/Ninja-ReleaseAssert/

cmark-freebsd-x86_64 llvm-freebsd-x86_64

libdispatch-freebsd-x86_64 swift-freebsd-x86_642

But when I invoke swift and swiftc, it show these errors:

$ ./build/Ninja-ReleaseAssert/swift-freebsd-x86_64/bin/swift

:0: error: could not load the swift standard library

So the first question is how can I configure the swift standard library?

I need swift working to learn swift programming.

The second question:

$ echo "print("Hello Swift!")" > code.swift

$ ./build/Ninja-ReleaseAssert/swift-freebsd-x86_64/bin/swiftc code.swift

$ ls

build log.01.txt clang ninja

cmark swift

code swift-corelibs-foundation

code.swift swift-corelibs-libdispatch

compiler-rt swift-corelibs-xctest

llbuild swift-integration-tests

lldb swift-xcode-playground-support

llvm swiftpm

$ ./code

/usr/home/f/bin/sources/swift-sources/build/Ninja-ReleaseAssert/swift-freebsd-x86_64/lib/swift/freebsd/libswiftCore.so: Undefined symbol "__gnustep_objcxx_personality_v0"

Swiftc can fortunitely compile the code, but when I run it, it

reports __gnustep_objcxx_personality_v0 is undefined symbol.

Yes, really it doesn't have gnustep or objcxx. I only want swift

and swiftc working. What should I do next?

The error may be because of the missing symbol you saw earlier. The build has a setting SWIFT_LINK_OBJC_RUNTIME which should default to NO on non-Darwin systems, but I don't know how the detection works on FreeBSD.

The symbol is being emitted by the clang compiler and it seems to think there's a GnuStep header somewhere, so that would be where you could start looking to see what is happening:

Alex

ยทยทยท

On 15 Apr 2017, at 09:41, J O via swift-users <swift-users@swift.org> wrote:

Hello, I am a freebsd user. Swift interests me. I clone the swift git to freebsd os and build it then I don't know how to play with it, these are my experience:

mkdir swift-sources
cd swift-sources
git clone GitHub - apple/swift: The Swift Programming Language
./swift/utils/update-checkout --clone
cd swift
./utils/build-script -R

After build finished, the swift has been generated:
$ cd ../
$ ls ./build/Ninja-ReleaseAssert/
cmark-freebsd-x86_64 llvm-freebsd-x86_64
libdispatch-freebsd-x86_64 swift-freebsd-x86_642

But when I invoke swift and swiftc, it show these errors:
$ ./build/Ninja-ReleaseAssert/swift-freebsd-x86_64/bin/swift
<unknown>:0: error: could not load the swift standard library

So the first question is how can I configure the swift standard library?
I need swift working to learn swift programming.

The second question:
$ echo "print(\"Hello Swift!\")" > code.swift
$ ./build/Ninja-ReleaseAssert/swift-freebsd-x86_64/bin/swiftc code.swift
$ ls
build log.01.txt clang ninja
cmark swift
code swift-corelibs-foundation
code.swift swift-corelibs-libdispatch
compiler-rt swift-corelibs-xctest
llbuild swift-integration-tests
lldb swift-xcode-playground-support
llvm swiftpm
$ ./code
/usr/home/f/bin/sources/swift-sources/build/Ninja-ReleaseAssert/swift-freebsd-x86_64/lib/swift/freebsd/libswiftCore.so: Undefined symbol "__gnustep_objcxx_personality_v0"

Swiftc can fortunitely compile the code, but when I run it, it
reports __gnustep_objcxx_personality_v0 is undefined symbol.
Yes, really it doesn't have gnustep or objcxx. I only want swift
and swiftc working. What should I do next?

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users