You've already forked comprehensive-rust
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:
@ -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
|
||||
|
@ -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")
|
||||
|
Reference in New Issue
Block a user