libnop
libnop copied to clipboard
Please don't build tests with -O0
Building tests was changed to -O0
in commit a4ca3d14c1ae8297c286626fa347125ed2c30297.
3 reasons why the tests should be built with default optimizations:
- C++ code compiled with
-O0
can be very inefficient, in this case it causes build failures on some more exotic architectures (Alpha, MIPS): https://buildd.debian.org/status/fetch.php?pkg=libnop&arch=mips64el&ver=0.0~git20200728.45dfe0f-4%2Bb1&stamp=1723833797&raw=0 https://buildd.debian.org/status/fetch.php?pkg=libnop&arch=alpha&ver=0.0~git20200728.45dfe0f-4&stamp=1723836309&raw=0
/usr/bin/ld: out/host-obj/test/test/serializer_tests.o: .got subsegment exceeds 64K (size 76864)
/usr/bin/ld: failed to set dynamic section sizes: Success
collect2: error: ld returned 1 exit status
-
You are not testing the code of this header-only the way others will likely use it with normal optimizations options, which might affect the test results
-
Many compiler warnings depend on optimizations, the reason why I am not submitting a pull request is that removing the
-O0
fromMakefile
results in build errors due to the-Werror
. These out of bounds accesses inserializer_tests.cpp
might just be test issues or even real bugs