/usr/local/go/pkg/tool/linux_arm/link: running gcc failed: exit status 1

62 views
Skip to first unread message

Stephan Lukits

unread,
Nov 1, 2024, 2:08:18 PMNov 1
to golang-nuts
from my research I found it could be helpful to exectue gcc with the `--mfloat-abi=hard` option; but I couldn't figure how to inject that option?

```
~/go/src/hellogio $ go build .
# example.con/rpi3/hellogio
/usr/local/go/pkg/tool/linux_arm/link: running gcc failed: exit status 1
/usr/bin/gcc -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Wl,--export-dynamic-symbol=gio_onDataDeviceDrop -Wl,--export-dynamic-symbol=gio_onDataDeviceEnter -Wl,--export-dynamic-symbol=gio_onDataDeviceLeave -Wl,--export-dynamic-symbol=gio_onDataDeviceMotion -Wl,--export-dynamic-symbol=gio_onDataDeviceOffer -Wl,--export-dynamic-symbol=gio_onDataDeviceSelection -Wl,--export-dynamic-symbol=gio_onDataOfferAction -Wl,--export-dynamic-symbol=gio_onDataOfferOffer -Wl,--export-dynamic-symbol=gio_onDataOfferSourceActions -Wl,--export-dynamic-symbol=gio_onDataSourceAction -Wl,--export-dynamic-symbol=gio_onDataSourceCancelled -Wl,--export-dynamic-symbol=gio_onDataSourceDNDDropPerformed -Wl,--export-dynamic-symbol=gio_onDataSourceDNDFinished -Wl,--export-dynamic-symbol=gio_onDataSourceSend -Wl,--export-dynamic-symbol=gio_onDataSourceTarget -Wl,--export-dynamic-symbol=gio_onFrameDone -Wl,--export-dynamic-symbol=gio_onKeyboardEnter -Wl,--export-dynamic-symbol=gio_onKeyboardKey -Wl,--export-dynamic-symbol=gio_onKeyboardKeymap -Wl,--export-dynamic-symbol=gio_onKeyboardLeave -Wl,--export-dynamic-symbol=gio_onKeyboardModifiers -Wl,--export-dynamic-symbol=gio_onKeyboardRepeatInfo -Wl,--export-dynamic-symbol=gio_onOutputDone -Wl,--export-dynamic-symbol=gio_onOutputGeometry -Wl,--export-dynamic-symbol=gio_onOutputMode -Wl,--export-dynamic-symbol=gio_onOutputScale -Wl,--export-dynamic-symbol=gio_onPointerAxis -Wl,--export-dynamic-symbol=gio_onPointerAxisDiscrete -Wl,--export-dynamic-symbol=gio_onPointerAxisSource -Wl,--export-dynamic-symbol=gio_onPointerAxisStop -Wl,--export-dynamic-symbol=gio_onPointerButton -Wl,--export-dynamic-symbol=gio_onPointerEnter -Wl,--export-dynamic-symbol=gio_onPointerFrame -Wl,--export-dynamic-symbol=gio_onPointerLeave -Wl,--export-dynamic-symbol=gio_onPointerMotion -Wl,--export-dynamic-symbol=gio_onRegistryGlobal -Wl,--export-dynamic-symbol=gio_onRegistryGlobalRemove -Wl,--export-dynamic-symbol=gio_onSeatCapabilities -Wl,--export-dynamic-symbol=gio_onSeatName -Wl,--export-dynamic-symbol=gio_onSurfaceEnter -Wl,--export-dynamic-symbol=gio_onSurfaceLeave -Wl,--export-dynamic-symbol=gio_onTextInputCommitString -Wl,--export-dynamic-symbol=gio_onTextInputDeleteSurroundingText -Wl,--export-dynamic-symbol=gio_onTextInputDone -Wl,--export-dynamic-symbol=gio_onTextInputEnter -Wl,--export-dynamic-symbol=gio_onTextInputLeave -Wl,--export-dynamic-symbol=gio_onTextInputPreeditString -Wl,--export-dynamic-symbol=gio_onToplevelClose -Wl,--export-dynamic-symbol=gio_onToplevelConfigure -Wl,--export-dynamic-symbol=gio_onToplevelDecorationConfigure -Wl,--export-dynamic-symbol=gio_onTouchCancel -Wl,--export-dynamic-symbol=gio_onTouchDown -Wl,--export-dynamic-symbol=gio_onTouchFrame -Wl,--export-dynamic-symbol=gio_onTouchMotion -Wl,--export-dynamic-symbol=gio_onTouchUp -Wl,--export-dynamic-symbol=gio_onXdgSurfaceConfigure -Wl,--compress-debug-sections=zlib /tmp/go-link-3397411914/go.o /tmp/go-link-3397411914/000000.o /tmp/go-link-3397411914/000001.o /tmp/go-link-3397411914/000002.o /tmp/go-link-3397411914/000003.o /tmp/go-link-3397411914/000004.o /tmp/go-link-3397411914/000005.o /tmp/go-link-3397411914/000006.o /tmp/go-link-3397411914/000007.o /tmp/go-link-3397411914/000008.o /tmp/go-link-3397411914/000009.o /tmp/go-link-3397411914/000010.o /tmp/go-link-3397411914/000011.o /tmp/go-link-3397411914/000012.o /tmp/go-link-3397411914/000013.o /tmp/go-link-3397411914/000014.o /tmp/go-link-3397411914/000015.o /tmp/go-link-3397411914/000016.o /tmp/go-link-3397411914/000017.o /tmp/go-link-3397411914/000018.o /tmp/go-link-3397411914/000019.o /tmp/go-link-3397411914/000020.o /tmp/go-link-3397411914/000021.o /tmp/go-link-3397411914/000022.o /tmp/go-link-3397411914/000023.o /tmp/go-link-3397411914/000024.o /tmp/go-link-3397411914/000025.o /tmp/go-link-3397411914/000026.o /tmp/go-link-3397411914/000027.o /tmp/go-link-3397411914/000028.o /tmp/go-link-3397411914/000029.o /tmp/go-link-3397411914/000030.o /tmp/go-link-3397411914/000031.o /tmp/go-link-3397411914/000032.o /tmp/go-link-3397411914/000033.o /tmp/go-link-3397411914/000034.o /tmp/go-link-3397411914/000035.o /tmp/go-link-3397411914/000036.o /tmp/go-link-3397411914/000037.o /tmp/go-link-3397411914/000038.o /tmp/go-link-3397411914/000039.o /tmp/go-link-3397411914/000040.o /tmp/go-link-3397411914/000041.o /tmp/go-link-3397411914/000042.o /tmp/go-link-3397411914/000043.o /tmp/go-link-3397411914/000044.o /tmp/go-link-3397411914/000045.o /tmp/go-link-3397411914/000046.o /tmp/go-link-3397411914/000047.o /tmp/go-link-3397411914/000048.o /tmp/go-link-3397411914/000049.o /tmp/go-link-3397411914/000050.o /tmp/go-link-3397411914/000051.o /tmp/go-link-3397411914/000052.o /tmp/go-link-3397411914/000053.o /tmp/go-link-3397411914/000054.o /tmp/go-link-3397411914/000055.o /tmp/go-link-3397411914/000056.o /tmp/go-link-3397411914/000057.o /tmp/go-link-3397411914/000058.o -O2 -g -lEGL -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon-x11 -lxkbcommon -lX11-xcb -lX11 -lxcb -lXcursor -lXfixes -O2 -g -lEGL -O2 -g -ldl -lwayland-client -O2 -g -lpthread -O2 -g -lxkbcommon -O2 -g -O2 -g -lm -lm -lm -lm -lm -lm -lm -O2 -g -O2 -g -ldl -no-pie
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000047.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000047.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000048.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000048.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000049.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000049.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000050.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000050.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000051.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000051.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000052.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000052.o
/usr/bin/ld: error: $WORK/b001/exe/a.out uses VFP register arguments, /tmp/go-link-3397411914/000053.o does not
/usr/bin/ld: failed to merge target specific data of file /tmp/go-link-3397411914/000053.o
collect2: error: ld returned 1 exit status
```

Ian Lance Taylor

unread,
Nov 1, 2024, 2:21:47 PMNov 1
to Stephan Lukits, golang-nuts
On Fri, Nov 1, 2024 at 11:08 AM Stephan Lukits <stephan...@gmail.com> wrote:
>
> from my research I found it could be helpful to exectue gcc with the `--mfloat-abi=hard` option; but I couldn't figure how to inject that option?

I don't know whether it will fix your problem, but you can set the
environment variable CGO_CFLAGS=-mfloat-abi=hard to compile C code
with that option.

Ian

Stephan Lukits

unread,
Nov 2, 2024, 7:57:41 AMNov 2
to Ian Lance Taylor, golang-nuts
Thanks a lot!

Reply all
Reply to author
Forward
0 new messages