Skip to content

Please don't build tests with -O0 #32

Open
@AdrianBunk

Description

@AdrianBunk

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @AdrianBunk

        Issue actions

          Please don't build tests with -O0 · Issue #32 · google/libnop