forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bazel,dvsim] remove gen-binaries.py's reliance on meson_init.sh
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
- Loading branch information
1 parent
46cd727
commit ea9b55b
Showing
3 changed files
with
59 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Copyright lowRISC contributors. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
# If we are on an air-gapped machine, we need to first ensure the toolchain has | ||
# been unpacked from the repository cache. | ||
if [[ -n ${BAZEL_CACHE} ]]; then | ||
BAZEL_CMD="bazel" | ||
${BAZEL_CMD} fetch \ | ||
--distdir=${BAZEL_DISTDIR} \ | ||
--repository_cache=${BAZEL_CACHE} \ | ||
@com_lowrisc_toolchain_rv32imc_compiler//... | ||
else | ||
BAZEL_CMD="./bazelisk.sh" | ||
${BAZEL_CMD} fetch @com_lowrisc_toolchain_rv32imc_compiler//... | ||
fi | ||
|
||
# Set environment variables for the RV32 linker and assembler. | ||
export RV32_TOOL_LD=$(${BAZEL_CMD} query \ | ||
'deps(@com_lowrisc_toolchain_rv32imc_compiler//:bin/riscv32-unknown-elf-ld)' \ | ||
--output location | cut -f1 -d:) | ||
export RV32_TOOL_AS=$(${BAZEL_CMD} query \ | ||
'deps(@com_lowrisc_toolchain_rv32imc_compiler//:bin/riscv32-unknown-elf-as)' \ | ||
--output location | cut -f1 -d:) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters