On Thu, Aug 18, 2022 at 11:00:24AM -0700, Chris Lamb wrote:
Hey Alberto,
Just briefly reaching out to you just in case this slipped your mind
during your time away from the internet. Hopefully, it's quite an easy
fix.
Indeed it had sneakily gone away from my TODO list, so thanks for the
reminder!
On 20 July 2022 00:18:29 GMT-06:00, Chris Lamb <la...@debian.org> wrote:
Hi Alberto,
Any ideas why libfiu fails to build with -flto=auto -ffat-lto-objects
(etc.) enabled?
Just FYI I have extremely limited connectivity until the end of the
month, so I'm afraid I won't have a chance to look before then :(
cc -I../../libfiu/ -L../../libfiu/ -D_XOPEN_SOURCE=600 -D_GNU_SOURCE
-fPIC -DFIU_ENABLE=1 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=.
-flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat
-Werror=format-security -std=c99 -pedantic -Wall -std=c99 -pedantic
-Wall tests/strdup.c -lfiu -o tests/strdup.bin
LD_LIBRARY_PATH=../libfiu/
LD_PRELOAD=./libs/fiu_run_preload.so:./libs/fiu_posix_preload.so
./test-enable_stack
test-enable_stack: test-enable_stack.c:39: main: Assertion `func2() ==
1' failed.
From this it seems the issue is with the stack trace collection. If LTO
is doing some inlining for example (which wouldn't surprise me) then it
could cause the test to fail.
That's exactly what's happening: "-flto=auto -O2" was causing one of the
functions of the stack to be inlined, and causing the tests to fail.
Patch
https://blitiri.com.ar/git/r/libfiu/c/902b282375587352dccf6467fa740330d6900e54/
(currently on the `next` branch, I'll move it to `master` once you
confirm it fixes the issue in the automated builds too) should fix this
issue.
Thanks a lot!
Alberto
PS: That patch can be downloaded in text format from
https://blitiri.com.ar/git/r/libfiu/c/902b282375587352dccf6467fa740330d6900e54.patch