|
8 | 8 | # |
9 | 9 | MRuby::CrossBuild.new("luckfox_pico") do |conf| |
10 | 10 | # Clone the luckfox-pico repo above next to (same directory level) as mruby. |
11 | | - SDK_BASE = File.expand_path("../../../", File.expand_path(__FILE__)) + "/luckfox-pico" |
| 11 | + SDK_BASE = File.realpath(File.expand_path("../../../", File.expand_path(__FILE__)) + "/luckfox-pico") |
12 | 12 | TOOLCHAIN_BASE = "#{SDK_BASE}/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf" |
13 | 13 | SYSROOT = "#{TOOLCHAIN_BASE}/arm-rockchip830-linux-uclibcgnueabihf/sysroot" |
14 | 14 |
|
|
23 | 23 | cc.include_paths << "#{TOOLCHAIN_BASE}/arm-rockchip830-linux-uclibcgnueabihf/include/c++/8.3.0/arm-rockchip830-linux-uclibcgnueabihf" |
24 | 24 | cc.include_paths << "#{SYSROOT}/usr/include" |
25 | 25 |
|
| 26 | + # Flags taken from the SDK's Makefile |
26 | 27 | cc.flags << ["-march=armv7-a", "-mfpu=neon", "-mfloat-abi=hard"] |
27 | | - cc.flags << ["-O2", "-fPIC"] |
28 | 28 | cc.flags << ["-D_LARGEFILE_SOURCE", "-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64", "-ffunction-sections", "-fdata-sections"] |
| 29 | + cc.flags << ["-O2", "-fPIC"] |
29 | 30 | cc.flags << ["-Wl,--copy-dt-needed-entries", "-Wl,-lc,-lgcc_s"] |
30 | 31 | end |
31 | 32 |
|
|
59 | 60 | conf.gem 'mrbgems/mruby-binding/' |
60 | 61 | conf.gem 'mrbgems/mruby-catch/' |
61 | 62 | conf.gem 'mrbgems/mruby-class-ext/' |
| 63 | + # SDK doesn't include complex math for uClibc |
62 | 64 | # conf.gem 'mrbgems/mruby-cmath/' |
63 | 65 | conf.gem 'mrbgems/mruby-compar-ext/' |
64 | 66 | conf.gem 'mrbgems/mruby-compiler/' |
|
0 commit comments