Hi,
we are using the following Sonarqube setup:
- SonarQube Scanner 3.2.0.1227
- SonarCFamily 6.0.0.10816 (cpp)
The SonarQube Scanner runs inside a docker linux-container.
- Java 1.8.0_191 Oracle Corporation (64-bit)
- Linux 4.15.0-43-generic amd64
This container is running on a jenkins job in our CI/CD toolchain.
Our C++ project is build with ninja and uses the arm compiler and it compiles successful.
- ninja 1.8.2
- Arm Compiler 6.10
We use the build-wrapper to catch the information of the compiler.
/opt/sonar-build/build-wrapper-linux-x86-64 --out-dir bw-outputsv6 ninja Target_1
The resulting log file looks good to me.
In a another step we use the sonar scanner with the cfamily plugin to analyze our code.
sonar-scanner -X -Dsonar.host.url=XXX -Dsonar.projectKey=YYY -Dsonar.language=cpp -Dsonar.sources=. -Dsonar.objc.file.suffixes=- -Dsonar.cfamily.build-wrapper-output=./bw-outputsv6/ -Dsonar.sourceEncoding=UTF-8
The file is found by the CFamily plugin.
15:44:24.849 INFO: Sensor CFamily [cpp]
15:44:24.850 INFO: Using build-wrapper output: /home/jenkins/workspace/Project/Sourcen/100_Arbeit/./bw-outputsv6/build-wrapper-dump.json
15:44:24.850 INFO: Available processors: 1
15:44:24.850 INFO: Using 1 thread for analysis according to value of “sonar.cfamily.threads” property.
15:44:24.850 DEBUG: Unpacking analyzer to: /home/jenkins/workspace/Project/Sourcen/100_Arbeit/.scannerwork/.sonartmp/743351237207951652
15:44:26.332 DEBUG: ‘main.cpp’ generated metadata with charset ‘windows-1252’
15:44:26.347 DEBUG: Not enough content in ‘main.cpp’ to have CPD blocks, it will not be part of the duplication detection
15:44:26.351 WARN: Metric ‘comment_lines_data’ is deprecated. Provided value is ignored.
15:44:26.387 DEBUG: ‘SystemCoreClock.cpp’ generated metadata with charset ‘UTF-8’
But while the probing the arm 6 compiler we got an error. We get the following message:
15:44:26.415 DEBUG: Probing compiler: [/usr/local/ARM_Compiler/bin/armclang, -x, c++, --std, c++11, -target, arm-arm-none-eabi, -v, -dM, -E, -]
15:44:26.511 DEBUG: stdout:15:44:26.512 DEBUG: stderr:
Product: MDK-ARM Essential 5.26 (Flex)
Component: ARM Compiler 6.6
Tool: armclang [5c77f600]Target: arm-arm-none-eabi
armclang: error: ARMv4 is not supported by this toolchain
The armclang cannot tested successfully. I think the problem is the last minus sign in compiler probe. If I the following command every thing works fine:
armclang -x c++ --std c++11 -target arm-arm-none-eabi -v -dM -E
output
root@44f11bdaf4b1:/# /usr/local/ARM_Compiler/bin/armclang -x c++ --std c++11 -target arm-arm-none-eabi -v -dM -E
Product: MDK-ARM Essential 5.26 (Flex)
Component: ARM Compiler 6.10
Tool: armclang [5d142f00]
But if I add the last minus, then I got the same output
armclang -x c++ --std c++11 -target arm-arm-none-eabi -v -dM -E -
output:
root@44f11bdaf4b1:/# /usr/local/ARM_Compiler/bin/armclang -x c++ --std c++11 -target arm-arm-none-eabi -v -dM -E -
Product: MDK-ARM Essential 5.26 (Flex)
Component: ARM Compiler 6.10
Tool: armclang [5d142f00]Target: arm-arm-none-eabi
armclang: error: ARMv4 is not supported by this toolchain
Information about this error is available at: Arm Development Studio
General licensing information is available at: Arm Development Studio
If you need further help, provide this complete error report to your supplier or license.support@arm.com.
- ARMLMD_LICENSE_FILE: ‘XXX@QQQQ’
- LM_LICENSE_FILE: unset
- ARM_TOOL_VARIANT: ‘mdk_cm_std_flex’
- ARM_PRODUCT_PATH: unset
- Product location: /usr/local/ARM_Compiler/sw/mappings
- Toolchain location: /usr/local/ARM_Compiler/lib/tt_default/bin
- Selected tool variant: mdk_cm_std_flex
armclang: error: ARM Compiler does not support ‘-target=arm-arm-none-eabi’
I have already tested another version of the arm compiler (6.6) but there is the same issue.
Is it possible to change the compiler flags that are passed to the compiler?
Or does anyone have an other idea?
Thanks Thorsten