Re: [go-nuts] How to Create Dynamically Linked Go Programs Redux

2023-08-12 Thread jlfo...@berkeley.edu
Believe me, it's not something I want to do. But, it's the only way that building a Go program with dynamic linking will work. Here's what I mean: % go build -linkshared file1.go internal/abi: go build internal/abi: copying /home/jonf/.cache/go-build/06/0628acf114fffa5bc27f637027df97345926fcd84f

Re: [go-nuts] How to Create Dynamically Linked Go Programs Redux

2023-08-12 Thread Ian Lance Taylor
On Sat, Aug 12, 2023 at 10:27 AM jlfo...@berkeley.edu wrote: > > Thanks. > > There's a more fundamental problem, though. Try running > > go build -linkshared hello.go > > as a non-privileged user. You'll get a bunch of permission denied messages. > (I had mentioned this > back in January). This i

Re: [go-nuts] How to Create Dynamically Linked Go Programs Redux

2023-08-12 Thread jlfo...@berkeley.edu
Thanks. There's a more fundamental problem, though. Try running go build -linkshared hello.go as a non-privileged user. You'll get a bunch of permission denied messages. (I had mentioned this back in January). This is why I'm fooling around running the compiler and linker manually. I suggest

Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-12 Thread Wojciech S. Czarnecki
Dnia 2023-08-08, o godz. 18:11:56 Bernd Fix napisał(a): > After switching from go1.20.7 to go1.21.0 one of my applications > compiles without warnings or errors, but fails at run-time with the > following panic when loading a plugin: IIRC release notes tools now are version aware, so likely yo

[go-nuts] Using msotly plain slog, but changing the log.Logger underneath?

2023-08-12 Thread Tobias Klausmann
Hi! So I have been looking at golang v1.21, and while I like the slog package in principle, it really annoys me that there is no way to get a new slog Logger *that I can specify the underlying log.Logger for*. It seems I have to implement a complete slog.Handler myself, which is six miles of co

Re: [go-nuts] Is there a good way to make binary files compiled on a high-version machine run on a low-version machine?

2023-08-12 Thread fliter
Because cgo is used, setting CGO_ENABLED=0 will cause problems, and may not compile successfully 在2023年8月11日星期五 UTC+8 16:11:53 写道: > Did you try: > > export CGO_ENABLED=0 > go build > > ? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. T

[go-nuts] Re: Is there a good way to make binary files compiled on a high-version machine run on a low-version machine?

2023-08-12 Thread fliter
Thanks. It is indeed a good solution to use containers 在2023年8月11日星期五 UTC+8 15:38:02 写道: > I use a docker container with a centos7 image and build my shared libs > there; > https://github.com/ITRS-Group/cordial/blob/4f119f7893c67b817baaad23ed75b1ba134bf9c2/Dockerfile#L35 > > (pls don't judge my