parser: fix building with link time optimization (lto)
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
Activity
@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@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
mentioned in issue #214 (closed)
mentioned in commit 5001431c
mentioned in commit bc952a5c