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

Bug 785499

Summary: >=app-emulation/wine-staging-6.7 implicitly forces clang with wrong CFLAGS?
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Wine Maintainers <wine>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    
Attachments: /var/log/portage/app-emulation:gallium-nine-standalone-0.8:20210425-064325.log
meson-log.txt
emerge --info

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-25 06:49:33 UTC
Created attachment 702279 [details]
/var/log/portage/app-emulation:gallium-nine-standalone-0.8:20210425-064325.log

After upgrade to wine-staging-6.7, the rebuild of gallium-nine-standalone failed:

```
Program winegcc found: YES (/usr/bin/winegcc)
Checking if "winegcc check" compiles: NO 

../wine-nine-standalone-0.8/meson.build:39:2: ERROR: Problem encountered: A WINE cross compiler is required

A full log can be found at /tmp/portage/app-emulation/gallium-nine-standalone-0.8/work/wine-nine-standalone-0.8-abi_x86_32.x86/meson-logs/meson-log.txt
```


In the full log, I see:

```
Program winegcc found: YES (/usr/bin/winegcc)
Running compile:
Working directory:  /tmp/portage/app-emulation/gallium-nine-standalone-0.8/work/wine-nine-standalone-0.8-abi_x86_32.x86/meson-private/tmp6qdckan2
Command line:  winegcc /tmp/portage/app-emulation/gallium-nine-standalone-0.8/work/wine-nine-standalone-0.8-abi_x86_32.x86/meson-private/tmp6qdckan2/testfile.c -o /tmp/portage/app-emulation/gallium-nine-standalone-0.8/work/wine-nine-standalone-0.8-abi_x86_32.x86/meson-private/tmp6qdckan2/output.obj -pipe -c -march=znver2 --param l1-cache-size=32 --param l1-cache-line-size=64 -O2 -frecord-gcc-switches -DG9DLL="Z:/usr/lib/d3d9-nine.dll.so" -m32 -D_FILE_OFFSET_BITS=64 -O0 -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument 

Code:
 #ifndef __WINE__
#error 1
#endif
Compiler stdout:
 
Compiler stderr:
 clang-12: error: argument unused during compilation: '-fuse-ld=lld' [-Werror,-Wunused-command-line-argument]
clang-12: error: argument unused during compilation: '--param l1-cache-size=32' [-Werror,-Wunused-command-line-argument]
clang-12: error: argument unused during compilation: '--param l1-cache-line-size=64' [-Werror,-Wunused-command-line-argument]
winegcc: /usr/lib/llvm/12/bin/clang failed

Checking if "winegcc check" compiles: NO 

../wine-nine-standalone-0.8/meson.build:39:2: ERROR: Problem encountered: A WINE cross compiler is required
```


Yet my system compiler is gcc.  And even if it were clang, the '-fuse-ld=lld' is added by winegcc and would cause the check failure.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-25 06:49:52 UTC
Created attachment 702282 [details]
meson-log.txt
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-25 06:50:42 UTC
Created attachment 702285 [details]
emerge --info
Comment 3 Nick Sarnie gentoo-dev 2021-04-25 15:33:52 UTC
Is this reproducible if you call winegcc directly?

Ex:

sarnex@pc ~ $ winegcc
x86_64-pc-linux-gnu-gcc: fatal error: no input files
compilation terminated.
winegcc: /usr/bin/x86_64-pc-linux-gnu-gcc failed
sarnex@pc ~ $ 

So clearly mine is using gcc.

If so, do you have time do debug winegcc in gdb? I think the build_tool_name function is what decides what compiler to pick.

https://github.com/wine-mirror/wine/blob/master/tools/winegcc/winegcc.c#L350

Thanks,
Sarnex