build failure on FreeBSD

Attempting to build swift from github from Dec 26th HEAD - after a few adjustments I have gotton to this point where :

   [475/486] Linking CXX shared library lib/swift/freebsd/x86_64/libswiftCore.so

   FAILED: : && /usr/local/bin/clang++36 -f .....
   /usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/./lib/swift/freebsd/x86_64/swift.ld:10: syntax error

I put the whole paste in here if it is helpful:

   Hastebin: Send and Save Text or Code Snippets for Free | Toptal®

I saw a bugzilla post on this but it wasn't clear from it what can be
done to solve the problem:
https://sourceware.org/bugzilla/show_bug.cgi?id=19326

So, I have a few of the binaries built but not quite there yet :-)
% uname -a
FreeBSD 11.0-CURRENT #0 r292747: Sat Dec 26 08:34:38 CST 2015

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swift --version
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 173fc871ff)
Target: x86_64-unknown-freebsd11.0

and again - same error, when it tries to link:

% cat hello.swift
print("hello world")

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swiftc hello.swift /usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/lib/swift/freebsd/x86_64/swift.ld:10: syntax error
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

This is on FreeBSD head, clang-3.6 for bootstrapping the swift process
and tip of the trees for all the swift code today.

Dan

+ Davide

···

On Sat, Dec 26, 2015 at 11:11 PM, Dan Mack via swift-users <swift-users@swift.org> wrote:

Attempting to build swift from github from Dec 26th HEAD - after a few
adjustments I have gotton to this point where :

  [475/486] Linking CXX shared library
lib/swift/freebsd/x86_64/libswiftCore.so

  FAILED: : && /usr/local/bin/clang++36 -f .....

/usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/./lib/swift/freebsd/x86_64/swift.ld:10:
syntax error

I put the whole paste in here if it is helpful:

  http://hastebin.com/amokolizir.coffee

I saw a bugzilla post on this but it wasn't clear from it what can be
done to solve the problem:
19326 – Swift linker script unparsable

So, I have a few of the binaries built but not quite there yet :-)
% uname -a
FreeBSD 11.0-CURRENT #0 r292747: Sat Dec 26 08:34:38 CST 2015

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swift --version
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 173fc871ff)
Target: x86_64-unknown-freebsd11.0

and again - same error, when it tries to link:

% cat hello.swift
print("hello world")

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swiftc hello.swift
/usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/lib/swift/freebsd/x86_64/swift.ld:10:
syntax error
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see
invocation)

This is on FreeBSD head, clang-3.6 for bootstrapping the swift process
and tip of the trees for all the swift code today.

Dan

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

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/

Thank you, problem resolved, thanks!

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swift --version Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift bee0d955ff)
Target: x86_64-unknown-freebsd11.0

% ./hello hello world

% uname -a
FreeBSD localhost 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r292747

% ../build/Ninja-DebugAssert/swift-freebsd-x86_64/bin/swiftc hello.swift % ./hello hello world

% cat hello.swift print("hello world")

% file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.0 (1100092), not stripped
% ldd hello
hello:
         libswiftCore.so => /sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/lib/swift/freebsd/libswiftCore.so (0x800a00000)
         libc++.so.1 => /usr/lib/libc++.so.1 (0x801279000)
         libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x801537000)
         libm.so.5 => /lib/libm.so.5 (0x801755000)
         libc.so.7 => /lib/libc.so.7 (0x801980000)
         libicuuc.so.55 => /usr/local/lib/libicuuc.so.55 (0x801d2f000)
         libicui18n.so.55 => /usr/local/lib/libicui18n.so.55 (0x802200000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x80269e000)
         libicudata.so.55 => /usr/local/lib/libicudata.so.55 (0x802a00000)

Thanks again!

Dan

···

On Sat, 26 Dec 2015, Davide Italiano wrote:

On Sat, Dec 26, 2015 at 6:50 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

+ Davide

On Sat, Dec 26, 2015 at 11:11 PM, Dan Mack via swift-users >> <swift-users@swift.org> wrote:

Attempting to build swift from github from Dec 26th HEAD - after a few
adjustments I have gotton to this point where :

  [475/486] Linking CXX shared library
lib/swift/freebsd/x86_64/libswiftCore.so

  FAILED: : && /usr/local/bin/clang++36 -f .....

/usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/./lib/swift/freebsd/x86_64/swift.ld:10:
syntax error

I put the whole paste in here if it is helpful:

This happens because the version of ld.bfd shipped with FreeBSD is too
old. Also, gold doesn't support some linker script directives. I
recommend you to install binutils from ports and set the ld.bfd from
binutils as default linker.
Eventually (hopefully soon), FreeBSD will switch to lld as default but
until then, I think it might make sense to add a check in the build
script to make sure the linker version is new enough.
I'll prepare a patch in the next days.

Let me know if you face other problems,

--
Davide

Dan

+-------------------------+

Dan Mack |
mack@macktronics.com |
@macktronics |

+-------------------------+

This happens because the version of ld.bfd shipped with FreeBSD is too
old. Also, gold doesn't support some linker script directives. I
recommend you to install binutils from ports and set the ld.bfd from
binutils as default linker.
Eventually (hopefully soon), FreeBSD will switch to lld as default but
until then, I think it might make sense to add a check in the build
script to make sure the linker version is new enough.
I'll prepare a patch in the next days.

Let me know if you face other problems,

···

On Sat, Dec 26, 2015 at 6:50 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

+ Davide

On Sat, Dec 26, 2015 at 11:11 PM, Dan Mack via swift-users > <swift-users@swift.org> wrote:

Attempting to build swift from github from Dec 26th HEAD - after a few
adjustments I have gotton to this point where :

  [475/486] Linking CXX shared library
lib/swift/freebsd/x86_64/libswiftCore.so

  FAILED: : && /usr/local/bin/clang++36 -f .....

/usr/bin/ld:/sw/src/build/Ninja-DebugAssert/swift-freebsd-x86_64/./lib/swift/freebsd/x86_64/swift.ld:10:
syntax error

I put the whole paste in here if it is helpful:

--
Davide