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

希望能直接增加ppc32的支持,目前都是ppc64 或ppc64le的,如下更改ppc32编译成功,使用gccgo #599

Closed
sdpong opened this issue Jan 14, 2018 · 3 comments

Comments

@sdpong
Copy link

sdpong commented Jan 14, 2018

因google 的go语言本身不支持PPC32的芯片,所以在ppc32 上使用gcc-go编译成功,主要为老工控机使用,哈哈!!!目前运营正常!

建立zsys_linux_ppc.go 在$GOPATH/src/github.com/golang/net/internal/socket/下,内容
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_linux.go

package socket

const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_INET6 = 0xa

sysSOCK_RAW = 0x3

)

type iovec struct {
Base *byte
Len uint32
}

type msghdr struct {
Name *byte
Namelen uint32
Pad_cgo_0 [4]byte
Iov *iovec
Iovlen uint32
Control *byte
Controllen uint32
Flags int32
Pad_cgo_1 [4]byte
}

type mmsghdr struct {
Hdr msghdr
Len uint32
Pad_cgo_0 [4]byte
}

type cmsghdr struct {
Len uint32
Level int32
Type int32
}

type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}

type sockaddrInet6 struct {
Family uint16
Port uint16
Flowinfo uint32
Addr [16]byte /* in6_addr */
Scope_id uint32
}

const (
sizeofIovec = 0x10
sizeofMsghdr = 0x38
sizeofMmsghdr = 0x40
sizeofCmsghdr = 0x10

sizeofSockaddrInet  = 0x10
sizeofSockaddrInet6 = 0x1c

)

建立sys_linux_ppc.go 在$GOPATH/src/github.com/golang/net/internal/socket/下,内容

// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package socket

const (
sysRECVMMSG = 0x157
sysSENDMMSG = 0x15d
)

修改msghdr_linux_32bit.go 在$GOPATH/src/github.com/golang/net/internal/socket/下 +build 增加 ppc
修改iovec_32bit.go 在$GOPATH/src/github.com/golang/net/internal/socket/下 +build 增加ppc
修改cmsghdr_linux_32bit.go 在$GOPATH/src/github.com/golang/net/internal/socket/下 +build 增加ppc

@sdpong
Copy link
Author

sdpong commented Jan 14, 2018

根据google项目“inferno-os-inferno-os-62ae0f75aa71” ppc更改,这样家里有wd mylive book版本可以使用frp了....比ngrok更牛了点。
by sdpong,qq:642362907----soft破解

@fatedier
Copy link
Owner

考虑过多的设备环境过于复杂了,而且有一些小众的需求,可以不作为通用方案,把你的修改和编译过程文档化,让有需要的人能够搜索到即可。

@justlikeafaker
Copy link

根据google项目“inferno-os-inferno-os-62ae0f75aa71” ppc更改,这样家里有wd mylive book版本可以使用frp了....比ngrok更牛了点。
by sdpong,qq:642362907----soft破解

请问能分享下你编译的frp for ppc吗 我也有一台mbl但是不会编译,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants