You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
$ uname -a
Linux host7 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux
$ cat test.go
package main
import (
"fmt""net/http"
)
func main() {
fmt.Println(http.ListenAndServe)
}
$ go version
go version go1.20.5 linux/amd64
$ go build -o test test.go
$ ./test
0x60f7a0
Then copy this built binary test to a Debian 11 system and run:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
uname -a
Linux debian 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux
$ ./test
./test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./test)./test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./test)
What did you expect to see?
Run test program without issue and print out the address of http.ListenAndServe.
What did you see instead?
./test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./test)
./test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./test)
The text was updated successfully, but these errors were encountered:
I also tried copy this test binary to CentOS Stream release 8, got the same issue.
marjune163
changed the title
affected/package: net/http compiled binary on Debian 12(bookworm) cannot run on Debian 11(bullseye)
net/http: compiled binary on Debian 12(bookworm) cannot run on Debian 11(bullseye)
Jun 22, 2023
This is working as intended. By default Go links with C. Older versions of Debian (and Glibc) typically don't support binaries linked against newer versions.
It should work if you avoid the C dependency with CGO_ENABLED=0 go build.
Go+CGO binaries should always be linked against the oldest platform you intend to support since later versions are typically backwards compatible.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
$ uname -a Linux host7 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux
Then copy this built binary
test
to a Debian 11 system and run:uname -a Linux debian 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux
What did you expect to see?
Run test program without issue and print out the address of
http.ListenAndServe
.What did you see instead?
The text was updated successfully, but these errors were encountered: