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

Add UA_ENABLE_INTERPROCEDURAL_OPTIMIZATION CMake option to disable interprocedural optimization #3210

Open
7 tasks done
traversaro opened this issue Oct 25, 2019 · 1 comment

Comments

@traversaro
Copy link
Contributor

traversaro commented Oct 25, 2019

Description

After #1732 , the CMAKE_INTERPROCEDURAL_OPTIMIZATION global CMake option is always enabled if the compiler supports it. In gcc, this adds the -flto flag, that cannot be removed via UA_ARCH_REMOVE_FLAGS because it is added by CMake itself.
However, in some cases you may want to disable IPO even if your compilers supports it, for example if your linker has problem with it. In those cases, it would be convenient to have a UA_ENABLE_INTERPROCEDURAL_OPTIMIZATION CMake option, that by default is ON and that would permit to disable the IPO.

If you are ok with this idea, I would be happy to open a PR implementing it.

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): v1.0
  • Other OPC UA SDKs used (client or server):
  • Operating system:
  • Logs (with UA_LOGLEVEL set as low as necessary) attached
  • Wireshark network dump attached
  • Self-contained code example attached
  • Critical issue: no
@traversaro traversaro changed the title Add option to disable Add option to disable interprocedural optimization Oct 25, 2019
@traversaro traversaro changed the title Add option to disable interprocedural optimization Add UA_ENABLE_INTERPROCEDURAL_OPTIMIZATION CMake option to disable interprocedural optimization Oct 25, 2019
@jpfr
Copy link
Member

jpfr commented Oct 25, 2019

I'm hesitant to put in a build flag for everything.
We should use CMake defaults and keep the build system as simple as possible.

I'd prefer either of the following

  • The CheckIPOSupported CMake package could already provide manual overrides
  • Local patching of the CMakeLists.txt

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

No branches or pull requests

2 participants