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

ldlogger always built 32 bit #2095

Closed
cleeland opened this issue Apr 24, 2019 · 7 comments
Closed

ldlogger always built 32 bit #2095

cleeland opened this issue Apr 24, 2019 · 7 comments

Comments

@cleeland
Copy link

Describe the bug
At line 86 of the ld-logger Makefile, the executable is always built for 32 bit. This causes problems on 64 bit build hosts that do not have 32 bit dev environments installed.

CodeChecker version
Current master

To Reproduce
Steps to reproduce the behavior

  1. obtain current master
  2. ensure build host does not have 32 bit dev environment
  3. make package
  4. observe quiet build failure in ldlogger

Expected behavior
Build.

Desktop (please complete the following information)

  • OS: CentOS Linux release 7.3.1611 (Core)

Additional context
Removing -m32 seems to solve the problem for me.

@gyorb
Copy link
Contributor

gyorb commented Apr 26, 2019

Yes, we need to do some improvement in the package build configuration.
There are multiple build environments we need to support during logging:

  • 64bit only
    • the case you mentioned, the ldlogger executable and the logger.so is built only for 64bit
  • 64bit OS with a 32bit compiler binary
    • in this case the ldlogger executable could be 64bit (right now it is built for 32bit)
    • we need to build the logger.so for 32bit and 64bit to be able to log compiler calls from both types of binaries
    • to build this type of package you still need the 32bit dev env
    • the question in this case the question is that the 32bit logger.so can call the 64bit executable properly?

@cleeland
Copy link
Author

In the scenario for me, it seems like the build system was trying to build a 64 bit only, in which case asking for 32 bit binary is just plain wrong.

In the second case you mention, what matters is not the OS but the dev environment (compiler + libc). If the dev environment is 32 bit, then you are constrained to only building 32 bit.

I admit that I don't really understand how the ldlogger works, so this question might be a dumb question: when ask whether "32bit logger.so can call the 64bit executable properly?", do you mean that ldlogger32.so literally does a fork/exec? If so, then I don't think there's an issue because the executable gets rendered into its own process.

@gyorb
Copy link
Contributor

gyorb commented Apr 26, 2019

My bad, not they do not fork/exec I just thought that was the case, so that should not be a problem.
I think we will need to update/extend the documentation a bit more for the logger part.

The ldlogger binary can be used as a replacement for CC/CXX environment variables to log the compile commands as a fake compiler, but it does not call the original compiler right now if I'm right.
CodeChecker uses only shared objects to log the compiler calls. We were thinking on the fake compiler solution but it was not finished yet and there was a discussion about an on-the-fly analysis #195 option which could depend on the fake compiler.

@gyorb
Copy link
Contributor

gyorb commented Jun 5, 2019

@cleeland we plan to introduce a new environment variable (BUILD_LOGGER_64_BIT_ONLY) during package build which could be used to build a 64bit only package. You can checkout the details here: #2114

@gyorb
Copy link
Contributor

gyorb commented Jul 2, 2019

With the newly introduced environment variables you should be able to create 64bit only package.
Let us know if you have further problems.

@gyorb gyorb closed this as completed Jul 2, 2019
@gyorb gyorb added this to the release 6.10.0 milestone Jul 2, 2019
@Hoernchen
Copy link

This issue is still not fixed, /analyzer/tools/build-logger/Makefile.manual still contains "$(CC) -m32" for ldlogger, so the 64bit only build with BUILD_LOGGER_64_BIT_ONLY still tries to build a 32bit binary, which fails for me, due to a lack of 32bit dev environment.

@crockeea
Copy link

I've re-opened this ticket as #2790.

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

No branches or pull requests

4 participants