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

Closed
opened 2026-05-05 12:18:11 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @sdpong on GitHub (Jan 14, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/599

因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

Originally created by @sdpong on GitHub (Jan 14, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/599 因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
Author
Owner

@sdpong commented on GitHub (Jan 14, 2018):

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

<!-- gh-comment-id:357509757 --> @sdpong commented on GitHub (Jan 14, 2018): 根据google项目“inferno-os-inferno-os-62ae0f75aa71” ppc更改,这样家里有wd mylive book版本可以使用frp了....比ngrok更牛了点。 by sdpong,qq:642362907----soft破解
Author
Owner

@fatedier commented on GitHub (Jan 17, 2018):

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

<!-- gh-comment-id:358338620 --> @fatedier commented on GitHub (Jan 17, 2018): 考虑过多的设备环境过于复杂了,而且有一些小众的需求,可以不作为通用方案,把你的修改和编译过程文档化,让有需要的人能够搜索到即可。
Author
Owner

@justlikeafaker commented on GitHub (Feb 15, 2020):

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

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

<!-- gh-comment-id:586549986 --> @justlikeafaker commented on GitHub (Feb 15, 2020): > 根据google项目“inferno-os-inferno-os-62ae0f75aa71” ppc更改,这样家里有wd mylive book版本可以使用frp了....比ngrok更牛了点。 > by sdpong,qq:642362907----soft破解 请问能分享下你编译的frp for ppc吗 我也有一台mbl但是不会编译,谢谢
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#468
No description provided.