Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: gomobile bind producing iOS frameworks without PIE compatibility? #25124

Closed
matti777 opened this issue Apr 27, 2018 · 4 comments
Closed
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@matti777
Copy link

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/matti/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/matti/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jw/jrh0fgfn42ndjty5zpbsv8p00000gn/T/go-build759436971=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I built a Cocoapod using the gomobile bind -generated framework and when lint:ing it, it will get built for all platforms.

What did you expect to see?

Expected to see no linker errors.

What did you see instead?

I get the following warning:

- NOTE | [iOS] [FooBarSDK/Go] xcodebuild: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in sync/atomic.(*Value).Store from /Users/matti/src/foobar-sdk-ios/Frameworks/Client.framework/Client(go.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

There was also a linker error about this, but I got around suppressing that. This however cannot be the final solution as Apple probably will not like the non-PIE binary - but then, it would appear the problem might only exist for arch=i386.

I wrote to SO about the issue: https://stackoverflow.com/questions/50024087/gomobile-bind-producing-library-with-pie-disabled-i386-arch/50038396#50038396

@gopherbot gopherbot added this to the Unreleased milestone Apr 27, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 27, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 27, 2018

(CC: @eliasnaur)

@bcmills
Copy link
Contributor

bcmills commented Apr 27, 2018

I built a Cocoapod using the gomobile bind -generated framework and when lint:ing it, it will get built for all platforms.

Please provide more specific steps to reproduce the problem: exact commands, and links to repos if possible. (Ideally, it should be possible for someone reading this bug to obtain the same error using your steps; otherwise, how will they know if a candidate fix actually works?)

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 27, 2018
@eliasnaur
Copy link
Contributor

Perhaps we should disable binding for 386. Can you reproduce the problem with gomobile bind -target=ios/arm,ios/arm64,ios/amd64 <pkg> ?

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators May 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants