Skip to content

Commit

Permalink
refactor toolchain to work with substitution in Yggdrasil
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Dec 4, 2024
1 parent c419aea commit c8432e5
Showing 1 changed file with 54 additions and 53 deletions.
107 changes: 54 additions & 53 deletions deps/ReactantExtra/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ 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 @@ -134,7 +121,21 @@ cc_toolchain_config(
],
)

# TODO distinguish between clang and gcc toolchains
# TODO change it to more generic yggdrasil toolchain once we have it
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_toolchain",
)

# TODO distinguish between clang and gcc toolchains?
cc_toolchain_config(
name = "ygg_aarch64_toolchain_config",
cpu = "aarch64",
Expand All @@ -145,38 +146,38 @@ cc_toolchain_config(
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"
"/opt/BB_TARGET/lib/gcc/BB_TARGET/10.2.0/include",
"/opt/BB_TARGET/lib/gcc/BB_TARGET/10.2.0/include-fixed",
"/opt/BB_TARGET/BB_TARGET/include",
"/opt/BB_TARGET/BB_TARGET/sys-root/usr/include",
"/opt/BB_TARGET/BB_TARGET/include/c++/10.2.0",
"/opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/BB_TARGET",
"/opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/backward",
"/opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/parallel"
],
tool_paths = {
"ar": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/ar",
"as": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/as",
"c++": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/c++",
"c++filt": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/c++filt",
"cc": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/cc",
"clang": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/clang",
"clang++": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/clang++",
"cpp": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/cpp",
"f77": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/f77",
"g++": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/g++",
"gcc": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/gcc",
"gfortran": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/gfortran",
"ld": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/ld",
"ld.lld": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/ld.lld",
"libtool": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/libtool",
"lld": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/lld",
"nm": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/nm",
"objcopy": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/objcopy",
"patchelf": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/patchelf",
"ranlib": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/ranlib",
"readelf": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/readelf",
"strip": "/opt/bin/aarch64-linux-gnu-libgfortran5-cxx11-gpu+none-mode+opt/strip",
"ar": "/opt/bin/BB_FULL_TARGET/ar",
"as": "/opt/bin/BB_FULL_TARGET/as",
"c++": "/opt/bin/BB_FULL_TARGET/c++",
"c++filt": "/opt/bin/BB_FULL_TARGET/c++filt",
"cc": "/opt/bin/BB_FULL_TARGET/cc",
"clang": "/opt/bin/BB_FULL_TARGET/clang",
"clang++": "/opt/bin/BB_FULL_TARGET/clang++",
"cpp": "/opt/bin/BB_FULL_TARGET/cpp",
"f77": "/opt/bin/BB_FULL_TARGET/f77",
"g++": "/opt/bin/BB_FULL_TARGET/g++",
"gcc": "/opt/bin/BB_FULL_TARGET/gcc",
"gfortran": "/opt/bin/BB_FULL_TARGET/gfortran",
"ld": "/opt/bin/BB_FULL_TARGET/ld",
"ld.lld": "/opt/bin/BB_FULL_TARGET/ld.lld",
"libtool": "/opt/bin/BB_FULL_TARGET/libtool",
"lld": "/opt/bin/BB_FULL_TARGET/lld",
"nm": "/opt/bin/BB_FULL_TARGET/nm",
"objcopy": "/opt/bin/BB_FULL_TARGET/objcopy",
"patchelf": "/opt/bin/BB_FULL_TARGET/patchelf",
"ranlib": "/opt/bin/BB_FULL_TARGET/ranlib",
"readelf": "/opt/bin/BB_FULL_TARGET/readelf",
"strip": "/opt/bin/BB_FULL_TARGET/strip",
# from host
"llvm-cov": "/opt/x86_64-linux-musl/bin/llvm-cov",
"llvm-profdata": "/opt/x86_64-linux-musl/bin/llvm-profdata",
Expand All @@ -189,14 +190,14 @@ cc_toolchain_config(
"-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",
"-isystem /opt/BB_TARGET/lib/gcc/BB_TARGET/10.2.0/include",
"-isystem /opt/BB_TARGET/lib/gcc/BB_TARGET/10.2.0/include-fixed",
"-isystem /opt/BB_TARGET/BB_TARGET/include",
"-isystem /opt/BB_TARGET/BB_TARGET/sys-root/usr/include",
"-isystem /opt/BB_TARGET/BB_TARGET/include/c++/10.2.0",
"-isystem /opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/BB_TARGET",
"-isystem /opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/backward",
"-isystem /opt/BB_TARGET/BB_TARGET/include/c++/10.2.0/parallel",
],
opt_compile_flags = [
"-g0",
Expand All @@ -223,7 +224,7 @@ cc_toolchain_config(
"-Wno-unused-command-line-argument",
"-Wno-gnu-offsetof-extensions",
],
builtin_sysroot = "/opt/aarch64-linux-gnu/aarch64-linux-gnu/sys-root/",
builtin_sysroot = "/opt/BB_TARGET/BB_TARGET/sys-root/",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
host_system_name = "linux",
Expand Down

0 comments on commit c8432e5

Please sign in to comment.