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

specify aarch64-linux toolchain for Yggdrasil build #316

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 112 additions & 1 deletion deps/ReactantExtra/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ cc_toolchain_suite(
"k8": ":ygg_x86_toolchain",
"darwin": ":ygg_x86_toolchain",
"darwin_arm64": ":ygg_x86_toolchain",
"linux_arm64": ":ygg_x86_toolchain",
"aarch64": ":ygg_aarch64_toolchain",
},
)

cc_toolchain_suite(
name = "beast_toolchain_suite",
toolchains = {
Expand All @@ -38,6 +39,19 @@ cc_toolchain(
toolchain_identifier = "ygg_x86_toolchain",
)

cc_toolchain(
name = "ygg_aarch64_toolchain",
all_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":ygg_aarch64_toolchain_config",
toolchain_identifier = "ygg_aarch64_toolchain",
)

cc_toolchain_config(
name = "ygg_x86_toolchain_config",
abi_libc_version = "local",
Expand Down Expand Up @@ -120,6 +134,103 @@ cc_toolchain_config(
],
)

# TODO distinguish between clang and gcc toolchains
cc_toolchain_config(
name = "ygg_aarch64_toolchain_config",
cpu = "aarch64",
compiler = "compiler",
toolchain_identifier = "ygg_aarch64",
target_system_name = "aarch64-unknown-linux-gnu",
target_libc = "",
abi_libc_version = "local",
abi_version = "local",
cxx_builtin_include_directories = [
"/opt/aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/10.2.0/include",
"/opt/aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/10.2.0/include-fixed",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/include",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/sys-root/usr/include",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/aarch64-linux-gnu",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/backward",
"/opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/parallel"
],
tool_paths = {
"ar": "/opt/bin/aarch64-linux-gnu-*/ar",
"as": "/opt/bin/aarch64-linux-gnu-*/as",
"c++": "/opt/bin/aarch64-linux-gnu-*/c++",
"c++filt": "/opt/bin/aarch64-linux-gnu-*/c++filt",
"cc": "/opt/bin/aarch64-linux-gnu-*/cc",
"clang": "/opt/bin/aarch64-linux-gnu-*/clang",
"clang++": "/opt/bin/aarch64-linux-gnu-*/clang++",
"cpp": "/opt/bin/aarch64-linux-gnu-*/cpp",
"f77": "/opt/bin/aarch64-linux-gnu-*/f77",
"g++": "/opt/bin/aarch64-linux-gnu-*/g++",
"gcc": "/opt/bin/aarch64-linux-gnu-*/gcc",
"gfortran": "/opt/bin/aarch64-linux-gnu-*/gfortran",
"ld": "/opt/bin/aarch64-linux-gnu-*/ld",
"ld.lld": "/opt/bin/aarch64-linux-gnu-*/ld.lld",
"libtool": "/opt/bin/aarch64-linux-gnu-*/libtool",
"lld": "/opt/bin/aarch64-linux-gnu-*/lld",
"nm": "/opt/bin/aarch64-linux-gnu-*/nm",
"objcopy": "/opt/bin/aarch64-linux-gnu-*/objcopy",
"patchelf": "/opt/bin/aarch64-linux-gnu-*/patchelf",
"ranlib": "/opt/bin/aarch64-linux-gnu-*/ranlib",
"readelf": "/opt/bin/aarch64-linux-gnu-*/readelf",
"strip": "/opt/bin/aarch64-linux-gnu-*/strip",
# from host
"llvm-cov": "/opt/x86_64-linux-musl/bin/llvm-cov",
"llvm-profdata": "/opt/x86_64-linux-musl/bin/llvm-profdata",
"objdump": "/usr/bin/objdump",
},
compile_flags = [
"-fstack-protector",
"-Wall",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fno-omit-frame-pointer",
# TODO cxx_builtin_include_directories doesn't seem to be working, so we add the INCLUDE_PATHs manually
"-isystem /opt/aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/10.2.0/include",
"-isystem /opt/aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/10.2.0/include-fixed",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/include",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/sys-root/usr/include",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/aarch64-linux-gnu",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/backward",
"-isystem /opt/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/10.2.0/parallel",
],
opt_compile_flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
# "-stdlib=libstdc++",
],
dbg_compile_flags = ["-g"],
link_flags = [],
link_libs = [
"-lstdc++",
"-lm",
],
opt_link_flags = ["-Wl,--gc-sections"],
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-Wno-unused-command-line-argument",
"-Wno-gnu-offsetof-extensions",
],
builtin_sysroot = "/opt/aarch64-linux-gnu/aarch64-linux-gnu/sys-root/",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
host_system_name = "linux",
# TODO gcc doesn't support it, only put it on clang (maybe even only for clang on aarch64-darwin?)
supports_start_end_lib = False,
)

cc_toolchain(
name = "beast_x86_toolchain",
all_files = ":empty",
Expand Down
Loading