Preload errors while building C/C++ within Docker


  • Scanner: sonar-scanner-cli-
  • SQ:

The project I’m working on is built within a docker container running wind river linux v7 using cmake:

PACKAGE_NAME=${packageName} VERSION_NUMBER=${version} ./build-wrapper-linux-x86-64 --out-dir . cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 $verboseCmakeArgs --build ../src

($verboseCmakeArgs is empty)

While building, the following message is spammed:

ERROR: object '/home/gwuser/dt4-bacnet/libinterceptor-${PLATFORM}.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

And when the sonar scanner is executed, it finishes with:

04:18:02.433 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * you are correctly invoking the scanner with correct configuration
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * you are providing the path to the correct build-wrapper output directory
  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps

I was previously having issues where build-wrapper-dump.json would return empty, moving and creating the following symlink fixed this:

mv && ln -s

In my attempts to figure out the issue I’ve tried creating a symlink to the other libinterceptor-*.so files thinking it was confused being in a docker container, but no luck.

Both build-wrapper.log & build-wrapper-dump.json are populated with relevant details, although I would prefer to keep them private.

Any assistance or tips would be appreciated.

I am facing the exact same issue. Did you find a solution? Thanks!

Hello @pferrot_sat,

The initial poster found a solution but did not explain the details of what he did. If you are facing something similar, you should probably open a new thread with as many details as you can.

Thanks for your reply @JolyLoic. I ended up using compilation database rather than build wrapper.

1 Like