Skip to contentSkip to conversation

mingw-w64-runtime: Fix build with gcc8

PATCH Superseded Khem Raj 2 participants 3 messages Jun 7, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mingw-w64-runtime: Fix build with gcc8

---
 .../mingw-w64/mingw-w64-headers/gcc8.patch    | 30 +++++++++++++++++++
 .../mingw-w64/mingw-w64-headers_5.0.3.bb      |  5 ++--
 .../mingw-w64/mingw-w64-runtime_5.0.3.bb      |  2 ++
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch
recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch new file +30 -0
new file mode 100644
index 0000000..2b0eba3
@@ -0,0 +1,30 @@
+>From revision 248028 in GCC 8 there is defined function _xgetbv:
+https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/i386/xsaveintrin.h?r1=248028&r2=248027&pathrev=248028
+
+It conflicting with mingw-w64 definition from mingw-w64-headers/include/psdk_inc/intrin-impl.h
+
+workaround for mingw-w64:
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending [https://sourceforge.net/p/mingw-w64/mailman/message/35866694/]
+
+Index: mingw-w64-headers/include/psdk_inc/intrin-impl.h
+===================================================================
+--- mingw-w64-headers.orig/include/psdk_inc/intrin-impl.h
++++ mingw-w64-headers/include/psdk_inc/intrin-impl.h
+@@ -1406,6 +1406,7 @@ __buildmov(__movsd, unsigned __LONG32, "
+ #endif /* __INTRINSIC_PROLOG */
+ 
+ /* NOTE: This should be in immintrin.h */
++#if __GNUC__ < 8 /* GCC 8 already has _xgetbv defined */
+ #if __INTRINSIC_PROLOG(_xgetbv)
+ unsigned __int64 _xgetbv(unsigned int);
+ __INTRINSICS_USEINLINE
+@@ -1426,6 +1427,7 @@ unsigned __int64 _xgetbv(unsigned int in
+ }
+ #define __INTRINSIC_DEFINED__xgetbv
+ #endif /* __INTRINSIC_PROLOG */
++#endif /* __GNUC__ < 8 */
+ 
+ #endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
+ 
recipes-devtools/mingw-w64/mingw-w64-headers_5.0.3.bb +3 -2
index 31fa66f..58d7552 100644
@@ -5,8 +5,9 @@ LIC_FILES_CHKSUM = "file://../COPYING;md5=bb936f0e04d8f1e19ad545100cee9654"
 COMPATIBLE_HOST = ".*-mingw.*"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2 \
-           file://epsilon.patch"
-
+           file://epsilon.patch \
+           file://gcc8.patch \
+          "
 SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c"
 SRC_URI[sha256sum] = "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4"
 
recipes-devtools/mingw-w64/mingw-w64-runtime_5.0.3.bb +2 -0
index 928a464..0884778 100644
@@ -43,3 +43,5 @@ do_configure() {
 FILES_${PN} += "${exec_prefix}/libsrc"
 
 BBCLASSEXTEND = "nativesdk"
+
+SECURITY_CFLAGS_remove_mingw32 = "-fstack-protector-strong"
Signature · 1 line
2.17.1
#1 lore raw

I've a nigh-on identical patch in master-next running on the AB already:

http://git.yoctoproject.org/cgit.cgi/meta-mingw/commit/?h=master-next&id=46b1bfd8ef26dd9c778504143d4dea2fbe2ce90f

Don't have the security flags bit though (our mingw builds don't use that), can you rebase to master-next and submit that?

Ross

Quoted 78 lines · Khem Raj
---
 .../mingw-w64/mingw-w64-headers/gcc8.patch    | 30 +++++++++++++++++++
 .../mingw-w64/mingw-w64-headers_5.0.3.bb      |  5 ++--
 .../mingw-w64/mingw-w64-runtime_5.0.3.bb      |  2 ++
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch
recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch new file +30 -0
new file mode 100644
index 0000000..2b0eba3
@@ -0,0 +1,30 @@
+>From revision 248028 in GCC 8 there is defined function _xgetbv:
+https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/i386/xsaveintrin.h?r1=248028&r2=248027&pathrev=248028
+
+It conflicting with mingw-w64 definition from mingw-w64-headers/include/psdk_inc/intrin-impl.h
+
+workaround for mingw-w64:
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending [https://sourceforge.net/p/mingw-w64/mailman/message/35866694/]
+
+Index: mingw-w64-headers/include/psdk_inc/intrin-impl.h
+===================================================================
+--- mingw-w64-headers.orig/include/psdk_inc/intrin-impl.h
++++ mingw-w64-headers/include/psdk_inc/intrin-impl.h
+@@ -1406,6 +1406,7 @@ __buildmov(__movsd, unsigned __LONG32, "
+ #endif /* __INTRINSIC_PROLOG */
+
+ /* NOTE: This should be in immintrin.h */
++#if __GNUC__ < 8 /* GCC 8 already has _xgetbv defined */
+ #if __INTRINSIC_PROLOG(_xgetbv)
+ unsigned __int64 _xgetbv(unsigned int);
+ __INTRINSICS_USEINLINE
+@@ -1426,6 +1427,7 @@ unsigned __int64 _xgetbv(unsigned int in
+ }
+ #define __INTRINSIC_DEFINED__xgetbv
+ #endif /* __INTRINSIC_PROLOG */
++#endif /* __GNUC__ < 8 */
+
+ #endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
+
recipes-devtools/mingw-w64/mingw-w64-headers_5.0.3.bb +3 -2
index 31fa66f..58d7552 100644
@@ -5,8 +5,9 @@ LIC_FILES_CHKSUM = "file://../COPYING;md5=bb936f0e04d8f1e19ad545100cee9654"
 COMPATIBLE_HOST = ".*-mingw.*"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2 \
-           file://epsilon.patch"
-
+           file://epsilon.patch \
+           file://gcc8.patch \
+          "
 SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c"
 SRC_URI[sha256sum] = "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4"
 
recipes-devtools/mingw-w64/mingw-w64-runtime_5.0.3.bb +2 -1
index 928a464..0884778 100644
@@ -43,3 +43,5 @@ do_configure() {
 FILES_${PN} += "${exec_prefix}/libsrc"
 
 BBCLASSEXTEND = "nativesdk"
+
+SECURITY_CFLAGS_remove_mingw32 = "-fstack-protector-strong"
--

2.17.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#2 lore raw
Quoted 7 lines · Ross

I've a nigh-on identical patch in master-next running on the AB already:

http://git.yoctoproject.org/cgit.cgi/meta-mingw/commit/?h=master-next&id=46b1bfd8ef26dd9c778504143d4dea2fbe2ce90f

Don't have the security flags bit though (our mingw builds don't use that), can you rebase to master-next and submit that?

thanks for doing this. I sent another fix on top as a prize to you.

Quoted 82 lines

Ross

Quoted 78 lines · Khem Raj
---
 .../mingw-w64/mingw-w64-headers/gcc8.patch    | 30 +++++++++++++++++++
 .../mingw-w64/mingw-w64-headers_5.0.3.bb      |  5 ++--
 .../mingw-w64/mingw-w64-runtime_5.0.3.bb      |  2 ++
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch
recipes-devtools/mingw-w64/mingw-w64-headers/gcc8.patch new file +30 -0
new file mode 100644
index 0000000..2b0eba3
@@ -0,0 +1,30 @@
+>From revision 248028 in GCC 8 there is defined function _xgetbv:
+https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/i386/xsaveintrin.h?r1=248028&r2=248027&pathrev=248028
+
+It conflicting with mingw-w64 definition from mingw-w64-headers/include/psdk_inc/intrin-impl.h
+
+workaround for mingw-w64:
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending [https://sourceforge.net/p/mingw-w64/mailman/message/35866694/]
+
+Index: mingw-w64-headers/include/psdk_inc/intrin-impl.h
+===================================================================
+--- mingw-w64-headers.orig/include/psdk_inc/intrin-impl.h
++++ mingw-w64-headers/include/psdk_inc/intrin-impl.h
+@@ -1406,6 +1406,7 @@ __buildmov(__movsd, unsigned __LONG32, "
+ #endif /* __INTRINSIC_PROLOG */
+
+ /* NOTE: This should be in immintrin.h */
++#if __GNUC__ < 8 /* GCC 8 already has _xgetbv defined */
+ #if __INTRINSIC_PROLOG(_xgetbv)
+ unsigned __int64 _xgetbv(unsigned int);
+ __INTRINSICS_USEINLINE
+@@ -1426,6 +1427,7 @@ unsigned __int64 _xgetbv(unsigned int in
+ }
+ #define __INTRINSIC_DEFINED__xgetbv
+ #endif /* __INTRINSIC_PROLOG */
++#endif /* __GNUC__ < 8 */
+
+ #endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
+
recipes-devtools/mingw-w64/mingw-w64-headers_5.0.3.bb +3 -2
index 31fa66f..58d7552 100644
@@ -5,8 +5,9 @@ LIC_FILES_CHKSUM = "file://../COPYING;md5=bb936f0e04d8f1e19ad545100cee9654"
 COMPATIBLE_HOST = ".*-mingw.*"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2 \
-           file://epsilon.patch"
-
+           file://epsilon.patch \
+           file://gcc8.patch \
+          "
 SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c"
 SRC_URI[sha256sum] = "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4"
 
recipes-devtools/mingw-w64/mingw-w64-runtime_5.0.3.bb +2 -1
index 928a464..0884778 100644
@@ -43,3 +43,5 @@ do_configure() {
 FILES_${PN} += "${exec_prefix}/libsrc"
 
 BBCLASSEXTEND = "nativesdk"
+
+SECURITY_CFLAGS_remove_mingw32 = "-fstack-protector-strong"
--

2.17.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto