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

0_RootFS: Support riscv64 #8468

Merged
merged 5 commits into from
Dec 23, 2024
Merged

Conversation

eschnett
Copy link
Contributor

@eschnett eschnett commented Apr 9, 2024

No description provided.

0_RootFS/gcc_sources.jl Outdated Show resolved Hide resolved
@giordano giordano added the BinaryBuilder ⚙️ Issues and pull requested related to internals of BinaryBuilder label Dec 21, 2024
@giordano
Copy link
Member

Can you please update https://github.com/JuliaPackaging/Yggdrasil/blob/master/RootFS.md? In particular the list of architectures in the first section, and the version of glibc for riscv64 in corresponding table.

Comment on lines +360 to +364
if [[ ${COMPILER_TARGET} == riscv64-* ]]; then
# Explicitly disable C++
# (Disable for all architectures?)
GLIBC_CONFIGURE_OVERRIDES+=( CXX=false )
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? What are the consequences?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this setting, glibc builds the file support/links-dso-program.cc with a C++ compiler. There is no C++ compiler for the host architecture available, so glibc uses /usr/bin/g++ instead. This fails. If we disable C++ (/bin/false always reports an error in the configure stage), then glibc builds a different version of that file (support/links-dso-program-c.c) with a C compiler, and all is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't exist in the earlier glibc versions that we build for other architectures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no C++ compiler for the host architecture available

All this stuff is built with system compilers, we don't use BinayBuilder toolchains, that's the point of these (obscure) lines

@eval BinaryBuilder.BinaryBuilderBase empty!(bootstrap_list)
@eval BinaryBuilder.BinaryBuilderBase push!(bootstrap_list, :rootfs, :platform_support)
The C file is probably being built with /usr/bin/gcc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the C file is built with the host compiler (--target="${COMPILER_TARGET}"). The lines you see here are only configuring glibc. glibc is built much further down (# Finish off libc), after the first stage of GCC has been built (# Back to GCC-land, install libgcc).

/usr/bin/gcc would target the build system x86_64-linux-musl, and that wouldn't work for building a glibc for riscv64.

@giordano giordano merged commit dbfe8af into JuliaPackaging:master Dec 23, 2024
3 checks passed
@eschnett eschnett deleted the eschnett/riscv64 branch December 23, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BinaryBuilder ⚙️ Issues and pull requested related to internals of BinaryBuilder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants