* [PATCH] gcc: make sure mingw builds use mingw32-w64 configs @ 2020-04-27 13:13 Samuli Piippo 2020-04-27 14:51 ` [OE-core] " Richard Purdie 0 siblings, 1 reply; 6+ messages in thread From: Samuli Piippo @ 2020-04-27 13:13 UTC (permalink / raw) To: openembedded-core meta-mingw is using Mingw-w64 but the host triplet does not match the expected pattern. config/os/mingw32-w64 enables more features that were not working with mingw32. Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> --- meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc index b0411078d3..4c8275bf2a 100644 --- a/meta/recipes-devtools/gcc/gcc-9.3.inc +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc @@ -67,6 +67,7 @@ SRC_URI = "\ file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ " S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch new file mode 100644 index 0000000000..5a167f252c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch @@ -0,0 +1,36 @@ +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 +From: Samuli Piippo <samuli.piippo@qt.io> +Date: Fri, 23 Aug 2019 10:10:43 +0300 +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds + +Make sure we use the w64 version of the configs, since that's what +meta-mingw is using. + +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> +--- + libstdc++-v3/configure.host | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host +index 155a3cdea..adbda8784 100644 +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -277,16 +277,8 @@ case "${host_os}" in + os_include_dir="os/hpux" + ;; + mingw32*) +- case "$host" in +- *-w64-*) +- os_include_dir="os/mingw32-w64" +- error_constants_dir="os/mingw32-w64" +- ;; +- *) +- os_include_dir="os/mingw32" +- error_constants_dir="os/mingw32" +- ;; +- esac ++ os_include_dir="os/mingw32-w64" ++ error_constants_dir="os/mingw32-w64" + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" + ;; + netbsd*) -- 2.17.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH] gcc: make sure mingw builds use mingw32-w64 configs 2020-04-27 13:13 [PATCH] gcc: make sure mingw builds use mingw32-w64 configs Samuli Piippo @ 2020-04-27 14:51 ` Richard Purdie 2020-04-27 17:35 ` Samuli Piippo 0 siblings, 1 reply; 6+ messages in thread From: Richard Purdie @ 2020-04-27 14:51 UTC (permalink / raw) To: Samuli Piippo, openembedded-core On Mon, 2020-04-27 at 16:13 +0300, Samuli Piippo wrote: > meta-mingw is using Mingw-w64 but the host triplet does not match > the expected pattern. config/os/mingw32-w64 enables more features > that were not working with mingw32. > > Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > --- > meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + > ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ > 2 files changed, 37 insertions(+) > create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > > diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc > index b0411078d3..4c8275bf2a 100644 > --- a/meta/recipes-devtools/gcc/gcc-9.3.inc > +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc > @@ -67,6 +67,7 @@ SRC_URI = "\ > file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ > file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ > file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ > + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ > " > S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" > SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" > diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > new file mode 100644 > index 0000000000..5a167f252c > --- /dev/null > +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > @@ -0,0 +1,36 @@ > +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 > +From: Samuli Piippo <samuli.piippo@qt.io> > +Date: Fri, 23 Aug 2019 10:10:43 +0300 > +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds > + > +Make sure we use the w64 version of the configs, since that's what > +meta-mingw is using. > + > +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > +--- > + libstdc++-v3/configure.host | 12 ++---------- > + 1 file changed, 2 insertions(+), 10 deletions(-) > + > +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host > +index 155a3cdea..adbda8784 100644 > +--- a/libstdc++-v3/configure.host > ++++ b/libstdc++-v3/configure.host > +@@ -277,16 +277,8 @@ case "${host_os}" in > + os_include_dir="os/hpux" > + ;; > + mingw32*) > +- case "$host" in > +- *-w64-*) > +- os_include_dir="os/mingw32-w64" > +- error_constants_dir="os/mingw32-w64" > +- ;; > +- *) > +- os_include_dir="os/mingw32" > +- error_constants_dir="os/mingw32" > +- ;; > +- esac > ++ os_include_dir="os/mingw32-w64" > ++ error_constants_dir="os/mingw32-w64" > + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" It might make things a bit more obvious and upstreamable to just change *-w64-*) to *-w64*) if I understand correct? Cheers, Richard ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH] gcc: make sure mingw builds use mingw32-w64 configs 2020-04-27 14:51 ` [OE-core] " Richard Purdie @ 2020-04-27 17:35 ` Samuli Piippo 2020-04-27 20:20 ` Joshua Watt 0 siblings, 1 reply; 6+ messages in thread From: Samuli Piippo @ 2020-04-27 17:35 UTC (permalink / raw) To: Richard Purdie; +Cc: Samuli Piippo, openembedded-core On Mon, 27 Apr 2020 at 17:51, Richard Purdie <richard.purdie@linuxfoundation.org> wrote: > > On Mon, 2020-04-27 at 16:13 +0300, Samuli Piippo wrote: > > meta-mingw is using Mingw-w64 but the host triplet does not match > > the expected pattern. config/os/mingw32-w64 enables more features > > that were not working with mingw32. > > > > Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > > --- > > meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + > > ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ > > 2 files changed, 37 insertions(+) > > create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > > > > diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc > > index b0411078d3..4c8275bf2a 100644 > > --- a/meta/recipes-devtools/gcc/gcc-9.3.inc > > +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc > > @@ -67,6 +67,7 @@ SRC_URI = "\ > > file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ > > file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ > > file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ > > + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ > > " > > S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" > > SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" > > diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > > new file mode 100644 > > index 0000000000..5a167f252c > > --- /dev/null > > +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > > @@ -0,0 +1,36 @@ > > +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 > > +From: Samuli Piippo <samuli.piippo@qt.io> > > +Date: Fri, 23 Aug 2019 10:10:43 +0300 > > +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds > > + > > +Make sure we use the w64 version of the configs, since that's what > > +meta-mingw is using. > > + > > +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > > +--- > > + libstdc++-v3/configure.host | 12 ++---------- > > + 1 file changed, 2 insertions(+), 10 deletions(-) > > + > > +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host > > +index 155a3cdea..adbda8784 100644 > > +--- a/libstdc++-v3/configure.host > > ++++ b/libstdc++-v3/configure.host > > +@@ -277,16 +277,8 @@ case "${host_os}" in > > + os_include_dir="os/hpux" > > + ;; > > + mingw32*) > > +- case "$host" in > > +- *-w64-*) > > +- os_include_dir="os/mingw32-w64" > > +- error_constants_dir="os/mingw32-w64" > > +- ;; > > +- *) > > +- os_include_dir="os/mingw32" > > +- error_constants_dir="os/mingw32" > > +- ;; > > +- esac > > ++ os_include_dir="os/mingw32-w64" > > ++ error_constants_dir="os/mingw32-w64" > > + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" > > It might make things a bit more obvious and upstreamable to just change > *-w64-*) > to > *-w64*) > if I understand correct? With meta-mingw, the host triplet is actually either i686-pokysdk-mingw32 or x86_64-pokysdk-mingw32, depending on bitness in the SDKMACHINE value. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH] gcc: make sure mingw builds use mingw32-w64 configs 2020-04-27 17:35 ` Samuli Piippo @ 2020-04-27 20:20 ` Joshua Watt 2020-04-28 4:33 ` Samuli Piippo 0 siblings, 1 reply; 6+ messages in thread From: Joshua Watt @ 2020-04-27 20:20 UTC (permalink / raw) To: Samuli Piippo, Richard Purdie; +Cc: Samuli Piippo, openembedded-core [-- Attachment #1: Type: text/plain, Size: 4374 bytes --] On 4/27/20 12:35 PM, Samuli Piippo wrote: > On Mon, 27 Apr 2020 at 17:51, Richard Purdie > <richard.purdie@linuxfoundation.org> wrote: >> On Mon, 2020-04-27 at 16:13 +0300, Samuli Piippo wrote: >>> meta-mingw is using Mingw-w64 but the host triplet does not match >>> the expected pattern. config/os/mingw32-w64 enables more features >>> that were not working with mingw32. >>> >>> Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> >>> --- >>> meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + >>> ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ >>> 2 files changed, 37 insertions(+) >>> create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >>> >>> diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc >>> index b0411078d3..4c8275bf2a 100644 >>> --- a/meta/recipes-devtools/gcc/gcc-9.3.inc >>> +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc >>> @@ -67,6 +67,7 @@ SRC_URI = "\ >>> file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ >>> file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ >>> file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ >>> + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ >>> " >>> S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" >>> SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" >>> diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >>> new file mode 100644 >>> index 0000000000..5a167f252c >>> --- /dev/null >>> +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >>> @@ -0,0 +1,36 @@ >>> +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 >>> +From: Samuli Piippo <samuli.piippo@qt.io> >>> +Date: Fri, 23 Aug 2019 10:10:43 +0300 >>> +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds >>> + >>> +Make sure we use the w64 version of the configs, since that's what >>> +meta-mingw is using. >>> + >>> +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> >>> +--- >>> + libstdc++-v3/configure.host | 12 ++---------- >>> + 1 file changed, 2 insertions(+), 10 deletions(-) >>> + >>> +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host >>> +index 155a3cdea..adbda8784 100644 >>> +--- a/libstdc++-v3/configure.host >>> ++++ b/libstdc++-v3/configure.host >>> +@@ -277,16 +277,8 @@ case "${host_os}" in >>> + os_include_dir="os/hpux" >>> + ;; >>> + mingw32*) >>> +- case "$host" in >>> +- *-w64-*) >>> +- os_include_dir="os/mingw32-w64" >>> +- error_constants_dir="os/mingw32-w64" >>> +- ;; >>> +- *) >>> +- os_include_dir="os/mingw32" >>> +- error_constants_dir="os/mingw32" >>> +- ;; >>> +- esac >>> ++ os_include_dir="os/mingw32-w64" >>> ++ error_constants_dir="os/mingw32-w64" >>> + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" >> It might make things a bit more obvious and upstreamable to just change >> *-w64-*) >> to >> *-w64*) >> if I understand correct? > With meta-mingw, the host triplet is actually either > i686-pokysdk-mingw32 or x86_64-pokysdk-mingw32, depending on bitness > in the SDKMACHINE value. Hmm, it does indeed look like we are not correctly setting the host in a way it can be detected by GCC. It's a little surprising this hasn't caused any actual problems (at least up to this point)... is this something new to gcc 9.3, and do we have any idea why the AB MinGW tests aren't seeing any problems? Either way, it would probably be better to figure out a way to make the host look correct in meta-mingw if at all possible. Your commit message is also a little confusing because the first few times I read it, I thought we were configuring for 64-bit when 32-bit is desired, but based on the current GCC code being replaced and the value of the host-triplets, it would seem to be the opposite (we are getting 32-bit when 64-bit is desired). > > [-- Attachment #2: Type: text/html, Size: 5972 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH] gcc: make sure mingw builds use mingw32-w64 configs 2020-04-27 20:20 ` Joshua Watt @ 2020-04-28 4:33 ` Samuli Piippo 2020-04-28 14:44 ` Joshua Watt 0 siblings, 1 reply; 6+ messages in thread From: Samuli Piippo @ 2020-04-28 4:33 UTC (permalink / raw) To: Joshua Watt; +Cc: Richard Purdie, Samuli Piippo, openembedded-core On Mon, 27 Apr 2020 at 23:20, Joshua Watt <jpewhacker@gmail.com> wrote: > > > On 4/27/20 12:35 PM, Samuli Piippo wrote: > > On Mon, 27 Apr 2020 at 17:51, Richard Purdie > <richard.purdie@linuxfoundation.org> wrote: > > On Mon, 2020-04-27 at 16:13 +0300, Samuli Piippo wrote: > > meta-mingw is using Mingw-w64 but the host triplet does not match > the expected pattern. config/os/mingw32-w64 enables more features > that were not working with mingw32. > > Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > --- > meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + > ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ > 2 files changed, 37 insertions(+) > create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > > diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc > index b0411078d3..4c8275bf2a 100644 > --- a/meta/recipes-devtools/gcc/gcc-9.3.inc > +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc > @@ -67,6 +67,7 @@ SRC_URI = "\ > file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ > file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ > file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ > + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ > " > S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" > SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" > diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > new file mode 100644 > index 0000000000..5a167f252c > --- /dev/null > +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch > @@ -0,0 +1,36 @@ > +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 > +From: Samuli Piippo <samuli.piippo@qt.io> > +Date: Fri, 23 Aug 2019 10:10:43 +0300 > +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds > + > +Make sure we use the w64 version of the configs, since that's what > +meta-mingw is using. > + > +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> > +--- > + libstdc++-v3/configure.host | 12 ++---------- > + 1 file changed, 2 insertions(+), 10 deletions(-) > + > +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host > +index 155a3cdea..adbda8784 100644 > +--- a/libstdc++-v3/configure.host > ++++ b/libstdc++-v3/configure.host > +@@ -277,16 +277,8 @@ case "${host_os}" in > + os_include_dir="os/hpux" > + ;; > + mingw32*) > +- case "$host" in > +- *-w64-*) > +- os_include_dir="os/mingw32-w64" > +- error_constants_dir="os/mingw32-w64" > +- ;; > +- *) > +- os_include_dir="os/mingw32" > +- error_constants_dir="os/mingw32" > +- ;; > +- esac > ++ os_include_dir="os/mingw32-w64" > ++ error_constants_dir="os/mingw32-w64" > + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" > > It might make things a bit more obvious and upstreamable to just change > *-w64-*) > to > *-w64*) > if I understand correct? > > With meta-mingw, the host triplet is actually either > i686-pokysdk-mingw32 or x86_64-pokysdk-mingw32, depending on bitness > in the SDKMACHINE value. > > Hmm, it does indeed look like we are not correctly setting the host in a way it can be detected by GCC. It's a little surprising this hasn't caused any actual problems (at least up to this point)... is this something new to gcc 9.3, and do we have any idea why the AB MinGW tests aren't seeing any problems? > > Either way, it would probably be better to figure out a way to make the host look correct in meta-mingw if at all possible. > > Your commit message is also a little confusing because the first few times I read it, I thought we were configuring for 64-bit when 32-bit is desired, but based on the current GCC code being replaced and the value of the host-triplets, it would seem to be the opposite (we are getting 32-bit when 64-bit is desired). It's not actually the bitness that GCC is looking for here but the version of the MinGW. The MingGW-w64 is a fork of the original MinGW and can be used for both 32- and 64-bit builds. With the os/mingw32 config, GCC is using subset of the features that are available in os/mingw32-w64, so builds still work although perhaps not always optimally. I don't see clear way to change the host value in meta-mingw without breaking other layers and recipes. Only part that could be changed is the -mingw32 part (HOST_OS), but recipes that do mingw specific things already rely on that for the overrides. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH] gcc: make sure mingw builds use mingw32-w64 configs 2020-04-28 4:33 ` Samuli Piippo @ 2020-04-28 14:44 ` Joshua Watt 0 siblings, 0 replies; 6+ messages in thread From: Joshua Watt @ 2020-04-28 14:44 UTC (permalink / raw) To: Samuli Piippo; +Cc: Richard Purdie, Samuli Piippo, openembedded-core On 4/27/20 11:33 PM, Samuli Piippo wrote: > On Mon, 27 Apr 2020 at 23:20, Joshua Watt <jpewhacker@gmail.com> wrote: >> >> On 4/27/20 12:35 PM, Samuli Piippo wrote: >> >> On Mon, 27 Apr 2020 at 17:51, Richard Purdie >> <richard.purdie@linuxfoundation.org> wrote: >> >> On Mon, 2020-04-27 at 16:13 +0300, Samuli Piippo wrote: >> >> meta-mingw is using Mingw-w64 but the host triplet does not match >> the expected pattern. config/os/mingw32-w64 enables more features >> that were not working with mingw32. >> >> Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> >> --- >> meta/recipes-devtools/gcc/gcc-9.3.inc | 1 + >> ...nfig-os-mingw32-w64-for-mingw-builds.patch | 36 +++++++++++++++++++ >> 2 files changed, 37 insertions(+) >> create mode 100644 meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >> >> diff --git a/meta/recipes-devtools/gcc/gcc-9.3.inc b/meta/recipes-devtools/gcc/gcc-9.3.inc >> index b0411078d3..4c8275bf2a 100644 >> --- a/meta/recipes-devtools/gcc/gcc-9.3.inc >> +++ b/meta/recipes-devtools/gcc/gcc-9.3.inc >> @@ -67,6 +67,7 @@ SRC_URI = "\ >> file://0037-CVE-2019-14250-Check-zero-value-in-simple_object_elf.patch \ >> file://0038-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ >> file://0039-process_alt_operands-Don-t-match-user-defined-regs-o.patch \ >> + file://0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch \ >> " >> S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" >> SRC_URI[sha256sum] = "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" >> diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >> new file mode 100644 >> index 0000000000..5a167f252c >> --- /dev/null >> +++ b/meta/recipes-devtools/gcc/gcc-9.3/0040-Always-use-config-os-mingw32-w64-for-mingw-builds.patch >> @@ -0,0 +1,36 @@ >> +From 052f7e5db0d793155015530b639c4e42d37eb7eb Mon Sep 17 00:00:00 2001 >> +From: Samuli Piippo <samuli.piippo@qt.io> >> +Date: Fri, 23 Aug 2019 10:10:43 +0300 >> +Subject: [PATCH] Always use config/os/mingw32-w64 for mingw builds >> + >> +Make sure we use the w64 version of the configs, since that's what >> +meta-mingw is using. >> + >> +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> >> +--- >> + libstdc++-v3/configure.host | 12 ++---------- >> + 1 file changed, 2 insertions(+), 10 deletions(-) >> + >> +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host >> +index 155a3cdea..adbda8784 100644 >> +--- a/libstdc++-v3/configure.host >> ++++ b/libstdc++-v3/configure.host >> +@@ -277,16 +277,8 @@ case "${host_os}" in >> + os_include_dir="os/hpux" >> + ;; >> + mingw32*) >> +- case "$host" in >> +- *-w64-*) >> +- os_include_dir="os/mingw32-w64" >> +- error_constants_dir="os/mingw32-w64" >> +- ;; >> +- *) >> +- os_include_dir="os/mingw32" >> +- error_constants_dir="os/mingw32" >> +- ;; >> +- esac >> ++ os_include_dir="os/mingw32-w64" >> ++ error_constants_dir="os/mingw32-w64" >> + OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" >> >> It might make things a bit more obvious and upstreamable to just change >> *-w64-*) >> to >> *-w64*) >> if I understand correct? >> >> With meta-mingw, the host triplet is actually either >> i686-pokysdk-mingw32 or x86_64-pokysdk-mingw32, depending on bitness >> in the SDKMACHINE value. >> >> Hmm, it does indeed look like we are not correctly setting the host in a way it can be detected by GCC. It's a little surprising this hasn't caused any actual problems (at least up to this point)... is this something new to gcc 9.3, and do we have any idea why the AB MinGW tests aren't seeing any problems? >> >> Either way, it would probably be better to figure out a way to make the host look correct in meta-mingw if at all possible. >> >> Your commit message is also a little confusing because the first few times I read it, I thought we were configuring for 64-bit when 32-bit is desired, but based on the current GCC code being replaced and the value of the host-triplets, it would seem to be the opposite (we are getting 32-bit when 64-bit is desired). > It's not actually the bitness that GCC is looking for here but the > version of the MinGW. The MingGW-w64 is a fork of the original MinGW > and can be used for both 32- and 64-bit builds. With the os/mingw32 > config, GCC is using subset of the features that are available in > os/mingw32-w64, so builds still work although perhaps not always > optimally. > > I don't see clear way to change the host value in meta-mingw without > breaking other layers and recipes. Only part that could be changed is > the -mingw32 part (HOST_OS), but recipes that do mingw specific things > already rely on that for the overrides. Ah, OK you've jogged my memory now, I remember. The mingw32-64 project is compatible with both 32-bit and 64-bit Windows. However, this makes me think even more that we a better way to fix this, because GCC might not be the only one doing this check and I don't want to add patches like this that can't be upstreamed to a bunch of recipes to force them to use mingw32-64. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-04-28 14:44 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-04-27 13:13 [PATCH] gcc: make sure mingw builds use mingw32-w64 configs Samuli Piippo 2020-04-27 14:51 ` [OE-core] " Richard Purdie 2020-04-27 17:35 ` Samuli Piippo 2020-04-27 20:20 ` Joshua Watt 2020-04-28 4:33 ` Samuli Piippo 2020-04-28 14:44 ` Joshua Watt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox