-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does clang-uml
support the xtensa-esp32-elf
toolchain?
#292
Comments
@i-ilak I will look into this, but first I'll have to setup this toolchain on my machine and try to reproduce. Have you tried to run If it does work, then there must be a way to make |
@bkryza Unfortunately I dont have the container open anymore… I will reproduce it tomorrow and try clang-tidy and let you know how it goes! Thanks for the help! |
I've found a workaround to make xtensa-esp32s3-elf-g++.wrapper and #!/bin/bash
__real_bin="$(basename "$0")"
# Remove the unknown target triple printed by xtensa-xxxxxx
{ "${__real_bin%.wrapper}" "$@"; } 2>&1 | grep -v 'Target: xtensa' .clang-uml # /path/to/your/compile_commands.json, usually ./build
compilation_database_dir: build
output_directory: build/diagram
query_driver: xtensa-esp32s3-elf-g++.wrapper
# Or query_driver: xtensa-esp32-elf-g++.wrapper
add_compile_flags:
- '-m32'
- '-mllvm'
- '--mtriple=xtensa' # Make xtensa assembler work by manually specify the target triple
- '-D__XTENSA__=1'
- '-fparse-all-comments'
- '-fno-rtti'
- '-fno-exceptions'
- '-fms-extensions' # Allow to cast from void* to int
- '-Wno-int-to-void-pointer-cast'
remove_compile_flags:
- '-fno-shrink-wrap'
- '-mlongcalls'
- '-fstrict-volatile-bitfields'
- '-fno-tree-switch-conversion'
- '-Wno-old-style-declaration'
- '-Werror=all'
- '-pedantic'
- '-nostartfiles'
diagrams:
# your_diagram: ... And invoke
Tested with latest (2c23627) |
@bkryza I tried running I also tried @andylinpersonal approach. First of all, thanks for taking the time to comment! Doing this removes all errors but |
@i-ilak If cd clang-uml
make debug
debug/src/clang-uml ... It should print a stack trace in your terminal after segfault... |
Hi @i-ilak: |
Hi @andylinpersonal Output of
@bkryza Im not sure I can reproduce it in |
@i-lak One difference I see is that the debug version you've built is linked with LLVM 18, while in the first post you had make release and check if it's linked with LLVM 18 and whether it crashes or not... |
Hi @bkryza: option(CLANG_UML_ENABLE_BACKTRACE "" OFF)
if(LINUX AND (CMAKE_BUILD_TYPE MATCHES Debug OR ${CLANG_UML_ENABLE_BACKTRACE}))
# ... |
@andylinpersonal I've added that option, you can now build like: CLANG_UML_ENABLE_BACKTRACE=OFF make release However bear in mind that in release mode you'll only get the function/method names in the backtrace at best (unless they were inlined), and not the exact line of code that caused a crash... |
Setup & problem
I have a project that was compiled with
platformio
for aesp32
board, i.e. it uses thextensa-esp32-elf-g++
toolchain.I apologise in advance, but since Im using
platformio
to generate my project, creating a simple example to reproduce the issue is a bit tricky (i.e. it for sure doable, I just need to write theCMakeLists.txt
file to cross-compile one of your examples with the given toolchain). I will try do so in the coming day, but it might not be possible to do what I want for some more general reason, so I thought I ask before spending the time to create the example.Configuration & error
Im trying to generate the class diagrams with the following configuration file:
When I run the command
I get the following error:
The core issue seems to be
Adding a variation of
-arch/triple xtensa/xtensa-esp32-elf
to theadd_compile_flags
entry did not work, so Im not entirely clear if I just not correctly configuring this, or ifclang-uml
does not support that compiler...So, do you think it should in principle be possible to create a UML-graph given this toolchain?
clang-uml
versionAccording to this article
clang-16
should supportxtensa
backend...The text was updated successfully, but these errors were encountered: