Cross compiling swift 3.1.1 for arm fails on osx

arm

(Carl Peto) #1

Building on success building 3.1.1 source, I've tried cross compiling a version of swift for arm targets.

I'm using this command in the swift source directory on macOS. I've successfully compiled the source to an x86 standard host compiler and stdlib. Now I'm trying to build it to an arm cross compiler/stdlib.

Here's the command I'm using...

utils/build-script -R --cross-compile-hosts linux-armv6 --clean --reconfigure

... it fails after some time, src/libcmark.a builds fine, as does bin/obj2yaml.

It seems to be failing here...
Building the standard library for: swift-test-stdlib-linux-armv6
cmark: using gold linker

...

  • /usr/local/bin/cmake --build /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/cmark-linux-armv6 -- -j8 all
    [57/66] Linking C executable src/cmark
    FAILED: src/cmark
    : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Wall -Wextra -std=c99 -pedantic -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names -fuse-ld=gold src/CMakeFiles/cmark.dir/cmark.c.o src/CMakeFiles/cmark.dir/node.c.o src/CMakeFiles/cmark.dir/iterator.c.o src/CMakeFiles/cmark.dir/blocks.c.o src/CMakeFiles/cmark.dir/inlines.c.o src/CMakeFiles/cmark.dir/scanners.c.o src/CMakeFiles/cmark.dir/utf8.c.o src/CMakeFiles/cmark.dir/buffer.c.o src/CMakeFiles/cmark.dir/references.c.o src/CMakeFiles/cmark.dir/render.c.o src/CMakeFiles/cmark.dir/man.c.o src/CMakeFiles/cmark.dir/xml.c.o src/CMakeFiles/cmark.dir/html.c.o src/CMakeFiles/cmark.dir/commonmark.c.o src/CMakeFiles/cmark.dir/latex.c.o src/CMakeFiles/cmark.dir/houdini_href_e.c.o src/CMakeFiles/cmark.dir/houdini_html_e.c.o src/CMakeFiles/cmark.dir/houdini_html_u.c.o src/CMakeFiles/cmark.dir/cmark_ctype.c.o src/CMakeFiles/cmark.dir/main.c.o -o src/cmark && :
    clang: error: invalid linker name in argument '-fuse-ld=gold'
    [59/66] Building C object src/CMakeFiles/libcmark_static.dir/scanners.c.o
    ninja: build stopped: subcommand failed.
    utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

Can anyone give any suggestions? (Using Xcode 8.3.3)