[swift-users] Building Swift on linux, fails at linking of libswiftCore.so

Bart Overkamp bart at overkamp.cistron.nl
Wed Mar 9 15:42:16 CST 2016


Both the standard linker and the gold one.

I did:
$ sudo aptitude install git cmake ninja-build clang python uuid-dev
libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev
swig libpython-dev libncurses5-dev pkg-config
$ git clone https://github.com/apple/swift.git
$ cd swift
$ utils/update-checkout --clone
$ utils/build-script -t -j 1
and
$ utils/build-script -t -j 1 -- --use-gold-linker
both fail

On Debian/testing

[500/528] Linking CXX shared library lib/swift/linux/x86_64/libswiftCore.so
FAILED: : && /usr/bin/clang++  -fPIC -fPIC -fvisibility-inlines-hidden
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics
-Wdocumentation -Wimplicit-fallthrough -Wunreachable-code
-Woverloaded-virtual -g  -Wl,-z,defs   -target x86_64-unknown-linux-gnu
-isysroot / -lpthread -ldl
 -L/home/boiert/Pruts/swift/build/Ninja-DebugAssert/swift-linux-x86_64/./lib/swift/linux/x86_64
-L/home/boiert/Pruts/swift/build/Ninja-DebugAssert/swift-linux-x86_64/./bin/../lib/swift/linux/x86_64
-L/home/boiert/Pruts/swift/build/Ninja-DebugAssert/swift-linux-x86_64/./bin/../lib/swift/linux
-shared -Wl,-soname,libswiftCore.so -o
lib/swift/linux/x86_64/libswiftCore.so lib/swift/linux/x86_64/swift_begin.o
stdlib/public/core/linux/x86_64/Swift.o lib/swift/linux/x86_64/swift_end.o
-L/home/boiert/Pruts/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/lib
 -L/home/boiert/Pruts/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/./lib
lib/swift/linux/x86_64/libswiftRuntime.a
lib/swift/linux/x86_64/libswiftStdlibStubs.a -licuuc -licui18n -lbsd
-Wl,-rpath,"\$ORIGIN:/usr/lib/swift/linux" && :
/usr/bin/ld: lib/swift/linux/x86_64/libswiftRuntime.a(HeapObject.cpp.o):
relocation R_X86_64_PC32 against protected symbol `_swift_allocObject' can
not be used when making a shared object
/usr/bin/ld: final link failed: Bad value

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160309/1edb99d0/attachment.html>


More information about the swift-users mailing list