Closed DL6ER closed 1 month ago
Opening this PR in draft mode as I first want to add another CI step that ensures compilation fails on clang
warnings as well. FOr this, we need to create new ftl-build
containers including clang
.
Unfortunately, there is currently a bug in alpine:edge
that prevents us from creating new containers. While they updated gcc
, they did not recompile libgmp
using this new compiler, so far. This leads to a fatal error during linking time:
lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../lib/libgmp.a' generated with LTO version 13.0 instead of the expected 13.1
compilation terminated.
lto-wrapper: fatal error: /usr/bin/cc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
The proper fix for this to have the alpine
team recompile libgmp
as they seem to have done with most other packages already. See similar error 1 and 2 on ArchLinux.
Bug report opened upstream https://gitlab.alpinelinux.org/alpine/aports/-/issues/16121
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved.
The upstream bug has been fixed in alpine:edge
via alpine/aports@6867589a.
This PR is done. It now awaits the decision on https://github.com/pi-hole/docker-base-images/pull/94 and will then uses the tagged container (v2.6
) as CI build environment.
Ready for review + merge
All changes were some due to compiler warnings triggered by the new C standard and additional warnings due to using clang
next to gcc
. No functional changes have been made.
I'm the particular case you found they were actually never used and clang
complained about work being some without getting the result of it at any point. Assembly inspection showed that gcc
chose to instead optimize these computations away silently.
What does this implement/fix?
Add Clang compiler support, tested with
C17 is the informal name for ISO/IEC 9899:2018 and was published in June 2018. It replaced C11 and will eventually be superseded by C23 when it is published. C17 fixes numerous minor defects in C11 without introducing new language features. It required a number of subtle code changes without any real changes. We also bump the required minimum CMake version to the lowest version supporting the C17 standard.
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.