mirror of
https://github.com/netdata/netdata.git
synced 2025-03-18 06:43:02 +00:00
Fixed builds using particular versions of Clang. (#10155)
* Add a CI check for building against Clang * Fix CFLAGS for libmosquitto/libwebsockets so builds work with Clang * Add fixes for libbpf, judy, and JSON-C. Co-authored-by: James Mills <prologic@shortcircuit.net.au>
This commit is contained in:
parent
9d24ef483b
commit
fddc851088
3 changed files with 32 additions and 5 deletions
18
.github/dockerfiles/Dockerfile.clang
vendored
Normal file
18
.github/dockerfiles/Dockerfile.clang
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
FROM debian:buster AS build
|
||||
|
||||
# Disable apt/dpkg interactive mode
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install all build dependencies
|
||||
COPY packaging/installer/install-required-packages.sh /tmp/install-required-packages.sh
|
||||
RUN /tmp/install-required-packages.sh --dont-wait --non-interactive netdata-all
|
||||
|
||||
# Install Clang and set as default CC
|
||||
RUN apt-get install -y clang && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
|
||||
|
||||
WORKDIR /netdata
|
||||
COPY . .
|
||||
|
||||
# Build Netdata
|
||||
RUN ./netdata-installer.sh --dont-wait --dont-start-it --disable-go --require-cloud
|
9
.github/workflows/checks.yml
vendored
9
.github/workflows/checks.yml
vendored
|
@ -53,6 +53,15 @@ jobs:
|
|||
autoreconf -ivf;
|
||||
./configure;
|
||||
make;'
|
||||
clang-checks:
|
||||
name: Clang
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
docker build -f .github/dockerfiles/Dockerfile.clang .
|
||||
dist-checks:
|
||||
name: Dist
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -535,7 +535,7 @@ build_libmosquitto() {
|
|||
local env_cmd=''
|
||||
|
||||
if [ -z "${DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS}" ]; then
|
||||
env_cmd="env CFLAGS= CXXFLAGS= LDFLAGS="
|
||||
env_cmd="env CFLAGS=-fPIC CXXFLAGS= LDFLAGS="
|
||||
fi
|
||||
|
||||
if [ "$(uname -s)" = Linux ]; then
|
||||
|
@ -615,7 +615,7 @@ build_libwebsockets() {
|
|||
local env_cmd=''
|
||||
|
||||
if [ -z "${DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS}" ]; then
|
||||
env_cmd="env CFLAGS= CXXFLAGS= LDFLAGS="
|
||||
env_cmd="env CFLAGS=-fPIC CXXFLAGS= LDFLAGS="
|
||||
fi
|
||||
|
||||
pushd "${1}" > /dev/null || exit 1
|
||||
|
@ -697,7 +697,7 @@ build_judy() {
|
|||
local env_cmd=''
|
||||
|
||||
if [ -z "${DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS}" ]; then
|
||||
env_cmd="env CFLAGS= CXXFLAGS= LDFLAGS="
|
||||
env_cmd="env CFLAGS=-fPIC CXXFLAGS= LDFLAGS="
|
||||
fi
|
||||
|
||||
pushd "${1}" > /dev/null || return 1
|
||||
|
@ -780,7 +780,7 @@ build_jsonc() {
|
|||
local env_cmd=''
|
||||
|
||||
if [ -z "${DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS}" ]; then
|
||||
env_cmd="env CFLAGS= CXXFLAGS= LDFLAGS="
|
||||
env_cmd="env CFLAGS=-fPIC CXXFLAGS= LDFLAGS="
|
||||
fi
|
||||
|
||||
pushd "${1}" > /dev/null || exit 1
|
||||
|
@ -851,7 +851,7 @@ bundle_jsonc
|
|||
|
||||
build_libbpf() {
|
||||
pushd "${1}/src" > /dev/null || exit 1
|
||||
run env CFLAGS= CXXFLAGS= LDFLAGS= BUILD_STATIC_ONLY=y OBJDIR=build DESTDIR=.. make install
|
||||
run env CFLAGS=-fPIC CXXFLAGS= LDFLAGS= BUILD_STATIC_ONLY=y OBJDIR=build DESTDIR=.. make install
|
||||
popd > /dev/null || exit 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue