Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 886635 - sys-libs/ncurses-6.3_p20221203 broken compilation with clang
Summary: sys-libs/ncurses-6.3_p20221203 broken compilation with clang
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on: 899582
Blocks:
  Show dependency tree
 
Reported: 2022-12-18 10:34 UTC by Alexander Polozov
Modified: 2023-10-23 23:59 UTC (History)
0 users

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


Attachments
config.log (config.log,6.79 KB, text/x-log)
2022-12-18 10:47 UTC, Alexander Polozov
Details
build.log (build.log,17.04 KB, text/x-log)
2022-12-18 10:48 UTC, Alexander Polozov
Details
emerge --info (info,7.22 KB, text/plain)
2022-12-18 10:49 UTC, Alexander Polozov
Details
/etc/portage/package.env (package.env,722 bytes, text/plain)
2022-12-18 11:01 UTC, Alexander Polozov
Details
/etc/portage/env/compiler-clang-lto (compiler-clang-lto,549 bytes, text/plain)
2022-12-18 11:02 UTC, Alexander Polozov
Details
emerge --info (emerge.info.txt,7.00 KB, text/plain)
2022-12-20 02:41 UTC, cilly
Details
build.log (build.log,45.76 KB, application/octet-stream)
2022-12-20 02:43 UTC, cilly
Details
config.log (config.log,7.72 KB, text/plain)
2022-12-20 02:50 UTC, cilly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Polozov 2022-12-18 10:34:57 UTC
Previous package (6.3_p20220423) was compiled with clang+lto, after updating portage tree fresh package sys-libs/ncurses-6.3_p20221203 say compilation error
checking for ggrep... no
checking for grep... grep
checking for egrep... grep -E
Configuring NCURSES 6.3 ABI 6 (Sun Dec 18 09:32:35 MSK 2022)
checking for package version... 6.3
checking for package patch date... 20221203
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring for linux-gnu
checking for fgrep... grep -F
checking for prefix... /usr
checking for x86_64-pc-linux-gnu-gcc... clang
checking for C compiler default output... configure: error: C compiler cannot create executables

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/cross/config.log

Compilation with gcc is OK

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-18 10:36:59 UTC
Please attach the full build.log, emerge --info, and /var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/cross/config.log.
Comment 2 Alexander Polozov 2022-12-18 10:47:00 UTC
Created attachment 843389 [details]
config.log
Comment 3 Alexander Polozov 2022-12-18 10:48:24 UTC
Created attachment 843391 [details]
build.log
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-18 10:49:16 UTC
This doesn't appear to be ncurses' fault:
```

configure:1914: checking for C compiler default output
configure:1917: clang -O2 -march=native -flto=thin -fdiagnostics-color=always  -D_GNU_SOURCE -fuse-ld=lld -rtlib=compiler-rt -Wl,-O2 -Wl,--as-needed -static conftest.c  >&5
ld.lld: error: undefined symbol: __unordtf2
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fp.o:(__printf_fp_l) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: __letf2
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fp.o:(__printf_fp_l) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
clang-15: [0;1;31merror: [0m[1mlinker command failed with exit code 1 (use -v to see invocation)[0m
configure:1920: $? = 1
configure: failed program was:
#line 1898 "configure"
#include "confdefs.h"

int
main (void)
{

  ;
  return 0;
}
configure:1943: error: C compiler cannot create executables
```

If you try to build a small C file at /tmp/foo.c with:
```
int
main (void)
{

  ;
  return 0;
}
```

and
clang -O2 -march=native -flto=thin -fdiagnostics-color=always -D_GNU_SOURCE -fuse-ld=lld -rtlib=compiler-rt -Wl,-O2 -Wl,--as-needed -static /tmp/foo.c -o /tmp/foo

Does it build?
Comment 5 Alexander Polozov 2022-12-18 10:49:45 UTC
Created attachment 843393 [details]
emerge --info
Comment 6 Alexander Polozov 2022-12-18 10:51:21 UTC
Strange thing, after updating (installing) with gcc rebuilding with clang was without errors.
Comment 7 Alexander Polozov 2022-12-18 11:01:02 UTC
Created attachment 843395 [details]
/etc/portage/package.env
Comment 8 Alexander Polozov 2022-12-18 11:02:23 UTC
Created attachment 843397 [details]
/etc/portage/env/compiler-clang-lto
Comment 9 Alexander Polozov 2022-12-18 11:26:58 UTC
> If you try to build a small C file at /tmp/foo.c with:
> ```
> int
> main (void)
> {
> 
>   ;
>   return 0;
> }
> ```
> 
> and
> clang -O2 -march=native -flto=thin -fdiagnostics-color=always -D_GNU_SOURCE
> -fuse-ld=lld -rtlib=compiler-rt -Wl,-O2 -Wl,--as-needed -static /tmp/foo.c
> -o /tmp/foo
> 
> Does it build?

pan@pan-homlin /tmp $ clang -O2 -march=native -flto=thin -fdiagnostics-color=always -D_GNU_SOURCE -fuse-ld=lld -rtlib=compiler-rt -Wl,-O2 -Wl,--as-needed -static /tmp/foo.c -o /tmp/foo
ld.lld: error: undefined symbol: __unordtf2
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fp.o:(__printf_fp_l) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: __letf2
>>> referenced by printf_fphex.o:(__printf_fphex) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
>>> referenced by printf_fp.o:(__printf_fp_l) in archive /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc.a
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 10 cilly 2022-12-20 02:39:21 UTC
I have the same problem:

>>> Configuring source in /var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/ncurses-6.3 ...
 * econf: updating ncurses-6.3/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating ncurses-6.3/config.sub with /usr/share/gnuconfig/config.sub
/var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/ncurses-6.3/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo --enable-pc-files --with-pkg-config-libdir=/usr/lib64/pkgconfig --with-shared --without-hashed-db --without-ada --with-cxx --with-cxx-binding --with-cxx-shared --without-debug --without-profile --without-gpm --disable-term-driver --disable-termcap --enable-symlinks --with-rcs-ids --with-manpage-format=normal --enable-const --enable-colorfgbg --enable-hard-tabs --enable-echo --enable-warnings --without-assertions --enable-leaks --without-expanded --with-macros --with-progs --without-tests --without-trace --with-termlib --disable-stripping --disable-pkg-ldflags --disable-widec --without-pthread --without-reentrant --includedir=/usr/include/cross --without-shared --with-normal --with-progs
checking for ggrep... no
checking for grep... grep
checking for egrep... grep -E
Configuring NCURSES 6.3 ABI 6 (Tue Dec 20 03:39:05 CET 2022)
checking for package version... 6.3
checking for package patch date... 20221203
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring for linux-gnu
checking for fgrep... grep -F
checking for prefix... /usr
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/cross/config.log
 * ERROR: sys-libs/ncurses-6.3_p20221203::local failed (configure phase):
 *   econf failed
 * 
 * Call stack:
 *               ebuild.sh, line  136:  Called src_configure
 *             environment, line 2193:  Called do_configure 'cross' '--without-shared' '--with-normal' '--with-progs'
 *             environment, line  671:  Called econf '--with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo' '--enable-pc-files' '--with-pkg-config-libdir=/usr/lib64/pkgconfig' '--with-shared' '--without-hashed-db' '--without-ada' '--with-cxx' '--with-cxx-binding' '--with-cxx-shared' '--without-debug' '--without-profile' '--without-gpm' '--disable-term-driver' '--disable-termcap' '--enable-symlinks' '--with-rcs-ids' '--with-manpage-format=normal' '--enable-const' '--enable-colorfgbg' '--enable-hard-tabs' '--enable-echo' '--enable-warnings' '--without-assertions' '--enable-leaks' '--without-expanded' '--with-macros' '--with-progs' '--without-tests' '--without-trace' '--with-termlib' '--disable-stripping' '--disable-pkg-ldflags' '--disable-widec' '--without-pthread' '--without-reentrant' '--includedir=/usr/include/cross' '--without-shared' '--with-normal' '--with-progs'
 *        phase-helpers.sh, line  730:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *              die "$@"
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/ncurses-6.3_p20221203::local'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/ncurses-6.3_p20221203::local'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/ncurses-6.3_p20221203/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/ncurses-6.3_p20221203/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/cross'
 * S: '/var/tmp/portage/sys-libs/ncurses-6.3_p20221203/work/ncurses-6.3'
Comment 11 cilly 2022-12-20 02:41:22 UTC
Created attachment 843907 [details]
emerge --info
Comment 12 cilly 2022-12-20 02:43:20 UTC
Created attachment 843909 [details]
build.log
Comment 13 cilly 2022-12-20 02:46:18 UTC
So there is also broken compilation with gcc, I didn't use clang - it isn't installed.
Comment 14 cilly 2022-12-20 02:50:48 UTC
Created attachment 843911 [details]
config.log
Comment 15 cilly 2022-12-20 14:17:18 UTC
While using:

ebuild ... prepare

then cd to work/ calling:

configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo --enable-pc-files --with-pkg-config-libdir=/usr/lib64/pkgconfig --with-shared --without-hashed-db --without-ada --with-cxx --with-cxx-binding --with-cxx-shared --without-debug --without-profile --without-gpm --disable-term-driver --disable-termcap --enable-symlinks --with-rcs-ids --with-manpage-format=normal --enable-const --enable-colorfgbg --enable-hard-tabs --enable-echo --enable-warnings --without-assertions --enable-leaks --without-expanded --with-macros --with-progs --without-tests --without-trace --with-termlib --disable-stripping --disable-pkg-ldflags --disable-widec --without-pthread --without-reentrant --includedir=/usr/include/cross --without-shared --with-normal --with-progs
  587  ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo --enable-pc-files --with-pkg-config-libdir=/usr/lib64/pkgconfig --with-shared --without-hashed-db --without-ada --with-cxx --with-cxx-binding --with-cxx-shared --without-debug --without-profile --without-gpm --disable-term-driver --disable-termcap --enable-symlinks --with-rcs-ids --with-manpage-format=normal --enable-const --enable-colorfgbg --enable-hard-tabs --enable-echo --enable-warnings --without-assertions --enable-leaks --without-expanded --with-macros --with-progs --without-tests --without-trace --with-termlib --disable-stripping --disable-pkg-ldflags --disable-widec --without-pthread --without-reentrant --includedir=/usr/include/cross --without-shared --with-normal --with-progs

directly, it's working:

** Configuration summary for NCURSES 6.3 20220924:                                                                                                                                                                                                   
                                                                                                                                                                                                                                                     
       extended funcs: yes                                                                                                                                                                                                                           
       xterm terminfo: xterm-new                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                     
        bin directory: /usr/bin                                                                                                                                                                                                                      
        lib directory: /usr/lib64                                                                                                                                                                                                                    
    include directory: /usr/include/cross                                                                                                                                                                                                            
        man directory: /usr/share/man                                                                                                                                                                                                                
   terminfo directory: /usr/share/terminfo                                                                                                                                                                                                           
 pkg-config directory: /usr/lib64/pkgconfig                                                                                                                                                                                                          
                                                                                                                                                                                                                                                     
** Include-directory is not in a standard location    

Yes, I used 20220924, since this is the first version which does not build.

This seems a portage bug though.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-23 23:59:46 UTC
(In reply to cilly from comment #13)
> So there is also broken compilation with gcc, I didn't use clang - it isn't
> installed.

Your problem is different, it's segfaulting. I think you and I looked into that in another bug.