techknowlogick / xgo

Go CGO cross compiler
MIT License
478 stars 79 forks source link

Compiling for linux/386 fails with missing header file #246

Open gerricom opened 6 months ago

gerricom commented 6 months ago

Since the 4th of May my xgo builds for linux/386 are failing with this message:

Compiling for linux/386...
# runtime/cgo
In file included from _cgo_export.c:3:
/usr/include/stdlib.h:25:10: fatal error: bits/libc-header-start.h: No such file or directory
   25 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I'm not very used on tracking down compiling errors so I kindly ask for some help. My little pipeline pulls the latest xgo image for every build and I guess something might have changed here? The commits tell me, that there were changes for arm64. Could that brought some unwanted side effects for 386 builds?

techknowlogick commented 6 months ago

Thanks @gerricom, while I had tested that PR, it seems that I have missed some testcases, including some relevant to the project I use xgo with (Gitea), and so I am looking into this atm.

@pat-s, for reference, I had missed that some arm targets swapped from 32 to 64bit, and vice versa (https://github.com/techknowlogick/xgo/commit/df906abb7eea1cdaaf264a5a56448c0ed1a6bb8f#diff-857fc4e810e548428809dc51da1a4655444dda1f81f2ccdb0ec96f68c7516821R291-R311) which means the Gitea arm64 binary, is built targeting 32bit instead. Also, as above mentioned, some headers may be missing (which could be due to updated packages in the apt install list https://github.com/techknowlogick/xgo/commit/df906abb7eea1cdaaf264a5a56448c0ed1a6bb8f#diff-ecbf8136e74368df705e8d8042aaf2046f251a483aff73304ea78e910a15c632L25-R49)

I may need to (temporarily) revert the arm PR while I dig through things. Edit: I have done this to give me time while I investigate. The build is building, and the revised image will be available once that is complete.

chaunsin commented 1 week ago

@techknowlogick I have also encountered this problem, I guess when can be solved thank you!