Skip to content

Commit d2967a1

Browse files
FreeRTOS: Fixes after merge
* Comply with new typing for QEMU targets * Add xlen for 32-bit builds * Don't use gprel branch in LLVM by default, it's only needed for compartmentalisation * Remove vcu118-baremetal * Uncomment Alex's notifications in Jenkinsfile * Remove RISC-V's RVC option as it is now enabled by default
1 parent 0a864a9 commit d2967a1

File tree

9 files changed

+22
-402
lines changed

9 files changed

+22
-402
lines changed

Jenkinsfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ pipeline {
9393
environment {
9494
PYTHONDONTWRITEBYTECODE = '1'
9595
}
96-
//post {
97-
// failure {
98-
// mail(to: '[email protected]', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}")
99-
// }
100-
// }
96+
post {
97+
failure {
98+
mail(to: '[email protected]', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}")
99+
}
100+
}
101101
options {
102102
checkoutToSubdirectory('src')
103103
timestamps()

pycheribuild/config/chericonfig.py

-3
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,6 @@ def __init__(self, loader, action_class: "type[CheribuildActionEnum]") -> None:
332332
self.riscv_baremetal_hardfloat = loader.add_bool_option("riscv-baremetal-hardfloat", default=False,
333333
group=loader.cross_compile_options_group,
334334
help="Use hard floating point ABI for building CHERI-RISC-V programs")
335-
self.riscv_cheri_rvc = loader.add_bool_option("riscv-cheri-rvc", default=False,
336-
group=loader.cross_compile_options_group,
337-
help="Build CHERI-RISC-V projects with compressed CHERI instructions support")
338335
self.riscv_cheri_gprel = loader.add_bool_option("riscv-cheri-gprel", default=False,
339336
group=loader.cross_compile_options_group,
340337
help="Build CHERI-RISC-V libs with gprel ABI for CheriFreeRTOS compartmentalization")

pycheribuild/config/compilation_targets.py

-5
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,6 @@ def essential_compiler_and_linker_flags_impl(
283283
# Both RTEMS and baremetal FreeRTOS are linked above 0x80000000
284284
result.append("-mcmodel=medium")
285285

286-
# Enable generating CHERI-RISC-V compressed instructions
287-
if config.riscv_cheri_rvc:
288-
if xtarget.is_cheri_hybrid() or xtarget.is_cheri_purecap():
289-
result.append("-mxcheri-rvc")
290-
291286
if config.riscv_cheri_gprel:
292287
if xtarget.is_cheri_purecap():
293288
result.append("-cheri-cap-table-abi=gprel")

pycheribuild/processutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def keep_terminal_sane(gave_tty_control=False, command: Optional[list] = None):
229229
finally:
230230
# Can seemingly get unwanted SIGTTOU's whilst restoring so just ignore
231231
# them temporarily.
232-
with suppress_sigttou():
232+
with suppress_sigttou(suppress=gave_tty_control):
233233
stdin_state.restore()
234234
stdout_state.restore()
235235
stderr_state.restore()

pycheribuild/projects/cross/freertos.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from .compiler_rt import BuildCompilerRtBuiltins
3737
from .crosscompileproject import CompilationTargets, CrossCompileAutotoolsProject, DefaultInstallDir, GitRepository
3838
from ..project import ComputedDefaultValue
39-
from ..run_qemu import LaunchQEMUBase
4039

4140

4241
class BuildFreeRTOS(CrossCompileAutotoolsProject):
@@ -84,13 +83,17 @@ def _run_waf(self, *args, **kwargs):
8483
def __init__(self, *args, **kwargs):
8584
super().__init__(*args, **kwargs)
8685
self.compiler_resource = self.get_compiler_info(self.CC).get_resource_dir()
86+
self.xlen = 64
8787

8888
self.default_demo_app = (
8989
"qemu_virt-"
9090
+ self.target_info.get_riscv_arch_string(self.crosscompile_target, softfloat=True)
9191
+ self.target_info.get_riscv_abi(self.crosscompile_target, softfloat=True)
9292
)
9393

94+
if "rv32" in self.target_info.get_riscv_arch_string(self.crosscompile_target, softfloat=True):
95+
self.xlen = 32
96+
9497
# Galois uses make build sysetm
9598
if self.demo == "RISC-V_Galois_demo":
9699

@@ -274,7 +277,7 @@ def configure(self):
274277
"--riscv-abi", self.target_info.get_riscv_abi(self.crosscompile_target, softfloat=True),
275278
"--riscv-platform", self.platform,
276279
"--program-path", program_root,
277-
"--sysroot", str(self.sdk_sysroot) + "/riscv64-unknown-elf",
280+
"--sysroot", str(self.sdk_sysroot) + "/riscv" + str(self.xlen) + "-unknown-elf",
278281
"--mem-start", self.mem_start,
279282
"--ipaddr", self.ipaddr,
280283
"--gateway", self.gateway

pycheribuild/projects/cross/llvm.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ def process(self):
630630

631631

632632
class BuildCheriLLVM(BuildLLVMMonoRepoBase):
633-
repository = GitRepository("https://github.com/CTSRD-CHERI/llvm-project.git",
634-
force_branch=True, default_branch="cherifreertos-gprel-dev-rebase")
633+
repository = GitRepository("https://github.com/CTSRD-CHERI/llvm-project.git")
635634
default_directory_basename = "llvm-project"
636635
target = "llvm"
637636
skip_cheri_symlinks = False

pycheribuild/projects/run_qemu.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
from .build_qemu import BuildQEMU, BuildQEMUBase, BuildUpstreamQEMU
4141
from .cross.cheribsd import BuildCHERIBSD, BuildCheriBsdMfsKernel, BuildFreeBSD, ConfigPlatform, KernelABI
42+
from .cross.freertos import BuildFreeRTOS
4243
from .cross.gdb import BuildGDB
4344
from .cross.u_boot import BuildUBoot
4445
from .disk_image import (
@@ -957,9 +958,11 @@ def __init__(self, *args, **kwargs):
957958

958959
class LaunchFreeRTOSQEMU(LaunchQEMUBase):
959960
target = "run-freertos"
960-
dependencies = ["freertos"]
961-
supported_architectures = [CompilationTargets.BAREMETAL_NEWLIB_RISCV64_PURECAP,
962-
CompilationTargets.BAREMETAL_NEWLIB_RISCV64]
961+
supported_architectures = (
962+
CompilationTargets.BAREMETAL_NEWLIB_RISCV32,
963+
CompilationTargets.BAREMETAL_NEWLIB_RISCV64,
964+
CompilationTargets.BAREMETAL_NEWLIB_RISCV32_PURECAP,
965+
CompilationTargets.BAREMETAL_NEWLIB_RISCV64_PURECAP)
963966
forward_ssh_port = False
964967
forward_ftp_port = True
965968
forward_tftp_port = True
@@ -974,6 +977,7 @@ class LaunchFreeRTOSQEMU(LaunchQEMUBase):
974977
qemu_user_networking = True
975978
_enable_smbfs_support = False
976979
_add_virtio_rng = False
980+
_uses_disk_image = False
977981
ftp_forwarding_port = 10021
978982
tftp_forwarding_port = 10069
979983
nbns_forwarding_port = 10137
@@ -985,8 +989,8 @@ class LaunchFreeRTOSQEMU(LaunchQEMUBase):
985989
default_demo = "RISC-V-Generic"
986990
default_demo_app = "main_blinky"
987991

988-
def __init__(self, config: CheriConfig):
989-
super().__init__(config)
992+
def __init__(self, *args, **kwargs):
993+
super().__init__(*args, **kwargs)
990994
if self.use_virtio_blk:
991995
self._after_disk_options.extend([
992996
"-drive", "file=" + str(BuildFreeRTOS.get_install_dir(self)) + "/FreeRTOS/Demo/bin/freertos.img,id=drv,format=raw",

pycheribuild/projects/simple_project.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ def die(msg):
169169
sys.exit("PseudoTarget with no dependencies should not exist!! Target name = " + target_name)
170170
supported_archs = cls.supported_architectures
171171
assert supported_archs, "Must not be empty: " + str(supported_archs)
172-
print(supported_archs)
173-
#assert isinstance(supported_archs, tuple)
172+
assert isinstance(supported_archs, tuple)
174173
assert len(set(supported_archs)) == len(supported_archs), (
175174
"Duplicates in supported archs for " + cls.__name__ + ": " + str(supported_archs)
176175
)

0 commit comments

Comments
 (0)