Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

had an issue compiling terraos #30

Closed
appleflyerv3 opened this issue Jun 7, 2024 · 6 comments
Closed

had an issue compiling terraos #30

appleflyerv3 opened this issue Jun 7, 2024 · 6 comments

Comments

@appleflyerv3
Copy link

appleflyerv3 commented Jun 7, 2024

running arch linux

libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -I. -I../include -Iinclude -I../src -O2 -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -c ../src/x86/unix64.S  -fPIC -DPIC -o src/x86/.libs/unix64.o
/bin/sh ./libtool  --tag=CC   --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -I. -I../include -Iinclude -I../src -O2 -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -c -o src/x86/win64.lo ../src/x86/win64.S
../src/tramp.c: In function ‘ffi_tramp_get_temp_file’:
../src/tramp.c:262:22: error: implicit declaration of function ‘open_temp_exec_file’ [-Wimplicit-function-declaration]
  262 |   tramp_globals.fd = open_temp_exec_file ();
      |                      ^~~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:1323: src/tramp.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -I. -I../include -Iinclude -I../src -O2 -I/home/appleflyer/terraos/scripts/buildroot/output/host/include -c ../src/x86/win64.S  -fPIC -DPIC -o src/x86/.libs/win64.o
make[4]: Leaving directory '/home/appleflyer/terraos/scripts/buildroot/output/build/host-libffi-3.4.4/x86_64-pc-linux-gnu'
make[3]: *** [Makefile:1395: all-recursive] Error 1
make[3]: Leaving directory '/home/appleflyer/terraos/scripts/buildroot/output/build/host-libffi-3.4.4/x86_64-pc-linux-gnu'
make[2]: *** [Makefile:623: all] Error 2
make[2]: Leaving directory '/home/appleflyer/terraos/scripts/buildroot/output/build/host-libffi-3.4.4/x86_64-pc-linux-gnu'
make[1]: *** [Makefile:591: all-all] Error 2
make[1]: Leaving directory '/home/appleflyer/terraos/scripts/buildroot/output/build/host-libffi-3.4.4'
make: *** [package/pkg-generic.mk:283: /home/appleflyer/terraos/scripts/buildroot/output/build/host-libffi-3.4.4/.stamp_built] Error 2

idk why this happened
bash build_stage1.sh terraos
and that happened

@appleflyerv3
Copy link
Author

upon further research, i found this on the buildroot bug tracker
bug report
DescriptionRicardo Miguel 2024-06-04 00:18:49 UTC
When trying to build root image for zynq target, it throws this error:
....
../src/tramp.c: In function 'ffi_tramp_get_temp_file':
../src/tramp.c:262:22: error: implicit declaration of function 'open_temp_exec_file' [-Wimplicit-function-declaration]
262 | tramp_globals.fd = open_temp_exec_file ();
....
Host OS: Fedora 40
Kernel: 6.8.10-300.fc40.x86_64
gcc : version 14.1.1 20240522 (Red Hat 14.1.1-4) (GCC)

Problem: libffi-3.4.4 does not compile with gcc > 14.

Solution:

  1. Edit buildroot-2024.02.2/package/libffi/libffi.mk and change libffi version
    LIBFFI_VERSION = 3.4.6

  2. Edit buildroot-2024.02.2/package/libffi/libffi.hash and change hashes:

For libffi-3.4.6.tar.gz

sha256 b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e libffi-3.4.6.tar.gz
sha256 67894089811f93fca47a76f85e017da6f8582d4ba0905963c6e0f1ad6df7a195 LICENSE

I have tried it only for zynq target, but I assume that this fix works for all
targets that compile libffi and all systems where GCC > 14
Regards

must be a buildroot issue lol

@appleflyerv3
Copy link
Author

therefore, a possible fix for this issue is to edit buildroot-2024.02.2/package/libffi/libffi.mk
and change libffi version
LIBFFI_VERSION = 3.4.6

then, change the hash
sha256 b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e libffi-3.4.6.tar.gz
sha256 67894089811f93fca47a76f85e017da6f8582d4ba0905963c6e0f1ad6df7a195 LICENSE

@appleflyerv3
Copy link
Author

appleflyerv3 commented Jun 7, 2024

created a pull request on your fork of buildroot to fix this issue

@happylabdab2
Copy link

compile it on ubuntu the go to arch

@appleflyerv3
Copy link
Author

iirc bootstrapping arch linux needs arch linux so id go with archlinux

@appleflyerv3
Copy link
Author

issue fixed with r58 updating buildroot repo from upstream 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants