Bug 2049150 - Compiler x86_64-w64-mingw32-gcc can not compile programs
Summary: Compiler x86_64-w64-mingw32-gcc can not compile programs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-gcc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2047118
TreeView+ depends on / blocked
 
Reported: 2022-02-01 16:10 UTC by František Zatloukal
Modified: 2022-02-01 18:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-01 18:51:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description František Zatloukal 2022-02-01 16:10:52 UTC
Description of problem:
Since the mass rebuild (probably since the gcc12), mingw-gcc isn't capable of compiling the basic test programs during the configure phase. 

Version-Release number of selected component (if applicable):
11.2.1-5.fc36

How reproducible:
Always

Steps to Reproduce:
Try to rebuild wine-dxvk.

Actual results:
meson.build:1:0: ERROR: Compiler x86_64-w64-mingw32-gcc can not compile programs.
Complete log: https://kojipkgs.fedoraproject.org//work/tasks/8582/81988582/build.log


Expected results:
x86_64-w64-mingw32-gcc should work and be able to compile packages leveraging it as a compiler.

Additional info:
Build process is best seen in wine-dxvk's spec file: https://src.fedoraproject.org/rpms/wine-dxvk/blob/rawhide/f/wine-dxvk.spec

Comment 1 Sandro Mani 2022-02-01 16:34:52 UTC
This is likely due to [1], with native CFLAGS/CXXFLAGS/LDFLAGS getting picked up rather than the respective mingw counterparts. So this is likely not an issue with GCC, but rather of the wine-dxvk buildsystem resp of the spec which does not pass the mingw compile flags to the buildsystem. A quick workaround is

%undefine _auto_set_build_flags

[1] https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck

Comment 2 Sandro Mani 2022-02-01 18:20:26 UTC
Looking very superficially at the spec, is there any reason you aren't using %mingw_meson rather than /usr/bin/meson?

Comment 3 František Zatloukal 2022-02-01 18:33:56 UTC
(In reply to Sandro Mani from comment #1)
> This is likely due to [1], with native CFLAGS/CXXFLAGS/LDFLAGS getting
> picked up rather than the respective mingw counterparts. So this is likely
> not an issue with GCC, but rather of the wine-dxvk buildsystem resp of the
> spec which does not pass the mingw compile flags to the buildsystem. A quick
> workaround is
> 
> %undefine _auto_set_build_flags
> 
> [1] https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck

Thanks a lot, applied that, worked like a charm!

> Looking very superficially at the spec, is there any reason you aren't using %mingw_meson rather than /usr/bin/meson?

I guess I didn't know that existed, I'll give it a shot ! :)


I think this can be closed now since it's not a mingw-gcc issue? Sorry for unnecessary bz!

Comment 4 Sandro Mani 2022-02-01 18:51:16 UTC
> I guess I didn't know that existed, I'll give it a shot ! :)

Then you should also be able to drop %undefine _auto_set_build_flags again

> I think this can be closed now since it's not a mingw-gcc issue?

Yep, closing.

> Sorry for unnecessary bz!

No worries!


Note You need to log in before you can comment on or make changes to this bug.