diff --git a/Rakefile b/Rakefile index f99e143..b92a6bc 100644 --- a/Rakefile +++ b/Rakefile @@ -54,7 +54,7 @@ cflags << "-fshort-enums" # don't use system main definition (the starting point) cflags << "-ffreestanding" # don't use the standard library (only if you provide an alternative libc library) -#cflags << "-nostdlib -nostdinc" +cflags << "-nostdlib -nostdinc" # standard C library (use musl libc) cflags << "-I /usr/lib/musl/include/" # include own libraries @@ -75,13 +75,13 @@ ldflags << "-nostartfiles" # only keep used sections ldflags << "--gc-sections" # don't use system libraries (only if you provide an alternative libc library) -#ldflags << "-nostdlib -nostdinc" +ldflags << "-nostdlib -nostdinc -nosys" # add standard libraries (for libc, libm, libnosys, libgcc) and libopencm3 library_paths = ["/usr/arm-none-eabi/lib/armv7-m/", "/usr/lib/gcc/arm-none-eabi/*/armv7-m/", LIBOPENCM3_LIB] ldflags += library_paths.collect {|library_path| "--library-path #{library_path}"} ldflags *= ' ' # used libraries (gcc provides the ARM ABI) -ldlibs = [STM32F1_LIB, "c", "m", "nosys", "gcc"] +ldlibs = [STM32F1_LIB, "m", "c", "nosys", "gcc"] ldlibs = ldlibs.collect {|library| "--library #{library}"} ldlibs *= ' '