1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-16 06:10:26 +02:00

Use Clang rather than GCC for assembly. (#2377)

This avoids the hack for using aarch64-linux-gnu on Linux, and also
removes a dependency.

Also switched to using `cargo-objcopy`, as we require `cargo-binutils`
already and it makes the Makefiles simpler.
This commit is contained in:
Andrew Walbran
2024-09-24 10:19:29 +01:00
committed by GitHub
parent f64edfc1f7
commit 2713ea3475
5 changed files with 8 additions and 29 deletions

View File

@ -12,14 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
TARGET = aarch64-linux-gnu
else
TARGET = aarch64-none-elf
endif
OBJCOPY = $(TARGET)-objcopy
.PHONY: build qemu_minimal qemu qemu_logger
all: rtc.bin
@ -28,7 +20,7 @@ build:
cargo build
rtc.bin: build
$(OBJCOPY) -O binary target/aarch64-unknown-none/debug/rtc $@
cargo objcopy -- -O binary $@
qemu: rtc.bin
qemu-system-aarch64 -machine virt,gic-version=3 -cpu max -serial mon:stdio -display none -kernel $< -s

View File

@ -16,10 +16,8 @@ use cc::Build;
use std::env;
fn main() {
#[cfg(target_os = "linux")]
env::set_var("CROSS_COMPILE", "aarch64-linux-gnu");
#[cfg(not(target_os = "linux"))]
env::set_var("CROSS_COMPILE", "aarch64-none-elf");
env::set_var("CC", "clang");
Build::new()
.file("entry.S")