termux-play-store / termux-packages

Packages for the current Termux build on Google Play.
Other
18 stars 0 forks source link

[Bug]: Golang CGO #1

Closed JeelsBoobz closed 2 months ago

JeelsBoobz commented 3 months ago

Problem description

if build golang using this command without CGO_ENABLED=0 GOARCH=arm64 GOOS=android go build -o main main.go

What steps will reproduce the bug?

Error:

# runtime/cgo
cgo-builtin-prolog:1:10: fatal error: 'stddef.h' file not found
    1 | #include <stddef.h>
      |          ^~~~~~~~~~
1 error generated.

Without this issue on F-Droid version

What is the expected behavior?

No response

System information

Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_EXEC__PROC_SELF_EXE=/data/data/com.termux/files/usr/bin/termux-info
TERMUX_VERSION=0.127
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.net stable main
Updatable packages:
All packages up to date
termux-tools version:
3.0.6
Android version:
14
Kernel build information:
Linux localhost 4.14.290-Static:[Brokeneer]-gdccf53794a3d #1 SMP PREEMPT Sun May 19 22:43:41 UTC 2024 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
M2007J20CG
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
fornwall commented 3 months ago

Thanks for reporting!

This is indeed an issue with the golang patches for termux-exec, perhaps something with incorrect self proc name being set detected by clang. If someone knowledgeable in go want to look at it I would be happy :), otherwise I'll get to it soon!

fornwall commented 2 months ago

@JeelsBoobz This should now be fixed in version 1.22.5-2 of the golang package - run pkg up to update, and let me know if any problem remains!