cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.48k stars 430 forks source link

Plumbing to allow crosscompiles of Ubuntu to ARM variants #534

Open pimvanpelt opened 4 years ago

pimvanpelt commented 4 years ago

See discussion in https://github.com/cesanta/mongoose-os/issues/533

This PR is non-intrusive, as the default compiler toolkit chosen (x86_64-linux-gnu) is the one for AMD64:

lrwxrwxrwx 1 root root   5 May 20  2019 /usr/bin/gcc -> gcc-7
lrwxrwxrwx 1 root root   5 May 20  2019 /usr/bin/x86_64-linux-gnu-gcc -> gcc-7

Tested the change by compiling a few different applications for a few different targets:

for t in arm-linux-gnueabi arm-linux-gnueabihf aarch64-linux-gnu x86_64-linux-gnu; do
  mos build --clean --local --verbose --no-platform-check --build-var=COMPILER_TOOLKIT=$t
done

And they all compile cleanly -- although they are missing their *.a libraries.