[llvm-dev] LLVM on bare-metal

Brian Clarkson via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 27 01:49:51 PDT 2019


Hello!

Q1
Are there any resources or examples on embedding LLVM into an ARM-based 
bare-metal application?  Searching in this area only turns up 
information on how to use LLVM to target bare-metal when I want to 
compile LLVM for linking against a bare-metal application.

Q2
Are there any memory usage benchmarks for LLVM across the common tasks 
(especially loading bytecode, doing the optimization passes and finally 
emitting machine code)?  My target (embedded) system has only 1GB of RAM.

Background:
I'm about to embark on an effort to integrate LLVM into my bare-metal 
application (for AM335x, Cortex-A8, also known as beaglebone black).  
The application area is sound synthesis and the reason for embedding 
LLVM is to allow users to develop their own "plugins" on the desktop 
(using a live coding approach) and then load them (as LLVM bytecode) on 
the embedded device.  LLVM would be responsible for generating 
(optimized, and especially vectorized for NEON) machine code directly on 
the embedded device and it would take care of the relocation and 
run-time linking duties.  This last task is very important because the 
RTOS (Texas Instrument's SYS/BIOS) that I'm using  does not have any 
dynamic linking facilities. Sharing code in the form of LLVM bytecode 
also seems to sidestep the complex task of setting up a cross-compiling 
toolchain which is something that I would prefer not to have to force my 
users to do. In fact, my goal is to have a live coding environment 
provided as a desktop application (which might also embed Clang as well 
as LLVM) that allows the user to rapidly and playfully build their sound 
synthesis idea (in simple C/C++ at first, Faust later maybe) and then 
save the algorithm as bytecode to be copied over to the AM335x-based 
device.

Thank you in advance for any help or pointers to resources that you can 
provide!

Kind regards
Brian

-- 
Orthogonal Devices
Tokyo, Japan
www.orthogonaldevices.com


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the llvm-dev mailing list