Conversation
|
Arf.. here we go again with pre-releases and the odd version format; |
f04ee72 to
6edf610
Compare
|
Interesting; two failures: a panic in golang-ci-lint; One in cross/linux/armv5 (so 32-bit cross-compile); |
|
I noticed we were still on golangci-lint v1.54, so opened a PR to update to v1.55 (in case that fixes the panic); #47016 |
6edf610 to
16aae49
Compare
|
Ah; the good news; golangci-lint panic seems to be fixed. The bad news; looks like Windows is pretty much broken; That codepath seems to be hit by moby/vendor/github.com/Microsoft/go-winio/fileinfo.go Lines 21 to 34 in 7ad5396 And used by hcsshim; git grep '\.SetFileBasicInfo'
vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go: return winio.SetFileBasicInfo(f, &sbi)
vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayerwriter.go: err = winio.SetFileBasicInfo(f, &di.fileInfo)
vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayerwriter.go: err = winio.SetFileBasicInfo(f, fileInfo)
vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go: err = winio.SetFileBasicInfo(dest, fileInfo)
vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go: err = winio.SetFileBasicInfo(f, fileInfo)
vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go: err = winio.SetFileBasicInfo(f, &strippedFi) |
|
Friends at Microsoft are looking into this; tracking issue on their Go fork is here; |
16aae49 to
9760753
Compare
|
Looks like it's am in go-winio after all, and an alignment issue; |
|
The go-winio fix is merged: microsoft/go-winio#312, |
9760753 to
92610e1
Compare
|
Thanks! I rebased, and updated go-winio to current master to see if CI is happier 🤞 |
|
CI looks a lot happier now! The only failure is cross-compile for That appears seems to come from CLANG; https://github.com/c2lang/c2compiler/blob/82a0cc5a79860cba8555cd6ee95d278f34a8ecce/c2c/Clang/DiagnosticSemaKinds.inc#L2764 And that message also mentions "alignment", so now wondering if things are related to the issue we saw on Windows :thinking_face: A quick search also gave me some code-bases having exceptions for this; https://github.com/kokkos/kokkos/blob/71a9bcae52543bd065522bf3e41b5bfa467d8015/tpls/desul/include/desul/atomics/Compare_Exchange_GCC.hpp#L33-L41 |
I checked for changes from go1.21.5 -> go1.22rc1, and all the lines with these warnings are actually new to 1.22: golang/go@b104a0e, golang/go#60961. I don't know off the top of my head if ignoring the warnings is something that can be done in the code here, or whether that would mask some actually-bad effect here. (Worse startup time, if anything?) Seems worth raising upstream. |
Only clang is affected; cross-compiling with gcc works fine. |
|
Thanks Cory! I'll do a rebase of this one, and update to rc2 as well. |
92610e1 to
069fd94
Compare
069fd94 to
56836e1
Compare
|
updated to go1.22.1 we don't have a tagged go-winio release with the patch yet though |
56836e1 to
9ab7d0e
Compare
9ab7d0e to
dff9a37
Compare
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Cory Snider <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
(cherry picked from commit 4cd5c2b)
Signed-off-by: Austin Vazquez <[email protected]>
cross-compiling for arm/v5 was failing;
moby#56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced 2 more times
moby#56 84.12
moby#56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
moby#56 84.12 >>> referenced by gcc_libinit.c
moby#56 84.12 >>> /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
moby#56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)
From discussion on GitHub;
moby#46982 (comment)
The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.
In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.
While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.
Co-authored-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Cory Snider <[email protected]>
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)