• Elias Naur's avatar
    cmd/link/internal/ld: copy Mach-O platform version commands to go.o · 277609f8
    Elias Naur authored
    To build for watchOS and tvOS the Apple toolchain requires a Mach-O
    load command that matches the platform for all object files in a build.
    The go.o object file produced by the Go linker contains no such command.
    
    The loader commands are mutually exclusive so we need to pick the
    right one. Fortunately, cgo must be enabled for watchOS and tvOS to
    be useful, so we can copy the first loader command we find in the object
    files produced by the host compiler.
    
    Add a test that builds a small program for tvOS to test both this CL
    and the previous CL that added bitcode support.
    
    Updates #22395
    
    Change-Id: I7a47d19be9d80f0459dc358c600cddd9f236c444
    Reviewed-on: https://go-review.googlesource.com/c/go/+/168321
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
    277609f8
main.m 70 Bytes