Skip to content

Configuration fails while compiling BoringSSL #347

@alecov

Description

@alecov

Summary

Cmake fails to configure the build (GCC 15.2) due to a compilation error during BoringSSL:

make[3]: warning: -j8 forced in submake: resetting jobserver mode.
In file included from /xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/bcm.c:31:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h: In function ‘OPENSSL_memchr’:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h:1027:10: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 1027 |   return memchr(s, c, n);
      |          ^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [CMakeFiles/fipsmodule.dir/build.make:79: CMakeFiles/fipsmodule.dir/crypto/fipsmodule/bcm.c.o] Error 1

This is GCC 15.2.1, which defaults to gnu23, which imposes memchr() and others should return const pointers when passed arguments are const -- then compilation fails due to -Werror.

Expected behavior

The project would configure without problems.

Actual behavior

The project doesn't configure properly.

Relevant log output

make[3]: warning: -j8 forced in submake: resetting jobserver mode.
In file included from /xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/bcm.c:31:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h: In function ‘OPENSSL_memchr’:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h:1027:10: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 1027 |   return memchr(s, c, n);
      |          ^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [CMakeFiles/fipsmodule.dir/build.make:79: CMakeFiles/fipsmodule.dir/crypto/fipsmodule/bcm.c.o] Error 1

Possible Solution

The proper solution is BoringSSL upstream fixing their codebase to C23; or upstream properly setting -std=c17 or whatever they're using; or simply removing -Werror=discarded-qualifiers.

A workaround is to set -Wno-error=discarded-qualifiers during the build of this particular dependency, but I'm not sure how to do it with this Hunter thing. Any help is appreciated.

Version

v0.1.37

Would you like to work on fixing this bug ?

Maybe

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

    Issue actions