Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 785499 - >=app-emulation/wine-staging-6.7 implicitly forces clang with wrong CFLAGS?
Summary: >=app-emulation/wine-staging-6.7 implicitly forces clang with wrong CFLAGS?
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Wine Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2021-04-25 06:49 UTC by Michał Górny
Modified: 2021-04-25 15:33 UTC (History)
0 users

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


Attachments
/var/log/portage/app-emulation:gallium-nine-standalone-0.8:20210425-064325.log (app-emulation:gallium-nine-standalone-0.8:20210425-064325.log,6.61 KB, text/plain)
2021-04-25 06:49 UTC, Michał Górny
Details
meson-log.txt (meson-log.txt,5.63 KB, text/plain)
2021-04-25 06:49 UTC, Michał Górny
Details
emerge --info (emerge-info.txt,10.11 KB, text/plain)
2021-04-25 06:50 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
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