Skip to content
Snippets Groups Projects

parser: fix building with link time optimization (lto)

Merged Georgia Garcia requested to merge georgiag/apparmor:parser-lto into master
1 unresolved thread

Libapparmor was fixed for lto builds on commit 7cde91f5 but the parser was also failing due to the same reasons when lto was enabled.

Fixes: #214 (closed) Signed-off-by: Georgia Garcia georgia.garcia@canonical.com

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • @georgiag could you replicate the failure and then have this fix it? Building the parser with -flto against a fixed lib doesn't fail even without this. The question is why, and if someone else has been able to replicate

      From the error

      /tmp/cc59WQWy.s: Error: invalid attempt to declare external version name as default in symbol `change_hat@@APPARMOR_1.0'

      I believe this is still a library build issue. We are not explicitly exporting the change_hat@@APPARMOR_1.0 symbol, and its possible that this is resulting in the library build having this stripped. That is not the case locally but perhaps with a different version of gcc.

      Edited by John Johansen
    • Author Maintainer

      @jjohansen I was only able to replicate the issue on an arch VM. The weird thing is that with the "same" version of gcc/g++, I was not able to reproduce the issue on ubuntu:

      gcc version on arch where issue happens:

      [root@arch ~]# gcc --version
      gcc (GCC) 11.2.0

      gcc version on ubuntu where the issue does not happen:

      root@impish:~# gcc --version
      gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0

      either way, this MR fixes it on arch, but I wasn't able to identify the root cause

    • Please register or sign in to reply
  • mentioned in issue #214 (closed)

  • John Johansen approved this merge request

    approved this merge request

  • Georgia Garcia mentioned in commit 5001431c

    mentioned in commit 5001431c

  • Georgia Garcia mentioned in commit bc952a5c

    mentioned in commit bc952a5c

  • cherry-picked to 3.0

Please register or sign in to reply
Loading