Skip to content

An attempt at an open source toolchain for the Hexagon DSP

Notifications You must be signed in to change notification settings

geohot/openhexagon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

An open source toolchain for the Hexagon DSP based off LLVM and MCLinker

== Instructions ==

* ./go.sh
* Copy the "Target files" from the SDK, see below
** TODO: Get a libc building for the DSP
* Sadly, to build the demos "qaic" is still needed
** TODO: Replace qaic with something better that doesn't needlessly copy memory

== freethedsp ==

DSP code you compile only works on Qualcomm Development boards by default.

Check out freethedsp.com for a way to make it run on a phone with a Qualcomm processor.

== Qualcomm SDK ==

Current tools version is 8.1.05. From the document "Tools release 7.x and 8.x are based wholly on the LLVM toolchain"
If we want to support V60, we need at least version 7.

== linker issue ==

clang doesn't currently work, because it needs to "hexagon-link"

"hexagon-link" is hardcoded in line 289:
https://clang.llvm.org/doxygen/Hexagon_8cpp_source.html

Qualcomm has a closed source linker "ld.qcld":
https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-llvm-compiler-android/32950

lld doesn't seem to support hexagon?
binutils bfd has no hexagon support?

There's a complete open source toolchain:
https://sourcery.mentor.com/GNUToolchain/release2800?@template=datasheet
But it's only up to Hexagon v5

CodeAurora has something:
https://portland.source.codeaurora.org/patches/quic/hexagon/
https://portland.source.codeaurora.org/patches/quic/hexagon/4.0/

Most up to date linker I've found:
https://portland.source.codeaurora.org/patches/quic/hexagon/V5/

This talks about the switch to "QCLinker" based off "MCLinker" which is open source
https://www.linuxplumbersconf.org/2015/ocw//system/presentations/3243/original/LPC2015.pdf
https://github.com/mclinker/mclinker

** FIXED! **

== Target files ==

Can't build them yet, they live in the SDK at:
cp -Rv ~/Qualcomm/Hexagon_SDK/3.3.3/tools/HEXAGON_Tools/8.1.05/Tools/target usr/

Libraries @ usr/target/hexagon/lib/v60:

Are these built with compiler-rt?
$PREFIX/target/hexagon/lib/v60/G0/pic/initS.o
$PREFIX/target/hexagon/lib/v60/G0/pic/libgcc.a
$PREFIX/target/hexagon/lib/v60/G0/pic/finiS.o

minimal for test to pass:
mkdir -p usr/target/hexagon/lib/v60/G0/pic/
cp -Rv ~/Qualcomm/Hexagon_SDK/3.3.3/tools/HEXAGON_Tools/8.1.05/Tools/target/hexagon/lib/v60/G0/pic/{initS.o,libgcc.a,finiS.o} usr/target/hexagon/lib/v60/G0/pic/

== qaic ==

Think this is closed source Qualcomm. It's probably easy to build a better open source replacement, the stuff it generates seems to be needlessly slow.

About

An attempt at an open source toolchain for the Hexagon DSP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published