Skip to content

[clang] build broken "gcc: No such file or directory" #2976

@peppergrayxyz

Description

@peppergrayxyz

The build using clang fails with an error while calling gcc

$ make
Note: Building without setproctitle() support.
      Install libbsd-devel (RPM) / libbsd-dev (DEB) to fix.
Note: Building with amdgpu_plugin.
Warn: Externally managed python environment
Consider using PIP_BREAK_SYSTEM_PACKAGES=1
  GEN      .gitid
  GEN      criu/include/version.h
  DEP      images/stats.pb-c.d
make[1]: gcc: No such file or directory

...

The missing setproctitle() support also originiates from this bug:

$ make SHELL='sh -x'

...

+ sh -c $'echo "#include <bsd/string.h>int main(void){\treturn 0;}" | gcc -O2 -g   -Wall -Wformat-security -Wdeclaration-after-statement -Wstrict-prototypes -Wno-dangling-pointer -Wno-unknown-warning-option -Werror -DCONFIG_AARCH64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -iquote include/   -x c - -lbsd -o /dev/null > /dev/null 2>&1 && echo true || echo false'
Note: Building without setproctitle() support.
      Install libbsd-devel (RPM) / libbsd-dev (DEB) to fix.

The issue is hidden from CI because the docker images have clang and gcc installed and therefore silently fall back to using gcc:

$ make -C scripts/ci alpine CLANG=1

...

+ LOCAL_COMPILE_FLAGS=("V=1")
+ gcc --version
+ make CC=gcc -j4 V=1
gcc (Alpine 15.2.0) 15.2.0

...

protoc --proto_path=images/ --c_out=images/ images/timer.proto
gcc -M -MT images/creds.pb-c.d -MT images/creds.pb-c.o -O2 -g   -Wall -Wformat-security -Wdeclaration-after-statement -Wstrict-prototypes -Wno-dangling-pointer -Wno-unknown-warning-option -Werror -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCONFIG_GNUTLS -DCONFIG_HAS_NFTABLES_LIB_API_1 -DCONFIG_COMPAT -iquote include/ -DCONFIG_GNUTLS -DCONFIG_HAS_NFTABLES_LIB_API_1 -DCONFIG_COMPAT -iquote images/ images/creds.pb-c.c -o images/creds.pb-c.d

...

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