Document supported platforms and status of project (#168)
Closes #149
- commit
- 1600172341f646ce7d94540886a87e52e5fe6f94
- author
- TotallyGamerJet · · 2023-09-23 15:38 UTC
- committer
- GitHub · · 2023-09-23 15:38 UTC
- parent
- 6aa09b6
- signature
- GPG Unverified
4AEE18F83AFDEB23The key is unknown - refs
- tag: v0.6.0-alpha.1
1 file · +20 -1
M README.md +20 -1
| @@ -3,6 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | 4 | A library for calling C functions from Go without Cgo. | |
| 5 | 5 | ||
| 6 | + | > This is beta software so expect bugs and potentially API breaking changes | |
| 7 | + | > but each release will be tagged to avoid breaking people's code. | |
| 8 | + | > Bug reports are encouraged. | |
| 9 | + | ||
| 6 | 10 | ## Motivation | |
| 7 | 11 | ||
| 8 | 12 | The [Ebitengine](https://github.com/hajimehoshi/ebiten) game engine was ported to use only Go on Windows. This enabled | |
| @@ -17,6 +21,15 @@ born to bring that same vision to the other platforms supported by Ebitengine. | |||
| 17 | 21 | - **Dynamic Linking**: Load symbols at runtime and use it as a plugin system. | |
| 18 | 22 | - **Foreign Function Interface**: Call into other languages that are compiled into shared objects. | |
| 19 | 23 | ||
| 24 | + | ## Supported Platforms | |
| 25 | + | ||
| 26 | + | - **FreeBSD**: amd64, arm64 | |
| 27 | + | - **Linux**: amd64, arm64 | |
| 28 | + | - **macOS / iOS**: amd64, arm64 | |
| 29 | + | - **Windows**: 386*, amd64, arm*, arm64 | |
| 30 | + | ||
| 31 | + | `*` These architectures only support SyscallN and NewCallback | |
| 32 | + | ||
| 20 | 33 | ## Example | |
| 21 | 34 | ||
| 22 | 35 | This example only works on macOS and Linux. For a complete example look at [libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | |
| @@ -55,6 +68,11 @@ func main() { | |||
| 55 | 68 | ||
| 56 | 69 | Then to run: `CGO_ENABLED=0 go run main.go` | |
| 57 | 70 | ||
| 71 | + | ## Questions | |
| 72 | + | ||
| 73 | + | If you have questions about how to incorporate purego in your project or want to discuss | |
| 74 | + | how it works join the [Discord](https://discord.com/channels/842049801528016967/1123106378731487345)! | |
| 75 | + | ||
| 58 | 76 | ### External Code | |
| 59 | 77 | ||
| 60 | 78 | Purego uses code that originates from the Go runtime. These files are under the BSD-3 | |
| @@ -71,4 +89,5 @@ This is a list of the copied files: | |||
| 71 | 89 | * `internal/fakecgo/setenv.go` from package `runtime/cgo` | |
| 72 | 90 | * `internal/fakecgo/freebsd.go` from package `runtime/cgo` | |
| 73 | 91 | ||
| 74 | - | The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of `#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636)) | |
| 92 | + | The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of | |
| 93 | + | `#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636)) | |
| @@ -3,6 +3,10 @@ | |||||
| 3 | 3 | ||||
| 4 | A library for calling C functions from Go without Cgo. | 4 | A library for calling C functions from Go without Cgo. | ||
| 5 | 5 | ||||
| 6 | + | > This is beta software so expect bugs and potentially API breaking changes | |||
| 7 | + | > but each release will be tagged to avoid breaking people's code. | |||
| 8 | + | > Bug reports are encouraged. | |||
| 9 | + | ||||
| 6 | ## Motivation | 10 | ## Motivation | ||
| 7 | 11 | ||||
| 8 | The [Ebitengine](https://github.com/hajimehoshi/ebiten) game engine was ported to use only Go on Windows. This enabled | 12 | The [Ebitengine](https://github.com/hajimehoshi/ebiten) game engine was ported to use only Go on Windows. This enabled | ||
| @@ -17,6 +21,15 @@ born to bring that same vision to the other platforms supported by Ebitengine. | |||||
| 17 | - **Dynamic Linking**: Load symbols at runtime and use it as a plugin system. | 21 | - **Dynamic Linking**: Load symbols at runtime and use it as a plugin system. | ||
| 18 | - **Foreign Function Interface**: Call into other languages that are compiled into shared objects. | 22 | - **Foreign Function Interface**: Call into other languages that are compiled into shared objects. | ||
| 19 | 23 | ||||
| 24 | + | ## Supported Platforms | |||
| 25 | + | ||||
| 26 | + | - **FreeBSD**: amd64, arm64 | |||
| 27 | + | - **Linux**: amd64, arm64 | |||
| 28 | + | - **macOS / iOS**: amd64, arm64 | |||
| 29 | + | - **Windows**: 386*, amd64, arm*, arm64 | |||
| 30 | + | ||||
| 31 | + | `*` These architectures only support SyscallN and NewCallback | |||
| 32 | + | ||||
| 20 | ## Example | 33 | ## Example | ||
| 21 | 34 | ||||
| 22 | This example only works on macOS and Linux. For a complete example look at [libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | 35 | This example only works on macOS and Linux. For a complete example look at [libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | ||
| @@ -55,6 +68,11 @@ func main() { | |||||
| 55 | 68 | ||||
| 56 | Then to run: `CGO_ENABLED=0 go run main.go` | 69 | Then to run: `CGO_ENABLED=0 go run main.go` | ||
| 57 | 70 | ||||
| 71 | + | ## Questions | |||
| 72 | + | ||||
| 73 | + | If you have questions about how to incorporate purego in your project or want to discuss | |||
| 74 | + | how it works join the [Discord](https://discord.com/channels/842049801528016967/1123106378731487345)! | |||
| 75 | + | ||||
| 58 | ### External Code | 76 | ### External Code | ||
| 59 | 77 | ||||
| 60 | Purego uses code that originates from the Go runtime. These files are under the BSD-3 | 78 | Purego uses code that originates from the Go runtime. These files are under the BSD-3 | ||
| @@ -71,4 +89,5 @@ This is a list of the copied files: | |||||
| 71 | * `internal/fakecgo/setenv.go` from package `runtime/cgo` | 89 | * `internal/fakecgo/setenv.go` from package `runtime/cgo` | ||
| 72 | * `internal/fakecgo/freebsd.go` from package `runtime/cgo` | 90 | * `internal/fakecgo/freebsd.go` from package `runtime/cgo` | ||
| 73 | 91 | ||||
| 74 | - | The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of `#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636)) | 92 | + | The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of |
| 93 | + | `#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636)) | |||