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: unable to upload ios app: "Invalid Segment Alignment" #22402

Closed
gazed opened this issue Oct 23, 2017 · 4 comments
Closed

x/mobile: unable to upload ios app: "Invalid Segment Alignment" #22402

gazed opened this issue Oct 23, 2017 · 4 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Milestone

Comments

@gazed
Copy link

gazed commented Oct 23, 2017

Please answer these questions before submitting your issue. Thanks!

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

go1.9.1 xcode 9.0.1 macos 10.13

Does this issue reproduce with the latest release?

Yes. Tip 006bc57 as well.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/rust/code/ghub"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_d/8n_wrc4n32d1rgx80bn6hsl80000gn/T/go-build104616041=/tmp/go-build -gno-record-gcc-switches -fno-common"
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"

What did you do?

Built and packaged an app for ios that would not pass validation.
See: https://groups.google.com/forum/#!topic/golang-nuts/DaCOnoSWvBw

Fixed the problem using the following change on go master 006bc57 :

diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index bd3abbba0a..45642e8ad7 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1105,7 +1105,7 @@ func (ctxt *Link) hostlink() {
        switch ctxt.BuildMode {
        case BuildModeExe:
                if ctxt.HeadType == objabi.Hdarwin {
-                       argv = append(argv, "-Wl,-pagezero_size,4000000")
+                       argv = append(argv, "-Wl,-pagezero_size,100000000")
                }
        case BuildModePIE:
                // ELF.
-

Note: this is a difficult issue to reproduce since it requires an apple developer account.
Refer to github.com/gazed/bios, a project created specifically to test this issue.

@gopherbot
Copy link

Change https://golang.org/cl/72730 mentions this issue: cmd/link/internal/ld: iOS iTunes upload fix.

@gazed
Copy link
Author

gazed commented Oct 23, 2017

Proposed change.
https://go-review.googlesource.com/#/c/go/+/72730 cmd/link/internal/ld: iOS iTunes upload fix.

@gbbr gbbr changed the title Unable to upload ios app: "Invalid Segment Alignment" x/mobile: unable to upload ios app: "Invalid Segment Alignment" Oct 24, 2017
@gopherbot gopherbot added this to the Unreleased milestone Oct 24, 2017
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Oct 24, 2017
@gazed
Copy link
Author

gazed commented Oct 24, 2017

Unsure of the meaning of the mobile tag. It needs to be clear that the problem affects code that has nothing to do with x/mobile. See github.com/gazed/bios.

@eliasnaur
Copy link
Contributor

The mobile tag is for everything related to darwin/arm* and android, not just the x/mobile repository.

@golang golang locked and limited conversation to collaborators Oct 24, 2018
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
Projects
None yet
Development

No branches or pull requests

3 participants