diff --git a/WORKSPACE b/WORKSPACE index bd063241857..1de44c10f87 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -303,6 +303,7 @@ gcc_register_toolchain( gcc_register_toolchain( name = "gcc_toolchain_x86_64_unknown_none", # Repository @gcc_toolchain_x86_64_unknown_none + extra_ldflags = ["-nostdlib"], target_arch = ARCHS.x86_64, target_compatible_with = [ "@platforms//cpu:x86_64", diff --git a/oak_restricted_kernel_wrapper/BUILD b/oak_restricted_kernel_wrapper/BUILD new file mode 100644 index 00000000000..60ee6dbd0bd --- /dev/null +++ b/oak_restricted_kernel_wrapper/BUILD @@ -0,0 +1,41 @@ +# +# Copyright 2024 The Project Oak Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +load("@rules_rust//rust:defs.bzl", "rust_binary") + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +rust_binary( + name = "oak_restricted_kernel_wrapper", + srcs = glob(["src/**/*.rs"]), + compile_data = ["src/asm/boot.s"], + crate_features = ["bazel"], # TODO: b/333064338 remove. + data = [ + "//oak_restricted_kernel_bin:oak_restricted_kernel_bin_virtio_console_channel", + ], + platform = "//:x86_64-unknown-none", + rustc_env = { + "PAYLOAD_PATH": "$(location //oak_restricted_kernel_bin:oak_restricted_kernel_bin_virtio_console_channel)", + }, + deps = [ + "@//oak_linux_boot_params", + "@oak_no_std_crates_index//:elf", + "@oak_no_std_crates_index//:x86_64", + ], +)