Bug 55886 - gcc/configure.ac problems lead to GCC 4.7.2 not building for x86_64-pc-mingw64
Summary: gcc/configure.ac problems lead to GCC 4.7.2 not building for x86_64-pc-mingw64
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.7.2
: P5 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2013-01-06 14:08 UTC by heri+gcc
Modified: 2021-08-19 02:26 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-pc-mingw64
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-11-25 00:00:00


Attachments
gcc-4.7.2-define-have_gas_aligned_comm.patch (358 bytes, patch)
2013-02-13 22:33 UTC, heri+gcc
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description heri+gcc 2013-01-06 14:08:24 UTC
gcc/configure.ac contains several checks for mingw hosts, which are tied to mingw32 instead of generic mingw. This might lead to problems when crosscompiling a x86_64-pc-mingw64 compiler.

Possibly problematic lines in gcc-4.7.2/gcc/configure.ac:
    case $host in                                                                                                                                                                                                                        
1453: *-*-mingw32*)
    use_cxa_atexit=yes

case $host_os in                                                                                                                                                                                                                        
1656:  win32 | pe | cygwin* | mingw32* | uwin*)
    if test "x$enable_win32_registry" != xno; then

[case $target_os in                                                                                                                                                                                                                     
2565:  win32 | pe | cygwin* | mingw32* | uwin*)
    # Need to check that we generated the correct relocation for the

    case $target_os in
3604:      cygwin* | pe | mingw32* | interix*)
    # Recent binutils allows the three-operand form of ".comm" on PE.  This

They should probably use mingw* instead of mingw32*.

At least the last one (gcc/configure.ac:3604) is wrong and leads to HAVE_GAS_ALIGNED_COMM being undefined for mingw64, which makes gcc/options.c (autogenerated file) fail to compile:
options.c:952:3: error: ‘HAVE_GAS_ALIGNED_COMM’ undeclared here (not in a function)

See also: https://bugs.gentoo.org/show_bug.cgi?id=447708
Comment 1 heri+gcc 2013-02-13 22:33:33 UTC
Created attachment 29447 [details]
gcc-4.7.2-define-have_gas_aligned_comm.patch

(In reply to comment #0)
>     case $target_os in
> 3604:      cygwin* | pe | mingw32* | interix*)
>     # Recent binutils allows the three-operand form of ".comm" on PE.  This
> [...]
> At least the last one (gcc/configure.ac:3604) is wrong and leads to
> HAVE_GAS_ALIGNED_COMM being undefined for mingw64, which makes gcc/options.c
> (autogenerated file) fail to compile:
> options.c:952:3: error: ‘HAVE_GAS_ALIGNED_COMM’ undeclared here (not in a
> function)

Attached patch fixes this error. However, I ran into further problems (bug #56311), so it might have other side-effects.
Comment 2 Kai Tietz 2013-11-25 21:53:02 UTC
The use of target's host-part-name mingw64 is strongly discuraged.  Most checks in binutils, gdb, gcc, etc (and all their testsuites) are using still mingw32.
Therefore for resolve your issue use triplet x86_64-pc-mingw32 instead.

I will keep this bug as long-term issue.  Nothing to fix soon.
Comment 3 jyong 2021-08-19 02:26:29 UTC
x86_64-w64-mingw32 has been the defacto triplet for targeting Windows 64bit Win32API for awhile now.

Closing this ticket for now.