Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938467 - net-analyzer/nagios-plugins-2.4.6 - [llvm] configure: error: <wchar.h> cannot be used with this compiler (clang -O2 -pipe -march=native -fno-diagnostics-colo
Summary: net-analyzer/nagios-plugins-2.4.6 - [llvm] configure: error: <wchar.h> cannot...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michael Orlitzky
URL: https://github.com/nagios-plugins/nag...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-24 18:25 UTC by Toralf Förster
Modified: 2025-04-08 00:50 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,18.45 KB, text/plain)
2024-08-24 18:25 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,83.43 KB, text/plain)
2024-08-24 18:25 UTC, Toralf Förster
Details
environment (environment,37.63 KB, text/plain)
2024-08-24 18:25 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.22 KB, application/x-xz)
2024-08-24 18:25 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,37.59 KB, application/x-xz)
2024-08-24 18:25 UTC, Toralf Förster
Details
logs.tar.xz (logs.tar.xz,20.64 KB, application/x-xz)
2024-08-24 18:25 UTC, Toralf Förster
Details
net-analyzer:nagios-plugins-2.4.6:20240824-175325.log (net-analyzer:nagios-plugins-2.4.6:20240824-175325.log,18.29 KB, text/plain)
2024-08-24 18:25 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,178.55 KB, text/plain)
2024-08-24 18:25 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,263.14 KB, application/x-xz)
2024-08-24 18:25 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-08-24 18:25:23 UTC
checking wctype.h presence... yes
checking for wctype.h... yes
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for C/C++ restrict keyword... __restrict
checking whether <wchar.h> uses 'inline' correctly... no
configure: error: <wchar.h> cannot be used with this compiler (clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int ).
This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
C99 mode. You have four options:

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_llvm_systemd-20240823-074159

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 18.1.8+libcxx
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.8+libcxx
Python 3.12.5
Available Rust versions:
  [1]   rust-bin-1.80.1 *
The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):
go version go1.23.0 linux/amd64

  HEAD of ::gentoo
commit 9e8b1d9817e4e8ab80685a4ec4056a22f0a0bfa7
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Aug 24 17:33:58 2024 +0000

    2024-08-24 17:33:57 UTC

emerge -qpvO =net-analyzer/nagios-plugins-2.4.6
[ebuild  N    ] net-analyzer/nagios-plugins-2.4.6  USE="ipv6 postgres snmp ssl -ldap -mysql -nagios-dns -nagios-game -nagios-ping -radius -samba (-selinux) -ssh"
Comment 1 Toralf Förster gentoo-dev 2024-08-24 18:25:24 UTC
Created attachment 901135 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-08-24 18:25:25 UTC
Created attachment 901136 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-08-24 18:25:26 UTC
Created attachment 901137 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-08-24 18:25:27 UTC
Created attachment 901138 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-08-24 18:25:28 UTC
Created attachment 901139 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-08-24 18:25:29 UTC
Created attachment 901140 [details]
logs.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-08-24 18:25:29 UTC
Created attachment 901141 [details]
net-analyzer:nagios-plugins-2.4.6:20240824-175325.log
Comment 8 Toralf Förster gentoo-dev 2024-08-24 18:25:31 UTC
Created attachment 901142 [details]
qlist-info.txt
Comment 9 Toralf Förster gentoo-dev 2024-08-24 18:25:32 UTC
Created attachment 901143 [details]
temp.tar.xz
Comment 10 Michael Orlitzky gentoo-dev 2024-09-06 01:00:09 UTC
I don't know how you manage to do this so reliably with nagios-plugins :)

Same issue as last time (from config.log):

configure:22080: clang -c -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int  conftest.c >&5
configure:22083: $? = 0
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o is incompatible with elf32-i386
ld.lld: error: conftest1.o is incompatible with elf32-i386
ld.lld: error: conftest2.o is incompatible with elf32-i386

Nothing to do with nagios-plugins, just some toolchain confusion that I dare not guess at.
Comment 11 Toralf Förster gentoo-dev 2024-09-06 07:07:24 UTC
(In reply to Michael Orlitzky from comment #10)
> I don't know how you manage to do this so reliably with nagios-plugins :)

sry - I'd like to blame the tinderbox ;)

> Nothing to do with nagios-plugins, just some toolchain confusion that I dare
> not guess at.

It is related to clang/llvm, right ?
Comment 12 Michael Orlitzky gentoo-dev 2024-09-06 12:09:01 UTC
Oooh don't tell anyone but I was wrong about this. The wchar.h thing isn't the first problem in ./configure, it's just the first *fatal* problem. There are other tests failing, but they are disabling features instead of crashing the build.

The last OK check is,

configure:15014: checking for main in -lcrypt
configure:15033: clang -o conftest -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -L. conftest.c -lcrypt   >&5
configure:15033: $? = 0
configure:15042: result: yes

But then the next one is,

configure:15058: checking for PQsetdbLogin in -lpq
configure:15083: clang -o conftest -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int  -I/usr/include -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -L. -L/usr/lib conftest.c -lpq -lcrypt -lcrypt  >&5
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o is incompatible with elf32-i386

What went wrong is that -L/usr/lib was added to the library search path and it shouldn't be. On a multilib system, it's pulling in the wrong libs. The chunk of configure.ac that corresponds to these checks is,

https://github.com/nagios-plugins/nagios-plugins/blob/master/configure.ac#L219

and I don't know WTF it's doing. For one, it's forgetting to save/restore LDFLAGS which is why -L/usr/lib is getting carried along to subsequent tests. But more to the point.. postgres ships a pg_config executable that tells you this information without having to guess:

  $ pg_config --includedir
  /usr/include/postgresql-16
  $ pg_config --libdir
  /usr/lib64/postgresql-16/lib64

So it could be running $PGSQL/bin/pg_config to get everything.

I'll work on a PR sometime...
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-06 12:13:20 UTC
Yeah, lld errors out on this, while bfd only warns (I have a patch locally for bfd).
Comment 14 Larry the Git Cow gentoo-dev 2025-04-08 00:50:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d5b11c234adf6ff1613e045edacf6cc6e22845e

commit 7d5b11c234adf6ff1613e045edacf6cc6e22845e
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2025-04-07 23:52:24 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2025-04-08 00:49:54 +0000

    net-analyzer/nagios-plugins: bugfix -r1, keyword ~riscv
    
     * Two patches for improved pgsql and net-snmp detection.
     * Depend on net-dns/bind instead of the old net-dns/bind-tools.
     * Add ~riscv keywords.
    
    Bug: https://bugs.gentoo.org/940193
    Closes: https://bugs.gentoo.org/938467
    Closes: https://bugs.gentoo.org/953349
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 ...agios-plugins-2.4.12-postgresql-detection.patch | 143 +++++++++++++++++++++
 .../files/nagios-plugins-2.4.12-snmpgetnext.patch  | 128 ++++++++++++++++++
 .../nagios-plugins/nagios-plugins-2.4.12-r1.ebuild | 130 +++++++++++++++++++
 3 files changed, 401 insertions(+)