Opened 4 years ago

Closed 4 years ago

#60091 closed defect (fixed)

i686-w64-mingw32-gcc-nothreads build failure - Segmentation fault

Reported by: mmaenz (Michael Maenz) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: catalina, haspatch Cc: cooljeanius (Eric Gallager), Gcenx, ryandesign (Ryan Carsten Schmidt), larryv (Lawrence Velázquez), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: i686-w64-mingw32-gcc, mpfr

Description (last modified by mmaenz (Michael Maenz))

Trying to install port mingw-w64 in order to compile Valve's latest Proton. First time to try to compile on Catalina. Did everything what the CatalinaProblems Page suggested.


My specs

  • macOS Catalina 10.15.3
  • XCode 11.3.1
  • Command Line Tools 11.3
% uname -a
Darwin iMac 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
% xcode-select -p
/Applications/Xcode.app/Contents/Developer
% /usr/bin/xcodebuild -version
Xcode 11.3.1
Build version 11C504

Attached the last lines of the log with the error as the whole is very huge (~160MB). Saved the log, can send or upload it if valuable for further investigation. The error is explained in line 4, 18 and 21.

:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/ -L/opt/local/i686-w64-mingw32/lib -L/opt/local/mingw/lib -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/mingw/include -B/opt/local/i686-w64-mingw32/bin/ -B/opt/local/i686-w64-mingw32/lib/ -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran -iquote/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/io -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc/config -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libquadmath -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libgcc -I../libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT norm2_r10.lo -MD -MP -MF .deps/norm2_r10.Tpo -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r10.c  -DDLL_EXPORT -DPIC -o .libs/norm2_r10.o
:info:build during GIMPLE pass: ccp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r4.c: In function ‘norm2_r4’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r4.c:213:1: internal compiler error: Segmentation fault: 11
:info:build   213 | }
:info:build       | ^
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://gcc.gnu.org/bugs/> for instructions.
:info:build mv -f .deps/iparity_i8.Tpo .deps/iparity_i8.Plo
:info:build make[3]: *** [norm2_r4.lo] Error 1
:info:build make[3]: *** Waiting for unfinished jobs....
:info:build during GIMPLE pass: ccp
:info:build during GIMPLE pass: ccp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r8.c: In function ‘norm2_r8’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r10.c: In function ‘norm2_r10’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r8.c:213:1: internal compiler error: Segmentation fault: 11
:info:build   213 | }
:info:build       | ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r10.c:213:1: internal compiler error: Segmentation fault: 11
:info:build   213 | }
:info:build       | ^
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://gcc.gnu.org/bugs/> for instructions.
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://gcc.gnu.org/bugs/> for instructions.
:info:build make[3]: *** [norm2_r8.lo] Error 1
:info:build make[3]: *** [norm2_r10.lo] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/i686-w64-mingw32/libgfortran'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/i686-w64-mingw32/libgfortran'
:info:build make[1]: *** [all-target-libgfortran] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build" && /usr/bin/make -j4 -w all 
:info:build Exit code: 2
:error:build Failed to build i686-w64-mingw32-gcc-nothreads: command execution failed
:debug:build Error code: CHILDSTATUS 89701 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/main.log for details.

Change History (22)

comment:1 Changed 4 years ago by mmaenz (Michael Maenz)

Description: modified (diff)

comment:2 Changed 4 years ago by mmaenz (Michael Maenz)

Description: modified (diff)

comment:3 Changed 4 years ago by jmroot (Joshua Root)

Keywords: mingw-w64 10.15.3 Segmentation Fault removed
Owner: set to mojca
Port: i686-w64-mingw32-gcc added; mingw-w64 removed
Status: newassigned
Summary: Port can't compile - Segmentation faulti686-w64-mingw32-gcc-nothreads build failure - Segmentation fault

comment:4 Changed 4 years ago by mojca (Mojca Miklavec)

Hmmm, I'm sorry, this one has apparently always been broken on 10.15 (https://ports.macports.org/port/i686-w64-mingw32-gcc-nothreads/), but I never noticed it, we need some more "show me all my broken ports" functionality.

So we do have the full build logs on our build infrastructure.

Now, with

internal compiler error: Segmentation fault: 11

I'm somewhat clueless about what to do without upstream jumping in for help.

comment:5 Changed 4 years ago by mojca (Mojca Miklavec)

Can someone with Catalina please check whether adding -fno-stack-check to configure.cflags-append helps? I'm not saying it does, just that it might be worth trying given how many troubles we had with other ports, see for example #59246 which is not the only one.

You need to make sure to recompile i686-w64-mingw32-gcc-bootstrap as well from source (make sure that it's not a binary from our buildbot) before trying to build this one.

Even if the compiler problem was fixed in the meantime, we might still be hit as we are still using an old bootstapped binary build with the buggy compiler.

I opened a ticket on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93758

Last edited 4 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:6 Changed 4 years ago by kencu (Ken)

we need a crashlog to move forward.

comment:7 Changed 4 years ago by mojca (Mojca Miklavec)

I didn't yet dare to update to 10.15 (I almost got my mac bricked by a regular security update and needed one hour on the phone with support to get it recovered via secret key combinations at boot time & some subsequent steps).

The bug seems to be fully reproducible, so if anyone is willing to look into it ... But before we do some serious analysis, it would really make sense to check if that known clang bug had anything to do with this. We've seen way too many segmentation faults as a consequence of buggy clang behaviour.

comment:8 Changed 4 years ago by mmaenz (Michael Maenz)

What I did:

% sudo port install -s i686-w64-mingw32-gcc-bootstrap
--->  Computing dependencies for i686-w64-mingw32-gcc-bootstrap
--->  Fetching distfiles for i686-w64-mingw32-gcc-bootstrap
--->  Verifying checksums for i686-w64-mingw32-gcc-bootstrap
--->  Extracting i686-w64-mingw32-gcc-bootstrap
--->  Applying patches to i686-w64-mingw32-gcc-bootstrap
--->  Configuring i686-w64-mingw32-gcc-bootstrap
--->  Building i686-w64-mingw32-gcc-bootstrap
--->  Staging i686-w64-mingw32-gcc-bootstrap into destroot
Warning: i686-w64-mingw32-gcc-bootstrap installs files outside the common directory structure.
--->  Installing i686-w64-mingw32-gcc-bootstrap @9.2.0_2
--->  Activating i686-w64-mingw32-gcc-bootstrap @9.2.0_2
--->  Cleaning i686-w64-mingw32-gcc-bootstrap
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/cross/i686-w64-mingw32-gcc/Portfile

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           crossgcc 1.0

# keep in sync with x86_64-w64-mingw32-gcc
set mingw_name      w64-mingw32
set mingw_arch      i686
set mingw_target    ${mingw_arch}-${mingw_name}

crossgcc.setup      ${mingw_target} 9.2.0
crossgcc.languages  {c c++ fortran objc obj-c++}
dist_subdir         gcc[lindex [split ${version} .] 0]
revision            2

maintainers         {mojca @mojca} openmaintainer

# these are build + runtime dependencies
# (binutils are already added by the portgroup)
depends_lib-append  port:${mingw_target}-headers
# not sure if useful:
#                   port:cloog
#                   port:ppl

patchfiles-append   notparallel-install-headers.patch

configure.args-replace \
                    --enable-multilib \
                    --disable-multilib

configure.args-append \
                    --enable-shared \
                    --with-dwarf \
                    --enable-fully-dynamic-string \
                    --enable-libssp \
                    --enable-lto
configure.cflags-append \
                    -fno-stack-check

# not sure if useful:
#   --with-cloog=${prefix}
#   --with-ppl=${prefix}

# TODO:
#   --enable-version-specific-runtime-libs
#       Installs libgcc/libstdc++ and other target support libraries in such a
#       way that multiple GCC installs can coexist simultaneously.
#       (add once you have the default working as it needs some extra tweaking)

# First bootstrapping phase
subport ${mingw_target}-gcc-bootstrap {
    build.target    all-gcc
    destroot.target install-gcc
}

# Second bootstrapping phase
subport ${mingw_target}-gcc-nothreads {
    # these two are not needed since we are not yet requesting posix threads
    # build.target          all-target-libgcc
    # destroot.target       install-target-libgcc

    depends_lib-append      port:${mingw_target}-crt
    depends_build-append    bin:${mingw_target}-gcc:${mingw_target}-gcc-bootstrap
}

# Final phase
if {${subport} eq ${name}} {
    depends_lib-append      port:${mingw_target}-crt \
                            port:${mingw_target}-winpthreads

    depends_build-append    path:${mingw_target}/lib/libgcc_s.a:${mingw_target}-gcc-nothreads

    configure.args-append   --enable-threads=posix \
                            --enable-libgomp

    notes "
        If you want your MinGW-generated windows binaries to work under wine out-of-the-box
        (and they are not statically linked), you can instruct wine
        to automatically search for dll-s by running:
            wine regedit
        Nagivate to:
            \[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment\]
        or
            \[HKEY_CURRENT_USER\\Environment\]
        and add
            Z:[string map {/ \\} ${prefix}]\\${mingw_target}\\bin
        to the 'PATH' variable.
    "
} else {
    livecheck.type  none
}

if {${subport} ne "${name}-bootstrap"} {
    post-destroot {
        move {*}[glob ${destroot}${prefix}/${mingw_target}/lib/*.dll] \
            ${destroot}${prefix}/${mingw_target}/bin
    }
    pre-activate {
        foreach flavour {gcc-bootstrap gcc-nothreads gcc} {
            set gcc ${mingw_target}-${flavour}
            if {![catch {set installed [lindex [registry_active ${gcc}] 0]}]} {
                registry_deactivate_composite ${gcc} "" [list ports_nodepcheck 1]
            }
        }
    }
}

Result:

% sudo port install i686-w64-mingw32-gcc          
Password:
--->  Computing dependencies for i686-w64-mingw32-gcc
The following dependencies will be installed: 
 i686-w64-mingw32-gcc-nothreads
 i686-w64-mingw32-winpthreads
 x86_64-w64-mingw32-crt
Continue? [Y/n]: Y
Portfile changed since last build; discarding previous state.
--->  Fetching archive for i686-w64-mingw32-gcc-nothreads
--->  Attempting to fetch i686-w64-mingw32-gcc-nothreads-9.2.0_2.darwin_19.x86_64.tbz2 from https://packages.macports.org/i686-w64-mingw32-gcc-nothreads
--->  Attempting to fetch i686-w64-mingw32-gcc-nothreads-9.2.0_2.darwin_19.x86_64.tbz2 from http://nue.de.packages.macports.org/i686-w64-mingw32-gcc-nothreads
--->  Attempting to fetch i686-w64-mingw32-gcc-nothreads-9.2.0_2.darwin_19.x86_64.tbz2 from http://lil.fr.packages.macports.org/i686-w64-mingw32-gcc-nothreads
--->  Fetching distfiles for i686-w64-mingw32-gcc-nothreads
--->  Verifying checksums for i686-w64-mingw32-gcc-nothreads
--->  Extracting i686-w64-mingw32-gcc-nothreads
--->  Applying patches to i686-w64-mingw32-gcc-nothreads
--->  Configuring i686-w64-mingw32-gcc-nothreads
--->  Building i686-w64-mingw32-gcc-nothreads
Error: Failed to build i686-w64-mingw32-gcc-nothreads: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port i686-w64-mingw32-gcc failed

Logfile:

:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/ -L/opt/local/i686-w64-mingw32/lib -L/opt/local/mingw/lib -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/mingw/include -B/opt/local/i686-w64-mingw32/bin/ -B/opt/local/i686-w64-mingw32/lib/ -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran -iquote/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/io -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc/config -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libquadmath -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libgcc -I../libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT norm2_r4.lo -MD -MP -MF .deps/norm2_r4.Tpo -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r4.c  -DDLL_EXPORT -DPIC -o .libs/norm2_r4.o
:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/ -L/opt/local/i686-w64-mingw32/lib -L/opt/local/mingw/lib -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/mingw/include -B/opt/local/i686-w64-mingw32/bin/ -B/opt/local/i686-w64-mingw32/lib/ -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran -iquote/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/io -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc/config -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libquadmath -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libgcc -I../libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT norm2_r8.lo -MD -MP -MF .deps/norm2_r8.Tpo -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r8.c  -DDLL_EXPORT -DPIC -o .libs/norm2_r8.o
:info:build during GIMPLE pass: ccp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r8.c: In function ‘norm2_r8’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r8.c:213:1: internal compiler error: Segmentation fault: 11
:info:build   213 | }
:info:build       | ^
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://gcc.gnu.org/bugs/> for instructions.
:info:build during GIMPLE pass: ccp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r4.c: In function ‘norm2_r4’:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/norm2_r4.c:213:1: internal compiler error: Segmentation fault: 11
:info:build   213 | }
:info:build       | ^
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://gcc.gnu.org/bugs/> for instructions.
:info:build make[3]: *** [norm2_r4.lo] Error 1
:info:build make[3]: *** Waiting for unfinished jobs....
:info:build make[3]: *** [norm2_r8.lo] Error 1
:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/./gcc/ -L/opt/local/i686-w64-mingw32/lib -L/opt/local/mingw/lib -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/mingw/include -B/opt/local/i686-w64-mingw32/bin/ -B/opt/local/i686-w64-mingw32/lib/ -isystem /opt/local/i686-w64-mingw32/include -isystem /opt/local/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran -iquote/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/io -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../gcc/config -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libquadmath -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libgcc -I../libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT iparity_i16.lo -MD -MP -MF .deps/iparity_i16.Tpo -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/gcc-9.2.0/libgfortran/generated/iparity_i16.c -o iparity_i16.o >/dev/null 2>&1
:info:build mv -f .deps/iparity_i16.Tpo .deps/iparity_i16.Plo
:info:build mv -f .deps/iparity_i8.Tpo .deps/iparity_i8.Plo
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/i686-w64-mingw32/libgfortran'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build/i686-w64-mingw32/libgfortran'
:info:build make[1]: *** [all-target-libgfortran] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/work/build" && /usr/bin/make -j4 -w all 
:info:build Exit code: 2
:error:build Failed to build i686-w64-mingw32-gcc-nothreads: command execution failed
:debug:build Error code: CHILDSTATUS 9339 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cross_i686-w64-mingw32-gcc/i686-w64-mingw32-gcc-nothreads/main.log for details.

comment:9 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:10 Changed 4 years ago by Gcenx

I can confirm xcode11 failed to built this on macOS Catalina regardless of deployment target or even overriding the SDK to 10.13 will still result in a failed compile.

I did a few changes to the Portfile that might not have been needed (I’ll edit the comment or comment again after work), I did blacklist XCode11 now building from source using macports clang-9 I got a completed build. The same blacklisting of XCode11 was applied to the X86_64 package and for good measure also onto the mingw-w64 meta package (not sure if it’s required or not)

I pre-installed clang-9.0 since it failed to installed due to a missing package when called via mingw-w64

Edit; I believe I’ve figured that out and will do a pull-request later that resolves the issue.

Just an FYI the mingw binutil conflict isn’t related and was caused by the xz version bump

Last edited 4 years ago by Gcenx (previous) (diff)

comment:11 Changed 4 years ago by Gcenx

@mojca the issue here isn't with the Portfile here exactly but the prebuilt packages.

Removed all ports, edited macports.conf and set buildfromsource always now i686-w64-mingw32-gcc-nothreads built without issue.

Last edited 4 years ago by Gcenx (previous) (diff)

comment:12 in reply to:  10 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: Gcenx ryandesign added

Replying to Gcenx:

I did a few changes to the Portfile that might not have been needed (I’ll edit the comment or comment again after work), I did blacklist XCode11 now building from source using macports clang-9 I got a completed build.

The same blacklisting of XCode11 was applied to the X86_64 package and for good measure also onto the mingw-w64 meta package (not sure if it’s required or not)

I pre-installed clang-9.0 since it failed to installed due to a missing package when called via mingw-w64

Can you be more specific? What error message did you get exactly?

Edit; I believe I’ve figured that out and will do a pull-request later that resolves the issue.

I think you mean https://github.com/macports/macports-ports/pull/6449? But you closed it saying blacklisting wasn't what fixed it, it was just building everything from source that fixed it.

Just an FYI the mingw binutil conflict isn’t related and was caused by the xz version bump

Replying to Gcenx:

@mojca the issue here isn't with the Portfile here exactly but the prebuilt packages.

Removed all ports, edited macports.conf and set buildfromsource always now i686-w64-mingw32-gcc-nothreads built without issue.

Can you be more specific? Which packages need to be rebuilt? When Catalina was first released, we of course built all of our packages for it with Xcode 11. If there was some bug in Xcode 11 that caused a package to be mis-built in some way, and rebuilding that package with Xcode 11.4.1 would fix it, we can do that by revbumping the affected port, we just need to know which port(s) to do that to. If you have any information about what specifically is wrong with the affected packages that might be helpful as well for possibly identifying other affected packages.

comment:13 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: larryv added
Keywords: haspatch added
Port: mpfr added

After trying to rebuild various rdependencies of i686-w64-mingw32-gcc-nothreads with no change, in the end I think only mpfr needs to be rebuilt to fix this problem.

Our package of mpfr @4.0.2_0 for Catalina was built October 29, 2019, at which point the latest version of Xcode was 11.1, so that's probably what we were using on our build server, though we may have still been using 11.0.

If it really is a case of an old Xcode 11 building mpfr incorrectly, then we should not only increase the revision of mpfr but also ensure that a recent enough Xcode is being used. I don't know what the earliest version of Xcode 11 is that builds it correctly, but Gcenx reported success above on February 28, 2020, at which point the latest version was Xcode 11.3.1, so we could use that as the minimum:

  • Portfile

    old new  
    1111name                mpfr
    1212# The actual version is generated below, after patchfiles is defined.
    1313set base_version    4.0.2
     14revision            1
    1415categories          devel math
    1516platforms           darwin
    1617license             LGPL-3+
     
    5758# blacklisted here
    5859compiler.blacklist  {clang == 211.10.1}
    5960
     61# Early versions of Xcode 11 seem to miscompile mpfr such that compiling
     62# i686-w64-mingw32-gcc-nothreads crashes. Xcode 11.3.1 and later seem to
     63# be ok. See https://trac.macports.org/ticket/60091
     64compiler.blacklist-append \
     65                    {clang >= 1100 < 1100.0.33.17}
     66
    6067test.run            yes
    6168test.target         check
    6269

comment:15 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:16 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

There is an alternate pull request that attempts to solve this problem.

comment:17 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks. I see you lowered the minimum Xcode 11 version to 11.2. Did you do some test builds and verify that when mpfr was built with Xcode 11.2 i686-w64-mingw32-gcc-nothreads would build without crashing?

comment:18 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Yes.
i686-w64-mingw32-gcc-nothreads seems to build with no changes if mpfr is built with Xcode 11.2.
If mpfr is built with older versions of Xcode, -fno-stack-check also seems to fix the problem.

comment:19 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Great, thanks. Does the stack check issue only affect Catalina? What happens if a Mojave user has Xcode 11.0 or 11.1?

comment:20 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

If I recall correctly, -fno-stack-check is the default for OS versions prior to macOS 10.15, regardless of Xcode version.

comment:21 Changed 4 years ago by Gcenx

Sorry @ryandesign for not responding to this, somehow gmail was marking the emails as spam....

As @MarcusCalhoun-Lopez says -fno-stack-check is default below Catalina.

The package issues were all built using Xcode11 initial release anything built after Xcode11.2 don't have these issues.

comment:22 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In 2e2e747704eb1e25f883793868f34be5da5e40d3/macports-ports (master):

mpfr: use xcode_workaround PG

Closes #60091

Note: See TracTickets for help on using tickets.