Build wrapper for mips

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    sonarqube-enterprise-8.6.0 sonar-scanner-4.5.0
  • what are you trying to achieve
  • what have you tried so far to achieve this

SonarQube version: sonarqube-enterprise-8.6.0
Scanner version: sonar-scanner-4.5.0

I tried to use build-wrapper with mips gcc to scan my C code, but the output json file is empty.

it only show:
{
“version”:“6.15”,
“captures”:[
]}

the part of build-wrapper log as follow:
Wed Jan 13 11:07:53 2021: executing: <mips64_cn7xxx-octeon3-buildroot_ctng-linux-gcc -o main main.c>
Wed Jan 13 11:07:53 2021: initializing json file
Wed Jan 13 11:07:53 2021: process created with pid: 4807
Wed Jan 13 11:07:53 2021: parent pid: 4806
Wed Jan 13 11:07:53 2021: working directory: </home/test/test_code>
Wed Jan 13 11:07:53 2021: executable: </usr/local/bin/build-wrapper-linux-x86-64>
Wed Jan 13 11:07:53 2021: argv[0]:
Wed Jan 13 11:07:53 2021: argv[1]: <-c>
Wed Jan 13 11:07:53 2021: argv[2]: <>
Wed Jan 13 11:07:53 2021: argv[3]: <mips64_cn7xxx-octeon3-buildroot_ctng-linux-gcc>
Wed Jan 13 11:07:53 2021: argv[4]: <-o>
Wed Jan 13 11:07:53 2021: argv[5]:
Wed Jan 13 11:07:53 2021: argv[6]: <main.c>
Wed Jan 13 11:07:53 2021: skipping process with pid: 4807
Wed Jan 13 11:07:53 2021: finalizing json file
Wed Jan 13 11:07:53 2021: returned with code: 0

Thanks for helping.

Hi @felixchen,

is mips64_cn7xxx-octeon3-buildroot_ctng-linux-gcc statically linked? If yes, that is the cause of the issue.

Hi @mpaladin

yes, it’s statically linked.

Is there another solution?

Hi @felixchen,

build-wrapper uses dynamic library concept to capture the executed processes, this approach doesn’t work with statically linked binaries. You have two options:

  • use a dynamically linked compiler
  • add a wrapper to the compiler which would be captured by build-wrapper, its role would just be to invoke the real compiler and allow build-wrapper to capture its execution
1 Like

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.