GPUOpen-Drivers / llvm-dialects

LLVM Dialects Library
Apache License 2.0
22 stars 22 forks source link

Fix llvm-dialects-tblgen Android corss-compiling issue #78

Closed mdinkov closed 9 months ago

mdinkov commented 9 months ago

Compilation of intermediate llvm-dialects-tblgen currently requires the Android linker to be located /system/bin/linker*. Editing the root directory can be disallowed on some build systems. This change allows the Android linker to be fetched directly from the AOSP build (i.e. without having to copy it to /system/bin/)

Change authored by Jinchao Xu.

trenouf commented 9 months ago

Shouldn't this tie into, or at least be analogous to, the way the NATIVE build works on llvm? That's where tablegen gets built in llvm. I guess mlir probably does the same.

nhaehnle commented 9 months ago

Shouldn't this tie into, or at least be analogous to, the way the NATIVE build works on llvm? That's where tablegen gets built in llvm. I guess mlir probably does the same.

Agreed. I'm not familiar with how this works, but a quick skim suggests re-using / adapting the pattern in llvm/cmake/modules/TableGen.cmake where build_native_tool is invoked.

For some added context, I initially didn't just use the add_tablegen macro because it only worked from inside an LLVM build, and the intention was to make it possible to use llvm-dialects with a pre-built version of LLVM. I believe there is some interest with Julia folks to potentially do that. But perhaps for a cross-compilation, making some assumptions doesn't hurt.