From de5d8d0d873de13ae75a7a2abea14b90285b4e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sun, 8 Oct 2017 16:53:36 +0200 Subject: [PATCH] Rakefile: change library order for libm to be used correctly --- Rakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 *= ' '