#2 ./configure --strict fails with clang
Closed 2 months ago by orbea. Opened 2 months ago by orbea.

OS: Gentoo
clang 17.0.6
sofort: slibtool/1769a44c3e2be2f6b309bef929a4d685072619b6

With clang sofort fails when using --strict.

configure was able to generate a Makefile for the selected host,
however the host-targeting compiler was found to be missing
at least one of the required headers or features.
$ ./configure --strict
slibtool : configure : init_vars  .................................  OK.
slibtool : configure : verify_build_directory  ....................  OK.
slibtool : configure : verify_source_directory  ...................  OK.
slibtool : configure : verify_source_info  ........................  OK.
slibtool : configure : common_defaults  ...........................  OK.
slibtool : configure : config_flags  ..............................  OK.
slibtool : configure : config_copy  ...............................  OK.
 ..
slibtool : configure : detect and query host (targeted) system
 == checking for C compiler  ...................................  clang.
 == checking for C pre-processor  ..........................  clang-cpp.
 == checking for C++ compiler  ...............................  clang++.
 == checking for ar  ..............................................  ar.
 == checking for nm  ..............................................  nm.
 == checking for objdump  ....................................  objdump.
 == checking for ranlib  ......................................  ranlib.
 == checking for size  ..........................................  size.
 == checking for strip  ........................................  strip.
 == checking for strings  ....................................  strings.
 == checking for objcopy  ....................................  objcopy.
 == checking for addr2line  ................................  addr2line.
 == checking for cov  .......................................  llvm-cov.
 == checking for elfedit  ....................................  elfedit.
 == checking for readelf  ....................................  readelf.
 == checking for readobj  ...............................  llvm-readobj.
 == checking for otool  ...................................  llvm-otool.
 == checking for perk  .........................................  false.
 == checking for mdso  .........................................  false.
 == checking for dlltool  ....................................  dlltool.
 == checking for windmc  .......................................  false.
 == checking for windres  ....................................  windres.
 == checking for pkgconf  ....................................  pkgconf.
 == checking for as (asm)  ........................................  as.
 == checking for as (ll)  ....................................  llvm-as.
 == checking for as (mc)  ....................................  llvm-mc.
 == checking for ld (bfd)  ....................................  ld.bfd.
 == checking for ld (gold)  ....................................  false.
 == checking for ld (lld)  .......................................  lld.
 == checking for objdump (bfd)  ................................  false.
 == checking for objdump (llvm)  ........................  llvm-objdump.
 == checking for readelf (bfd)  ................................  false.
 == checking for readelf (llvm)  ........................  llvm-readelf.
 == detect host system  .....................  x86_64-gentoo-linux-musl.
 == detect host bits  .............................................  64.
 == detect host binary format  ...................................  ELF.
 == detect host prepended underscores .............................  no.
 == detect host os name  .......................................  linux.
 == detect host os semantics  ...................  elf-posix-linux-ldso.
 == detect host os dso format  ...................................  ELF.
 == detect host os dso exrules  ..............................  default.
 == detect host os linkage  ..................................  default.
 == trying host compiler visibility attr: default  ..............  (ok).
 == trying host compiler visibility attr: hidden  ...............  (ok).
 == trying host compiler visibility attr: internal  .............  (ok).
 == trying host compiler visibility attr: protected  ............  (ok).
 == trying host compiler switch: -O0  .....................  (accepted).
 == trying host compiler switch: -O1  .....................  (accepted).
 == trying host compiler switch: -O2  .....................  (accepted).
 == trying host compiler switch: -O3  .....................  (accepted).
 == trying host compiler switch: -Os  .....................  (accepted).
 == trying host compiler switch: -Wall  ...................  (accepted).
 == trying host compiler switch: -Werror  .................  (accepted).
 == trying host compiler switch: -Wextra  .................  (accepted).
 == trying host compiler switch: -Wpedantic  ..............  (accepted).
 == trying host compiler switch: -Wundef  .................  (accepted).
 == trying host compiler switch: -dumpmachine  ............  (accepted).
 == trying host compiler switch: -g  ......................  (accepted).
 == trying host compiler switch: -g0  .....................  (accepted).
 == trying host compiler switch: -g1  .....................  (accepted).
 == trying host compiler switch: -g2  .....................  (accepted).
 == trying host compiler switch: -g3  .....................  (accepted).
 == trying host compiler switch: -print-file-name=  .......  (accepted).
 == trying host compiler switch: -std=c11  ................  (accepted).
 == trying host compiler switch: -std=c89  ................  (accepted).
 == trying host compiler switch: -std=c99  ................  (accepted).
 == trying host compiler switch: -Wl,--no-undefined  .........  (error).
 == trying host compiler switch: -Wl,--print-map  ............  (error).
 == trying host compiler switch: -Wl,--verbose  ..............  (error).
 ..
slibtool : configure : detect and query native (local build) system
 == checking for C compiler  ......................................  cc.
 == checking for C pre-processor  ................................  cpp.
 == checking for C++ compiler  ...................................  c++.
 == checking for ar  ..............................................  ar.
 == checking for nm  ..............................................  nm.
 == checking for objdump  ....................................  objdump.
 == checking for ranlib  ......................................  ranlib.
 == checking for size  ..........................................  size.
 == checking for strip  ........................................  strip.
 == checking for strings  ....................................  strings.
 == checking for objcopy  ....................................  objcopy.
 == checking for addr2line  ................................  addr2line.
 == checking for cov  .......................................  llvm-cov.
 == checking for elfedit  ....................................  elfedit.
 == checking for readelf  ....................................  readelf.
 == checking for readobj  ...............................  llvm-readobj.
 == checking for otool  ...................................  llvm-otool.
 == checking for perk  .........................................  false.
 == checking for mdso  .........................................  false.
 == checking for dlltool  ....................................  dlltool.
 == checking for windmc  .......................................  false.
 == checking for windres  ....................................  windres.
 == checking for pkgconf  ....................................  pkgconf.
 == checking for as (asm)  ........................................  as.
 == checking for as (ll)  ....................................  llvm-as.
 == checking for as (mc)  ....................................  llvm-mc.
 == checking for ld (bfd)  ....................................  ld.bfd.
 == checking for ld (gold)  ....................................  false.
 == checking for ld (lld)  .......................................  lld.
 == checking for objdump (bfd)  ................................  false.
 == checking for objdump (llvm)  ........................  llvm-objdump.
 == checking for readelf (bfd)  ................................  false.
 == checking for readelf (llvm)  ........................  llvm-readelf.
 == detect native system  ...................  x86_64-gentoo-linux-musl.
 == detect native bits  ...........................................  64.
 == detect native binary format  .................................  ELF.
 == detect native prepended underscore.............................  no.
 == detect native os name  .....................................  linux.
 == detect native os semantics  .................  elf-posix-linux-ldso.
 == detect native os dso format  .................................  ELF.
 == detect native os dso exrules  ............................  default.
 == detect native os linkage  ................................  default.
 == trying native compiler visibility attr: default  ............  (ok).
 == trying native compiler visibility attr: hidden  .............  (ok).
 == trying native compiler visibility attr: internal  ...........  (ok).
 == trying native compiler visibility attr: protected ...........  (ok).
 == trying native compiler switch: -O0  ...................  (accepted).
 == trying native compiler switch: -O1  ...................  (accepted).
 == trying native compiler switch: -O2  ...................  (accepted).
 == trying native compiler switch: -O3  ...................  (accepted).
 == trying native compiler switch: -Os  ...................  (accepted).
 == trying native compiler switch: -Wall  .................  (accepted).
 == trying native compiler switch: -Werror  ...............  (accepted).
 == trying native compiler switch: -Wextra  ...............  (accepted).
 == trying native compiler switch: -Wpedantic  ............  (accepted).
 == trying native compiler switch: -Wundef  ...............  (accepted).
 == trying native compiler switch: -dumpmachine  ..........  (accepted).
 == trying native compiler switch: -g  ....................  (accepted).
 == trying native compiler switch: -g0  ...................  (accepted).
 == trying native compiler switch: -g1  ...................  (accepted).
 == trying native compiler switch: -g2  ...................  (accepted).
 == trying native compiler switch: -g3  ...................  (accepted).
 == trying native compiler switch: -print-file-name=  .....  (accepted).
 == trying native compiler switch: -std=c11  ..............  (accepted).
 == trying native compiler switch: -std=c89  ..............  (accepted).
 == trying native compiler switch: -std=c99  ..............  (accepted).
 == trying native compiler switch: -Wl,--no-undefined .....  (accepted).
 == trying native compiler switch: -Wl,--print-map  .......  (accepted).
 == trying native compiler switch: -Wl,--verbose  .........  (accepted).
 ..
slibtool : configure : config_copy  ...............................  OK.
 ..
slibtool : configure : invoking project-specific cfgdefs.sh
 == trying host header: sys/syscall.h  .........................  -----.
 ..
slibtool : configure : config_copy  ...............................  OK.
slibtool : configure : config_cfghost  ............................  OK.
slibtool : configure : config_host  ...............................  
configure was able to generate a Makefile for the selected host,
however the host-targeting compiler was found to be missing
at least one of the required headers or features.

Looking at config.log I see two obvious issues where the first warning occurs in several places while the second occurs in one.

<stdin>:1:25: error: no newline at end of file [-Werror,-Wnewline-eof]
    1 | #include <sys/syscall.h>
      |                         ^
<stdin>:1:25: error: ISO C requires a translation unit to contain at least one declaration [-Werror,-Wempty-translation-unit]
2 errors generated.

Also would it not be better if ./configure tests used -Werror regardless if --strict was used or not?

Additionally after reproducing this issue it leaves configure in a broken state.

$ ./configure 
rmdir: failed to remove './ccenv': Directory not empty
$ ./configure --help
rmdir: failed to remove './ccenv': Directory not empty
$ make clean
Makefile:158: ccenv/host.mk: No such file or directory
make: *** No rule to make target 'ccenv/host.mk'.  Stop

Metadata Update from @orbea:
- Issue status updated to: Closed (was: Open)

2 months ago

Login to comment on this ticket.

Metadata