Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 819030

Summary: app-office/libreoffice-7.1.5.2 fails with: configure: error: C compiler cannot create executables
Product: Gentoo Linux Reporter: Willard Dawson <wfdawson>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal CC: floppym
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log
config.log
emerge --info
emerge -pqv
environment
binutils and binutils-libs installed USE settings

Description Willard Dawson 2021-10-20 14:07:51 UTC
The relevant bits from the config.log appear to be:

>>> Configuring source in /var/tmp/portage/app-office/libreoffice-7.1.5.2/work/libreoffice-7.1.5.2 ...
 * Preset CFLAGS:    -O2 -march=i686 -pipe
 * Preset LDFLAGS:   -Wl,-Ol -Wl,--as-needed -Wl,-fuse-ld=bfd
 * Enforcing the use of clang due to USE=clang ...
 *   Used CFLAGS:    -O2 -march=i686 -pipe
 *   Used LDFLAGS:   -Wl,-Ol -Wl,--as-needed -Wl,-fuse-ld=bfd -fuse-ld=lld

... and:

checking for explicit LDFLAGS... -Wl,-Ol -Wl,--as-needed -Wl,-fuse-ld=bfd -fuse-ld=lld
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-clang
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/app-office/libreoffice-7.1.5.2/work/libreoffice-7.1.5.2':
configure: error: C compiler cannot create executables

Looking at my binutils-libs, which appears to be where the bfd linker option would come from, we see it's apparently only supported in 64-bit OS versions. I'm running x86. So, it would appear libreoffice in this version has a hard dependency on 64-bit?

[I] sys-libs/binutils-libs
     Available versions:  2.34-r2(0/2.34) 2.35.2(0/2.35.2) 2.36.1-r2(0/2.36.1) 2.37_p1(0/2.37) {64-bit-bfd cet multitarget nls static-libs ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  2.37_p1(0/2.37)(02:10:59 PM 10/09/2021)(multitarget nls -64-bit-bfd -cet -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 -64 -x32")
     Homepage:            https://sourceware.org/binutils/
     Description:         Core binutils libraries (libbfd, libopcodes, libiberty) for external packages


Reproducible: Always

Steps to Reproduce:
1. emerge -u @world
2.
3.
Comment 1 Willard Dawson 2021-10-20 14:08:28 UTC
Created attachment 745899 [details]
Build log
Comment 2 Willard Dawson 2021-10-20 14:08:46 UTC
Created attachment 745902 [details]
config.log
Comment 3 Willard Dawson 2021-10-20 14:09:09 UTC
Created attachment 745905 [details]
emerge --info
Comment 4 Willard Dawson 2021-10-20 14:09:39 UTC
Created attachment 745908 [details]
emerge -pqv
Comment 5 Willard Dawson 2021-10-20 14:09:58 UTC
Created attachment 745911 [details]
environment
Comment 6 Willard Dawson 2021-10-20 14:11:03 UTC
Created attachment 745914 [details]
binutils and binutils-libs installed USE settings
Comment 7 Stephan Hartmann (RETIRED) gentoo-dev 2021-10-20 14:32:47 UTC
You seem to have a typo in your LDFLAGS:
   -Wl,-Ol -Wl,--as-needed -Wl,-fuse-ld=bfd
         ^
         should be a 1
Comment 8 Mike Gilbert gentoo-dev 2021-10-20 20:20:22 UTC
> ld.lld: error: -Ol: number expected, but got 'l'

As Stehphan indicates, this appears to be a typo in your LDFLAGS.
Comment 9 Willard Dawson 2021-10-22 02:45:26 UTC
The typo in LDFLAGS was legit. However, that had nothing to do with the error logged in the config.log, nor was it the cause of the error emitted "C compiler cannot create executables," even when the typo was corrected the same error resulted.

Commenting out my LDFLAGS setting in /etc/portage/make.conf gets me past the error. But to be clear - the error was not due to the typo noted in the comments made to this bug ID.
Comment 10 Mike Gilbert gentoo-dev 2021-10-22 13:34:04 UTC
Please attach a new config.log with corrected LDFLAGS.
Comment 11 Mike Gilbert gentoo-dev 2021-10-22 13:36:22 UTC
(In reply to Willard Dawson from comment #9)

Oh, I see. Your LDFLAGS have *two* mistakes.

> ld.lld: error: unknown argument '-fuse-ld=bfd'

Having "-Wl,-fuse-ld=bfd" is nonsensical. That's a flag for the compiler front-end, not the linker.