Rakefile: switch from clang to gcc because fot clang uint64_t is only 4 bytes long
This commit is contained in:
parent
e2f92863da
commit
28545559b0
16
Rakefile
16
Rakefile
|
@ -29,7 +29,8 @@ SRC_DIRS = [".", "lib"]
|
||||||
|
|
||||||
# cross-compiler environment
|
# cross-compiler environment
|
||||||
PREFIX = ENV["PREFIX"] || "arm-none-eabi"
|
PREFIX = ENV["PREFIX"] || "arm-none-eabi"
|
||||||
CC = "clang -target #{PREFIX}" # use clang instead of gcc
|
CC = PREFIX+"-gcc"
|
||||||
|
#CC = "clang -target #{PREFIX}" # to use clang instead of gcc
|
||||||
LD = PREFIX+"-ld"
|
LD = PREFIX+"-ld"
|
||||||
AR = PREFIX+"-ar"
|
AR = PREFIX+"-ar"
|
||||||
AS = PREFIX+"-as"
|
AS = PREFIX+"-as"
|
||||||
|
@ -53,10 +54,6 @@ cflags << "-fno-common -ffunction-sections -fdata-sections"
|
||||||
cflags << "-fshort-enums"
|
cflags << "-fshort-enums"
|
||||||
# don't use system main definition (the starting point)
|
# don't use system main definition (the starting point)
|
||||||
cflags << "-ffreestanding"
|
cflags << "-ffreestanding"
|
||||||
# don't use the standard library (only if you provide an alternative libc library)
|
|
||||||
cflags << "-nostdlib -nostdinc"
|
|
||||||
# standard C library (use musl libc)
|
|
||||||
cflags << "-I /usr/lib/musl/include/"
|
|
||||||
# include own libraries
|
# include own libraries
|
||||||
cflags += SRC_DIRS.collect {|srd_dir| "-I #{srd_dir}"}
|
cflags += SRC_DIRS.collect {|srd_dir| "-I #{srd_dir}"}
|
||||||
# include libopencm3 library
|
# include libopencm3 library
|
||||||
|
@ -74,10 +71,11 @@ ldflags << "-static"
|
||||||
ldflags << "-nostartfiles"
|
ldflags << "-nostartfiles"
|
||||||
# only keep used sections
|
# only keep used sections
|
||||||
ldflags << "--gc-sections"
|
ldflags << "--gc-sections"
|
||||||
# don't use system libraries (only if you provide an alternative libc library)
|
# add standard libraries (for libc, libm, libnosys, libgcc) because we don't use arm-none-eabi-gcc to locate them
|
||||||
ldflags << "-nostdlib -nostdinc -nosys"
|
library_paths = ["/usr/arm-none-eabi/lib/armv7-m/", "/usr/lib/gcc/arm-none-eabi/*/armv7-m/"]
|
||||||
# add standard libraries (for libc, libm, libnosys, libgcc) and libopencm3
|
# add libopencm3
|
||||||
library_paths = ["/usr/arm-none-eabi/lib/armv7-m/", "/usr/lib/gcc/arm-none-eabi/*/armv7-m/", LIBOPENCM3_LIB]
|
library_paths += [LIBOPENCM3_LIB]
|
||||||
|
# include libraries in flags
|
||||||
ldflags += library_paths.collect {|library_path| "--library-path #{library_path}"}
|
ldflags += library_paths.collect {|library_path| "--library-path #{library_path}"}
|
||||||
ldflags *= ' '
|
ldflags *= ' '
|
||||||
# used libraries (gcc provides the ARM ABI)
|
# used libraries (gcc provides the ARM ABI)
|
||||||
|
|
Loading…
Reference in New Issue