交叉编译的go应用程序正在本机上运行。这怎么可能?

时间:2019-03-07 14:17:11

标签: go

我知道go在其二进制文件中没有多体系结构支持。我正在交叉编译go dbus应用程序,并且交叉编译的二进制文件仍在我的主机上运行。我正在运行debian测试。这可以是即将推出的功能吗?

$ go version
go version go1.11.5 linux/amd64

$:golang-godbus$ go build

$:golang-godbus$ file golang-godbus 
golang-godbus: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=rtpT-vZ73aaq-OWCmm29/BqcyUmwm1ybWYgaZEdN7/Ll0SYgA2TzwyWDpTcfmI/fZ-z5lzvDaDWOFC4XHw8, not stripped

$:golang-godbus$ GOOS=linux GOARCH=arm GOARM=7 go build

$:golang-godbus$ file golang-godbus 
golang-godbus: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=GgidUi9KoU1Ku-VzGDlJ/Lb9Rrl0prlg6BfmlJhvv/Lt1JZ03bbrg1XFqGdA1Q/VNKiL2-y3UnN_7F4P8IP, not stripped
$:golang-godbus$ ./golang-godbus 
Currently owned names on the session bus:
org.freedesktop.DBus
:1.15319
:1.7
org.freedesktop.login1
org.freedesktop.timesync1
:1.10601
:1.10603
org.freedesktop.systemd1
:1.11095
:1.10605
org.freedesktop.PolicyKit1
org.freedesktop.Avahi
org.freedesktop.ModemManager1
org.freedesktop.NetworkManager
:1.11
:1.241
org.freedesktop.UDisks2
org.freedesktop.network1
:1.7704
:1.233
fi.epitest.hostap.WPASupplicant
:1.4
fi.w1.wpa_supplicant1
:1.23524
:1.19
:1.6

0 个答案:

没有答案