[swift-users] Building swift with xctest and foundation fails

Mohit Athwani mohit.athwani at gmail.com
Wed Mar 29 20:29:05 CDT 2017


I'm trying to get back to work starting from scratch on Swift Foundation on
my Ubuntu 16.04 LTS system.

I cloned the main swift repo and all of it's dependencies via ssh

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

and after running (taken from instructions from the Foundation site):

swift/utils/build-script --xctest --foundation -t

I get the following error:

+ make build-tests
/bin/bash ../libtool  --tag=CC   --mode=link
/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/bin/clang
-Wall -Wno-deprecated-declarations  -fblocks
-I/home/mohit/Documents/swift-source/swift-corelibs-libdispatch/src/BlocksRuntime
-isystem /usr/include/bsd -DLIBBSD_OVERLAY   -g -O0 -rpath
/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/swift-linux-x86_64/lib/swift/linux/x86_64
-o dispatch_apply dispatch_apply.o libbsdtests.la ../src/libdispatch.la
-lbsd
-L/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/swift-linux-x86_64/lib/swift/linux/x86_64
-lswiftCore -lswiftSwiftOnoneSupport -lpthread
libtool: link:
/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/bin/clang
-Wall -Wno-deprecated-declarations -fblocks
-I/home/mohit/Documents/swift-source/swift-corelibs-libdispatch/src/BlocksRuntime
-isystem /usr/include/bsd -DLIBBSD_OVERLAY -g -O0 -o .libs/dispatch_apply
dispatch_apply.o  ./.libs/libbsdtests.a ../src/.libs/libdispatch.so -lbsd
-L/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/swift-linux-x86_64/lib/swift/linux/x86_64
-lswiftCore -lswiftSwiftOnoneSupport -lpthread -Wl,-rpath
-Wl,//usr/lib/swift/linux -Wl,-rpath
-Wl,/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/swift-linux-x86_64/lib/swift/linux/x86_64
/home/mohit/Documents/swift-source/build/Ninja-DebugAssert/swift-linux-x86_64/lib/swift/linux/x86_64/libswiftCore.so:
undefined reference to `objc_release'
clang-4.0: error: linker command failed with exit code 1 (use -v to see
invocation)
Makefile:1123: recipe for target 'dispatch_apply' failed
make: *** [dispatch_apply] Error 1
swift/utils/build-script: fatal error: command terminated with a non-zero
exit status 2, aborting

Looks like there is some undefined reference for objc_release in
libswiftCore.

>From the looks of the message it looks like swift was actually built but
it's just that test cases weren't built. On this hunch, I went into my
swift-corelibs-foundation folder and tried to execute:

ninja

Which tells me:

ninja: error: loading 'build.ninja': No such file or directory

Given my lack of experience here, I'm not quite sure how to go about
resolving these issues.

Could somebody help me out here please.

Thanks,

Mohit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170329/b89523aa/attachment.html>


More information about the swift-users mailing list