-
Notifications
You must be signed in to change notification settings - Fork 32
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
[Rootfs] Add GCC 14.2 and make it default for riscv64 #403
Conversation
Sigh. Will try to downgrade to ubuntu 22.04 |
b38f249
to
a89fd1b
Compare
wut |
An update: by comparing this with the GCC 14 toolchain sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | clang -x c - -o test -Wl,-t
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib64/lp64d/Scrt1.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crti.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtbeginS.o
/tmp/--12143a.o
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib/../lib64/libc.so
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtendS.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtn.o
ld.lld: error: undefined symbol: __libc_start_main
>>> referenced by start.S:53 (../sysdeps/riscv/start.S:53)
>>> /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib64/lp64d/Scrt1.o:(_start)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | gcc -x c - -o test -Wl,-t
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/usr/lib64/lp64d/crt1.o
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/crti.o
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/crtbegin.o
/tmp/cclffLPd.o
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/libgcc.a
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/../../../../riscv64-linux-gnu/lib/libgcc_s.so
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/../../../../riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/libgcc.a
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/usr/lib64/lp64d/libc.so
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/lib64/lp64d/libc.so.6
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/usr/lib64/lp64d/libc_nonshared.a
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/lib/ld-linux-riscv64-lp64d.so.1
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/usr/lib64/lp64d/libc_nonshared.a
/opt/riscv64-linux-gnu/bin/../riscv64-linux-gnu/sys-root/lib/ld-linux-riscv64-lp64d.so.1
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/libgcc.a
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/../../../../riscv64-linux-gnu/lib/libgcc_s.so
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/../../../../riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/libgcc.a
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/crtend.o
/opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/14.2.0/crtn.o and this with GCC 13: sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | clang -x c - -o test -Wl,-t
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib64/lp64d/Scrt1.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/13.2.0/crti.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/13.2.0/crtbeginS.o
/tmp/--1ee62c.o
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/lib64/lp64d/libc.so.6
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/lib/ld-linux-riscv64-lp64d.so.1
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/13.2.0/crtendS.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/13.2.0/crtn.o I believe the issue is that clang with GCC 14 is trying to link to the wrong sandbox:${WORKSPACE} # nm /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib/../lib64/libc.so
0000000000001f08 a _DYNAMIC
0000000000001ff8 a _GLOBAL_OFFSET_TABLE_
00000000000001e0 a _PROCEDURE_LINKAGE_TABLE_
sandbox:${WORKSPACE} # nm /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/lib64/lp64d/libc.so.6|grep __libc_start_main
0000000000026636 T __libc_start_main@@GLIBC_2.34
0000000000026636 T __libc_start_main@GLIBC_2.27
0000000000026636 t __libc_start_main_alias_1
0000000000026636 t __libc_start_main_alias_2
0000000000026636 t __libc_start_main_impl I believe we can just delete the extra dummy sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | clang -x c - -o test
ld.lld: error: undefined symbol: __libc_start_main
>>> referenced by start.S:53 (../sysdeps/riscv/start.S:53)
>>> /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib64/lp64d/Scrt1.o:(_start)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
sandbox:${WORKSPACE} # rm /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib/../lib64/libc.so
sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | clang -x c - -o test -Wl,-t
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/lib64/lp64d/Scrt1.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crti.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtbeginS.o
/tmp/--d0737a.o
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/lib64/lp64d/libc.so.6
/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/lib/ld-linux-riscv64-lp64d.so.1
/opt/riscv64-linux-gnu/riscv64-linux-gnu/lib/libgcc_s.so.1
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtendS.o
/opt/riscv64-linux-gnu/lib/gcc/riscv64-linux-gnu/14.2.0/crtn.o
sandbox:${WORKSPACE} # file test
test: ELF 64-bit LSB pie executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, for GNU/Linux 4.15.0, with debug_info, not stripped I don't see similar duplicates for the other architectures, no clue why it was created for riscv64. |
GCC 14 has support for the RISV-V Vector Extension 1.0 (RVV1.0), which is important for packages like OpenBLAS. `riscv64` is still niche enough that it's OK to use a more recent, but also more capable, version of GCC as default one.
We [skip ci] because we don't actually use it anywhere at the moment, but we just have it.
GCC 14 has support for the RISV-V Vector Extension 1.0 (RVV1.0), which is important for packages like OpenBLAS.
riscv64
is still niche enough that it's OK to use a more recent, but also more capable, version of GCC as default one.Companion PR to JuliaPackaging/Yggdrasil#10132.
Fix #398.