libddwaf | purego | |
---|---|---|
1 | 24 | |
34 | 2,305 | |
- | 2.2% | |
8.6 | 7.9 | |
10 days ago | about 2 months ago | |
C++ | Go | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
libddwaf
-
Go 1.21 will (likely) have a static toolchain on Linux
Even in C there can be issues. the nokigiri ruby gem builds (or used to build) libxml and libxslt (which are pure C) and has to make effort remove a couple of GNUisms.
For C++ we were faced with some issues, so the process we ended up with is:
- build musl, install it in some location
- inject a few GCC libs and linux headers required for C runtime to have the above location be a proper sysroot for clang to use
- build LLVM libc++ and a few libs (e.g libunwind) as static libs against that sysroot using clang, and inject them into the sysroot
- build whatever C++ final product we want against the sysroot using clang, statically linking libc++ in
- for a dynamic lib, remove dynamic reference to some shared libs (can't recall if it's libc.so or ld.so). also, hide all symbols from libc++ and load with bind local so that when loaded the shared lib prefers its internal symbols (which would make it crash if it jumps to another libc++) and does not pollute the symbol namespace with its internal ones (which would make another lib crash if it jumps to the internal libc++)
- for an executable binary instead of a lib, dynamic reference would instead need to be altered so that it works for both
It all hinges on musl being a subset of glibc, which is not entirely true either (see the musl website for differences in behaviour, which may or may not matter depending on the piece of software)
https://github.com/DataDog/libddwaf/blob/c6a90d39d93f04ebb5e...
purego
- Tk9.0: CGo-free, cross platform GUI toolkit for Go
-
Go is my hammer, and everything is a nail
https://ebitengine.org/en/documents/install.html
For anything other than windows:
> Installing a C compiler
> A C compiler is required as Ebitengine uses not only Go but also C.
I mean, even on platforms without cgo, it's it working magically?
No; it's using https://github.com/ebitengine/purego, which is:
> A library for calling C functions from Go without Cgo.
Like... I mean.... okaaaay, it's not cgo, but it's basically cgo? ...but it's no cgo so you can say 'no cgo' on your banner page?
Seems kind of like... this is maybe not the right hammer for gamedev.
-
How I build simple Mac apps using Go
The other big thing we're working towards is making DarwinKit not use CGO at all! Using purego, we can call into Apple frameworks without involving CGO. This will improve build time, make smaller binaries, and allow DarwinKit to be used in programs that need to avoid CGO for whatever reason.
- Show HN: Sqinn-Go is a Golang library for accessing SQLite databases in pure Go
-
Netgate upstreams FreeBSD support to the purego project
Click here to view the commit: https://github.com/ebitengine/purego/commit/1a4ea678b5a7598275a28e787179da1b7a058b11
Click here to view the commit: https://github.com/ebitengine/purego/commit/1a4ea678b5a7598275a28e787179da1b7a058b11
-
SIMD in Go
Maybe interesting for you: https://github.com/ebitengine/purego
-
Ideas for GUI libraries?
most X11 functionality can be accessed via xgb|xgbutil (jezek has a current fork). nucular makes use of it via shiny. OpenGL and such libraries can be assumed to exist on those systems, so directly calling those c libraries without cgo is a possibility. Ebiten is currently working on it: purego.
- Go 1.21 will (likely) have a static toolchain on Linux
-
The Simplicity of Single-File Golang Deployments
In the malware reverse engineering scene, there are a lot of forks of the upstream "debug" go library, because it allows loading, parsing, compiling and executing libraries from disk (rather than in-kernel or in-userspace).
And there's also "purego" as an implementation that directly generates shellcode.
Maybe those will help you, too?
I am just mentioning these because for my use cases those approaches worked perfectly, CGO free.
[1] https://github.com/Binject/debug
[2] https://github.com/ebitengine/purego
What are some alternatives?
sokol-tools - Command line tools for use with sokol headers
nocgo - dlopen in go without cgo
gcc-static-linking
gamen - Cross-platform GUI window creation & management library in Go
wazero - wazero: the zero dependency WebAssembly runtime for Go developers
barcode-server - A simple daemon to expose USB Barcode Scanner data to other services using Websockets, Webhooks or MQTT.
go - The Go programming language
rust-plus-golang - Rust + Go — Call Rust code from Go using FFI
evcxr
iup-go - Cross-platform UI library with native controls
go-simd - SIMD implementation in Go
go-plugin - Golang plugin system over RPC.