fn main() { cc::Build::new() .compiler("riscv64-unknown-elf-gcc") .flag("-Wall") .flag("-Werror") .flag("-O") .flag("-fno-omit-frame-pointer") .flag("-ggdb") .flag("-gdwarf-2") .flag("-MD") .flag("-mcmodel=medany") .flag("-ffreestanding") .flag("-fno-common") .flag("-nostdlib") .flag("-mno-relax") .flag("-I.") .flag("-march=rv64gc") .flag("-mabi=lp64d") .flag_if_supported("-fno-stack-protector") .flag_if_supported("-fno-pie") .flag_if_supported("-no-pie") .file("src/c/layered.c") .compile("layered"); } /* Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I. -fno-stack-protector -fno-pie -no-pie TARGET_TRIPLE = riscv64gc-unknown-none-elf # Disable PIE when possible (for Ubuntu 16.10 toolchain) ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]no-pie'),) endif ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]nopie'),) CFLAGS += -fno-pie -nopie endif */