https://bugs.kde.org/show_bug.cgi?id=401654
Bug ID: 401654
Summary: clang_parseTranslationUnit2 fails when using
-march=armv7e-m
Product: kdevelop
Version: 5.3.0
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Language Support: CPP (Clang-based)
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
Kdevelop 5.3.0 (and possibly 5.2.4) fails to build duchain information for a
C/C++ CMake project when option -march=armv7e-m is added in add_definition() in
CMakeLists.txt. I have installed necessary ARM gcc compiler, so that the code
compiles fine.
STEPS TO REPRODUCE
1. Create a CMake C/C++ project for ARM compilation with necessary overrides
for CMAKE_C_COMPILER, etc.
2. Add definition -march=armv7e-m using add_definition()
3. Open/Import this project in KDevelop v5.3.0
OBSERVED RESULT
All code text appears without syntax highlighting, and mostly black text, like
in plain text editor (not even like in vim or Kate). Navigation, Outline, etc.
do not work.
EXPECTED RESULT
Syntax highlighting should work fine along with other normal features of the
CLang support.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.14.4
(available in About System)
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2
ADDITIONAL INFORMATION
The workaround for this is use -mcpu=cortex-m4 or a specific CPU of interest
and not to set -march=armv7e-m
When KDevelop is run with KDEV_CLANG_DISPLAY_ARGS=1 environment variable, the
command line of clang is shown. When that command is run on terminal, you see
an error that
error: unknown target CPU 'armv7e-m'
thrown by clang.
This is perhaps the root cause of the issue. The workaround suggested above
actually works because clang ignores -mcpu=... argument, but gcc does not.
It would be good if someone can look into a way to make march setting work
because for all practical reasons C or C++ syntax is not dependent on the
architecture.
--
You are receiving this mail because:
You are watching all bug changes.