Skip to content
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

CodeChecker log does not work for 32bits binaries on 64bits platform #4312

Closed
dkrupp opened this issue Aug 14, 2024 · 1 comment · Fixed by #4314
Closed

CodeChecker log does not work for 32bits binaries on 64bits platform #4312

dkrupp opened this issue Aug 14, 2024 · 1 comment · Fixed by #4314
Assignees
Labels

Comments

@dkrupp
Copy link
Member

dkrupp commented Aug 14, 2024

Logging is successful on a 64 bits binary:

CodeChecker` log -b "./builder64" -o ./compile_command64.json
[INFO 2024-08-14 14:09] - Starting build...
[INFO 2024-08-14 14:09] - Using CodeChecker ld-logger.
[INFO 2024-08-14 14:09] - Build finished successfully.
(CodeChecker venv-dev) ednikru@seliiuvd02700[14:09][workspace/test_files/codechecker_loggin_test]$ cat compile_command64.json 
[
        {
                "directory": "/local/workspace/test_files/codechecker_loggin_test",
                "command": "/usr/bin/gcc ./test.c",
                "file": "./test.c"
        }
]

And it fails for 32 bit binary (on a 64 bits machine):

(CodeChecker venv-dev) ednikru@seliiuvd02700[14:10][workspace/test_files/codechecker_loggin_test]$ CodeChecker log -b "./builder32" -o ./compile_command32.json
[INFO 2024-08-14 14:10] - Starting build...
[INFO 2024-08-14 14:10] - Using CodeChecker ld-logger.
ERROR: ld.so: object '/local/workspace/codechecker/build/CodeChecker/ld_logger/lib/x86_64/ldlogger.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
[INFO 2024-08-14 14:10] - Build finished successfully.
`
builder.c
`
#include<stdlib.h>
int main(void){
  const char* command="gcc ./test.c";
  system(command);
  return 0;
}

gcc ./builder.c -m32 -o builder32

@dkrupp dkrupp self-assigned this Aug 14, 2024
@dkrupp dkrupp added this to the release 6.24.1 milestone Aug 14, 2024
@dkrupp
Copy link
Member Author

dkrupp commented Aug 14, 2024

Looks like this PR changed the behaviour in CodeChecker:

https://github.com/Ericsson/codechecker/pull/3919/files

the ld_logger.so binary is selected based on the host OS platform instead of the executed binary...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant