Rakefile: change library order for libm to be used correctly

This commit is contained in:
King Kévin 2017-10-08 16:53:36 +02:00
parent 409a4ffa4c
commit de5d8d0d87
1 changed files with 3 additions and 3 deletions

View File

@ -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 *= ' '