Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please don't build tests with -O0 #32

Open
AdrianBunk opened this issue Aug 24, 2024 · 0 comments
Open

Please don't build tests with -O0 #32

AdrianBunk opened this issue Aug 24, 2024 · 0 comments

Comments

@AdrianBunk
Copy link

AdrianBunk commented Aug 24, 2024

Building tests was changed to -O0 in commit a4ca3d1.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant