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/bind: XCode warning then build project with gomobile framework for non-64bit device #15519

Closed
ekrivenja opened this issue May 3, 2016 · 9 comments

Comments

@ekrivenja
Copy link

ekrivenja commented May 3, 2016

I am using

go version go1.6.2 darwin/amd64
gomobile version +c435d0b Wed Apr 27 17:00:39 2016 +0000 (android,ios); androidSDK=

My issue is minor and very related to fixed #12590, the crash is fixed, but warning is still there if I try to build my XCode project with gomobile framework, for device like iPad 2 (non-64 bit A5 chip on board)

The warning message:

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in main.init from /Users/... To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

The same build for iPad Pro (64bit A9X on board) is going without any warning.
My gomobile framework is built with default parameters gomobile bind -target=ios <package>

@ekrivenja ekrivenja changed the title x/tools/mobile: XCode warning then build project with gomobile framework for non-64bit device x/mobile/bind: XCode warning then build project with gomobile framework for non-64bit device May 3, 2016
@eliasnaur
Copy link
Contributor

Sounds like a duplicate of #12896 which was recently fixed. Could you please try Go tip and see if your issue is still present?

@ekrivenja
Copy link
Author

You are right, looks like CL https://golang.org/cl/22461 should fix this issue. I'll try Go tip, thank you.

@ekrivenja ekrivenja reopened this May 4, 2016
@ekrivenja
Copy link
Author

Sorry, but warning is still there. I tested on

go version devel +082881d Wed May 4 15:08:16 2016 +0000 darwin/amd64

@ekrivenja
Copy link
Author

The issue is with ARMv7 only, if I remove it from Valid Architectures list, any build (ARMv7s, ARM64) has no warning.

@bradfitz bradfitz added this to the Unreleased milestone May 4, 2016
@eliasnaur
Copy link
Contributor

Thank you, I've reproduced the issue. The Go c-archive tests seems to run as PIE now, so it seems gomobile is doing something that breaks PIC generation. I'm working on a fix.

@gopherbot
Copy link

CL https://golang.org/cl/22920 mentions this issue.

@ekrivenja
Copy link
Author

Yes, it is fixed in

go version devel +87a2ae1 Mon May 9 06:16:07 2016 +0000 darwin/amd64

Thank you, @eliasnaur

@wxiaoguang
Copy link

I am using "go version go1.7beta1 darwin/amd64" and gomobile "tip.

I still get the no_pic warning:
(null): PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in main.init from /..../NetConnMan(go.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

@eliasnaur
Copy link
Contributor

If you haven't already, please check if the golang.org/x/mobile/examples/bind example also produces the PIC warning. If not, the next step would be to figure out why the projects differ in behaviour. A minimal reproducer would allow us to fix this issue quicker.

@golang golang locked and limited conversation to collaborators Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants