Skip to content

Commit c52b90d

Browse files
author
Sergio Sánchez Ramírez
committed
some small refactors
1 parent c8fd8a6 commit c52b90d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/BuildToolchains.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ end
321321

322322
# TODO distinguish between clang and gcc toolchains?
323323
# TODO in _impl, get cpu, target_libc, abi_version and abi_libc_version from host + env info
324+
# TODO add `-lm` to `link_libs` on Reactant
324325
function toolchain_file(bt::Bazel, p::AbstractPlatform, host_platform::AbstractPlatform; is_host::Bool=false, clang_use_lld::Bool=false)
325326
target = triplet(p)
326327
aatarget = aatriplet(p)
@@ -367,11 +368,11 @@ function toolchain_file(bt::Bazel, p::AbstractPlatform, host_platform::AbstractP
367368
],
368369
toolchain_identifier = ctx.attr.toolchain_identifier,
369370
target_system_name = ctx.attr.target_system_name,
370-
target_cpu = "$(bazel_cpu(p))", # TODO
371-
target_libc = "unknown", # TODO
371+
target_cpu = "$(bazel_cpu(p))",
372+
target_libc = "unknown", # TODO get from platform on BB's generation step
372373
compiler = "clang",
373-
abi_version = "unknown", # TODO
374-
abi_libc_version = "unknown", # TODO
374+
abi_version = "unknown", # TODO get from platform on BB's generation step
375+
abi_libc_version = "unknown", # TODO get from platform on BB's generation step
375376
tool_paths = [
376377
tool_path(name = "ar", path = "/opt/bin/$(target)/ar"),
377378
tool_path(name = "as", path = "/opt/bin/$(target)/as"),
@@ -384,8 +385,8 @@ function toolchain_file(bt::Bazel, p::AbstractPlatform, host_platform::AbstractP
384385
tool_path(name = "f77", path = "/opt/bin/$(target)/f77"),
385386
386387
# WARN we force to use clang instead of gcc
387-
tool_path(name = "g++", path = "/opt/bin/$(target)/clang++"),
388-
tool_path(name = "gcc", path = "/opt/bin/$(target)/clang"),
388+
# tool_path(name = "g++", path = "/opt/bin/$(target)/clang++"),
389+
# tool_path(name = "gcc", path = "/opt/bin/$(target)/clang"),
389390
390391
tool_path(name = "gfortran", path = "/opt/bin/$(target)/gfortran"),
391392
tool_path(name = "ld", path = "/opt/bin/$(target)/ld"),
@@ -446,7 +447,7 @@ function toolchain_file(bt::Bazel, p::AbstractPlatform, host_platform::AbstractP
446447
provides = [CcToolchainConfigInfo],
447448
)
448449
449-
def ygg_cc_toolchain():
450+
def ygg_cc_toolchain(**kwargs):
450451
cpu = "aarch64"
451452
toolchain_identifier = "ygg_$(is_host ? "host" : "target")_toolchain"
452453
supports_start_end_lib = False
@@ -470,6 +471,7 @@ function toolchain_file(bt::Bazel, p::AbstractPlatform, host_platform::AbstractP
470471
target_system_name = "$(os(p))"
471472
# TODO gcc doesn't support it, only put it on clang (maybe even only for clang on aarch64-darwin?)
472473
# supports_start_end_lib = supports_start_end_lib,
474+
**kwargs,
473475
)
474476
"""
475477
end

0 commit comments

Comments
 (0)