]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ld: remove flags incompatible with -fembed-bitcode
authorElias Naur <mail@eliasnaur.com>
Wed, 16 Oct 2019 08:20:12 +0000 (10:20 +0200)
committerElias Naur <mail@eliasnaur.com>
Wed, 30 Oct 2019 08:17:29 +0000 (08:17 +0000)
commitf4e32aeed18dadb077dc5458b03a812234390046
tree422cc8b33541b1b5ba89edf816b7dffa4f8a1086
parent01e7a152e353644caf26c741bc64f4ef6580752e
cmd/link/internal/ld: remove flags incompatible with -fembed-bitcode

The flags -headerpad, -Wl,-no_pie and -pagezero_size are incompatible with
the -fembed-bitcode flag used by `gomobile build`. Than McIntosh
suggested we might not need the offending flags; this change removes
the flags on darwin/arm64 and -headerpad, -pagezero_size on darwin/arm.

The -Wl,-no_pie flag is left for darwin/arm because linking fails
without it:

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _runtime.rodata from /var/folders/qq/qxn86k813bn9fjxydm095rxw0000gp/T/workdir-host-darwin-amd64-zenly-ios/tmp/go-link-225285265/go.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

Discussion: https://groups.google.com/d/msg/golang-dev/U1jK3xmmGAk/j0_ty46EDAAJ

I've verified the CL on the builders, built the "flappy" example from
gomobile with `gomobile build`, and verified that flappy runs on an
iPhone 5S.

Updates #32963

Change-Id: I783abc93ccf3c1d2b7ca00144b7164ba223d3529
Reviewed-on: https://go-review.googlesource.com/c/go/+/201358
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/lib.go