libnop icon indicating copy to clipboard operation
libnop copied to clipboard

Please don't build tests with -O0

Open AdrianBunk opened this issue 6 months ago • 0 comments

Building tests was changed to -O0 in commit a4ca3d14c1ae8297c286626fa347125ed2c30297.

3 reasons why the tests should be built with default optimizations:

  1. 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
  1. 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

  2. Many compiler warnings depend on optimizations, the reason why I am not submitting a pull request is that removing the -O0 from Makefile results in build errors due to the -Werror. These out of bounds accesses in serializer_tests.cpp might just be test issues or even real bugs

AdrianBunk avatar Aug 24 '24 15:08 AdrianBunk