termux-packages
termux-packages copied to clipboard
Package request: libc-avr and avr-gcc
A toolchain for working with atmel microcontrollers, particularly compiling asm and C code. http://www.nongnu.org/avr-libc/ I haven't tried to build the packages myself yet, since compiling in termux is somewhat different from usual compiling and installing. Since there are already numerous android apps for flashing atmel microcontrollers, it might come in handy to be able to compile the firmware right on the android device.
I like this.
Try this , it works fine. https://github.com/opensource-apple/cctools https://cctools.info/index.php/Main_Page
I tried that before, it works fine on jellybean devices, but broken for KitKat and newer android versions. Since lollipop, both internal and external memory are mounted with noexec flag, preventing cctools from running any binaries there. Also since lollipop android has a restriction to run binaries compiled without pie flag (and all of binaries in cctools are compiled without). Also, there are only binaries for armv7 (most of the new phones, including my own, running on 64 bit CPUs with arm64 architecture). In a few words, it doesn't work on new phones and new android versions.
Has this situation changed any?
@telepresencebot2 we probably won't get avr-gcc working since the gcc toolchain isn't supported by the NDK anymore. We can however add the (still experimental last time I checked) avr target to our LLVM toolchain.
I was looking into that a couple of months ago, the toolchain built fine but I never tested it (was trying to compile for my arduino but had problems with the pre-processing of the source files). So, we can probably get a toolchain targetting avr but it needs to be tested. I can probably build llvm with the avr target if you are up for testing it
I'd be down to test it, but this is new territory for me, I've never built anything for android.
I've opened a PR to make it possible to target avr with clang: https://github.com/termux/termux-packages/pull/4552. Next step is probably to get arduino-cli working in termux, or atleast the upload part of it.
would be nice able to compile and get the .hex the rest is somewhat made
Hi everybody. I tried to compile the simplest code for AVR and the result is only half positive. Compilation to an object file takes place, and for linking clang tries to call avr-ld, which we do not have. Therefore, the final result cannot be obtained.
In this regard, it remains either to wait until the llvm is finished, or to wait for the package with avr-ld (part of AVR GCC).
@borshec Use LLD: clang [...] -fuse-ld=lld [...]
+1 requests
The latest clang provided in termux packages can target AVR CPU architecture.
$ type clang
clang is /data/data/com.termux/files/usr/bin/clang
$ clang -print-targets | grep AVR
avr - Atmel AVR Microcontroller
This issue can be closed probably.