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

cmd/go: Go builds C archives with absolute addressing on darwin/arm #12681

Closed
swisspol opened this issue Sep 18, 2015 · 5 comments
Closed

cmd/go: Go builds C archives with absolute addressing on darwin/arm #12681

swisspol opened this issue Sep 18, 2015 · 5 comments
Milestone

Comments

@swisspol
Copy link

Go 1.5.1 on OS X 10.10.5 with Xcode 7

It appears Go builds c archives with absolute addressing, which makes Xcode unhappy when using the resulting static library in a project:

(null): PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in __cgoexp_45a75e65c81e_Test from build/iphoneos/main.a(go.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

I made a sample test project here: https://github.com/swisspol/Go-Bridge

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 19, 2015
@ianlancetaylor ianlancetaylor changed the title Go builds c archives with absolute addressing on OS X cmd/go: Go builds c archives with absolute addressing on OS X Sep 19, 2015
@albertjin
Copy link

I think it is the same issue for iOS built by gomobile.

@rakyll
Copy link
Contributor

rakyll commented Sep 21, 2015

This has been recently fixed via #12590, will be available in Go 1.6.

@rakyll rakyll closed this as completed Sep 21, 2015
@crawshaw
Copy link
Member

Hi @swisspol, I'm sorry I missed this issue. It is not the same as #12590. It is however closely related to #12896. I have a fix, but won't have access to the appropriate hardware to test it until tomorrow.

@crawshaw crawshaw reopened this Oct 15, 2015
@rsc
Copy link
Contributor

rsc commented Nov 5, 2015

ping @crawshaw

@rsc rsc changed the title cmd/go: Go builds c archives with absolute addressing on OS X cmd/go: Go builds C archives with absolute addressing on darwin/arm64 Nov 5, 2015
@crawshaw crawshaw changed the title cmd/go: Go builds C archives with absolute addressing on darwin/arm64 cmd/go: Go builds C archives with absolute addressing on darwin/arm Nov 5, 2015
@crawshaw
Copy link
Member

crawshaw commented Nov 5, 2015

To consolidate these, I'm marking this a duplicate of #12896.

darwin/arm64 is all PIC.
darwin/arm still has absolute text relocations, and probably will in 1.6

(I haven't managed to convince ld64 to make PC-relative relocations to .bss work.)

@crawshaw crawshaw closed this as completed Nov 5, 2015
@golang golang locked and limited conversation to collaborators Nov 4, 2016
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

7 participants