Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
2/2 is also unrelated, there should 3 patches from me, sent at the same time. Don’t know where they got stuck. > On 15 Nov 2018, at 19.21, Burton, Ross wrote: > > I see 1/2 but no 2/2, presumably this missing patch is the PIE one? > > Ross >> On Thu, 15 Nov 2018 at 16:04, Samuli Piippo wrote: >> >> Use the winpthreads library available in the mingw64 and >> change the thread model from win32 to posix to get access >> to c++11 features. >> >> Signed-off-by: Samuli Piippo >> --- >> conf/machine-sdk/include/mingw32-common.inc | 2 - >> recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- >> recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- >> recipes-devtools/gcc/libgcc_%.bbappend| 2 + >> .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ >> .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 >> .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- >> 7 files changed, 40 insertions(+), 54 deletions(-) >> create mode 100644 >> recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb >> delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb >> >> diff --git a/conf/machine-sdk/include/mingw32-common.inc >> b/conf/machine-sdk/include/mingw32-common.inc >> index cd56380..733d092 100644 >> --- a/conf/machine-sdk/include/mingw32-common.inc >> +++ b/conf/machine-sdk/include/mingw32-common.inc >> @@ -1,8 +1,6 @@ >> SDK_OS = "mingw32" >> NATIVESDKLIBC = "libc-mingw" >> >> -GCCTHREADS_mingw32 = "win32" >> - >> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = >> "nativesdk-mingw-w64-runtime" >> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = >> "nativesdk-mingw-w64-runtime" >> PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" >> diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend >> b/recipes-core/gettext/gettext_0.19.%.bbappend >> index b26b734..21749f3 100644 >> --- a/recipes-core/gettext/gettext_0.19.%.bbappend >> +++ b/recipes-core/gettext/gettext_0.19.%.bbappend >> @@ -1,7 +1,4 @@ >> -DEPENDS_append_mingw32 = " pthreads-win32" >> -LDFLAGS_prepend_mingw32 = " -lpthread " >> - >> -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" >> +EXTRA_OECONF_append_mingw32 = " --enable-static" >> >> FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" >> SRC_URI_append_mingw32 = " \ >> diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend >> b/recipes-devtools/gcc/gcc-runtime_%.bbappend >> index 1641cb9..f14edf1 100644 >> --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend >> +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend >> @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" >> # mingw builds >> RUNTIMETARGET_remove_mingw32 = "libmpx" >> >> -DEPENDS_append_mingw32 = " pthreads-win32" >> +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" >> diff --git a/recipes-devtools/gcc/libgcc_%.bbappend >> b/recipes-devtools/gcc/libgcc_%.bbappend >> index 2a95d02..f542cfc 100644 >> --- a/recipes-devtools/gcc/libgcc_%.bbappend >> +++ b/recipes-devtools/gcc/libgcc_%.bbappend >> @@ -1,3 +1,5 @@ >> +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" >> + >> FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" >> FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" >> >> diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb >> b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb >> index e129c32..009e5af 100644 >> --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb >> +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb >> @@ -31,4 +31,9 @@ do_compile() { >>: >> } >> >> +do_install_append() { >> +# install correct pthread headers >> +install -m 0644 -t ${D}${includedir} >> ${S}/../mingw-w64-libraries/winpthreads/include/*.h >> +} >> + >> FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" >> diff --git >> a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb >> b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb >> new file mode 100644 >> index 000..1308760 >> --- /dev/null >> +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb >> @@ -0,0 +1,31 @@ >> +DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" >> +LICENSE = "ZPL-2.1" >> +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" >> +SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c" >> +SRC_URI[sha256sum] = >> "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4" >> + >> +S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" >> +B = "${WORKDIR}/build-${TARGET_SYS}" >> + >> +inherit autotools nativesdk >> + >> +INHIBIT_DEFAULT_DEPS = "1" >> +DEPENDS = "nativesdk-mingw-w64-runtime
Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
Sure, it’ll take me couple of hours though. Let’s see if the missing emails appear meanwhile. > On 15 Nov 2018, at 19.33, Burton, Ross wrote: > > Weird. > > Can you push them to a git repo? > > Ross >> On Thu, 15 Nov 2018 at 17:32, Samuli Piippo wrote: >> >> >> 2/2 is also unrelated, there should 3 patches from me, sent at the same >> time. Don’t know where they got stuck. >> >>> On 15 Nov 2018, at 19.21, Burton, Ross wrote: >>> >>> I see 1/2 but no 2/2, presumably this missing patch is the PIE one? >>> >>> Ross On Thu, 15 Nov 2018 at 16:04, Samuli Piippo wrote: Use the winpthreads library available in the mingw64 and change the thread model from win32 to posix to get access to c++11 features. Signed-off-by: Samuli Piippo --- conf/machine-sdk/include/mingw32-common.inc | 2 - recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- recipes-devtools/gcc/libgcc_%.bbappend| 2 + .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- 7 files changed, 40 insertions(+), 54 deletions(-) create mode 100644 recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb diff --git a/conf/machine-sdk/include/mingw32-common.inc b/conf/machine-sdk/include/mingw32-common.inc index cd56380..733d092 100644 --- a/conf/machine-sdk/include/mingw32-common.inc +++ b/conf/machine-sdk/include/mingw32-common.inc @@ -1,8 +1,6 @@ SDK_OS = "mingw32" NATIVESDKLIBC = "libc-mingw" -GCCTHREADS_mingw32 = "win32" - PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = "nativesdk-mingw-w64-runtime" PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = "nativesdk-mingw-w64-runtime" PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend b/recipes-core/gettext/gettext_0.19.%.bbappend index b26b734..21749f3 100644 --- a/recipes-core/gettext/gettext_0.19.%.bbappend +++ b/recipes-core/gettext/gettext_0.19.%.bbappend @@ -1,7 +1,4 @@ -DEPENDS_append_mingw32 = " pthreads-win32" -LDFLAGS_prepend_mingw32 = " -lpthread " - -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" +EXTRA_OECONF_append_mingw32 = " --enable-static" FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" SRC_URI_append_mingw32 = " \ diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend b/recipes-devtools/gcc/gcc-runtime_%.bbappend index 1641cb9..f14edf1 100644 --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" # mingw builds RUNTIMETARGET_remove_mingw32 = "libmpx" -DEPENDS_append_mingw32 = " pthreads-win32" +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" diff --git a/recipes-devtools/gcc/libgcc_%.bbappend b/recipes-devtools/gcc/libgcc_%.bbappend index 2a95d02..f542cfc 100644 --- a/recipes-devtools/gcc/libgcc_%.bbappend +++ b/recipes-devtools/gcc/libgcc_%.bbappend @@ -1,3 +1,5 @@ +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" + FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb index e129c32..009e5af 100644 --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb @@ -31,4 +31,9 @@ do_compile() { : } +do_install_append() { +# install correct pthread headers +install -m 0644 -t ${D}${includedir} ${S}/../mingw-w64-libraries/winpthreads/include/*.h +} + FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb new file mode 100644 index 000..1308760 --- /dev/null +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb @@ -0,0 +1,31 @@ +DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" +LICENSE = "ZPL-2.1" +LIC_FILES_CHKSUM = "file://../../COPYING;md5=bb936f0e04d8f1e19ad545100cee9654" + +COMPATIBLE_HOST = ".*-mingw.*" +
Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
I don't have access to the contrib git repo, so pushed them here instead: https://github.com/sapiippo/meta-mingw/ From: Samuli Piippo Sent: 15 November 2018 19:45:29 To: Burton, Ross Cc: Yocto-mailing-list Subject: Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64 Sure, it’ll take me couple of hours though. Let’s see if the missing emails appear meanwhile. > On 15 Nov 2018, at 19.33, Burton, Ross wrote: > > Weird. > > Can you push them to a git repo? > > Ross >> On Thu, 15 Nov 2018 at 17:32, Samuli Piippo wrote: >> >> >> 2/2 is also unrelated, there should 3 patches from me, sent at the same >> time. Don’t know where they got stuck. >> >>> On 15 Nov 2018, at 19.21, Burton, Ross wrote: >>> >>> I see 1/2 but no 2/2, presumably this missing patch is the PIE one? >>> >>> Ross >>>> On Thu, 15 Nov 2018 at 16:04, Samuli Piippo wrote: >>>> >>>> Use the winpthreads library available in the mingw64 and >>>> change the thread model from win32 to posix to get access >>>> to c++11 features. >>>> >>>> Signed-off-by: Samuli Piippo >>>> --- >>>> conf/machine-sdk/include/mingw32-common.inc | 2 - >>>> recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- >>>> recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- >>>> recipes-devtools/gcc/libgcc_%.bbappend| 2 + >>>> .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ >>>> .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 >>>> .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- >>>> 7 files changed, 40 insertions(+), 54 deletions(-) >>>> create mode 100644 >>>> recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb >>>> delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb >>>> >>>> diff --git a/conf/machine-sdk/include/mingw32-common.inc >>>> b/conf/machine-sdk/include/mingw32-common.inc >>>> index cd56380..733d092 100644 >>>> --- a/conf/machine-sdk/include/mingw32-common.inc >>>> +++ b/conf/machine-sdk/include/mingw32-common.inc >>>> @@ -1,8 +1,6 @@ >>>> SDK_OS = "mingw32" >>>> NATIVESDKLIBC = "libc-mingw" >>>> >>>> -GCCTHREADS_mingw32 = "win32" >>>> - >>>> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = >>>> "nativesdk-mingw-w64-runtime" >>>> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = >>>> "nativesdk-mingw-w64-runtime" >>>> PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" >>>> diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend >>>> b/recipes-core/gettext/gettext_0.19.%.bbappend >>>> index b26b734..21749f3 100644 >>>> --- a/recipes-core/gettext/gettext_0.19.%.bbappend >>>> +++ b/recipes-core/gettext/gettext_0.19.%.bbappend >>>> @@ -1,7 +1,4 @@ >>>> -DEPENDS_append_mingw32 = " pthreads-win32" >>>> -LDFLAGS_prepend_mingw32 = " -lpthread " >>>> - >>>> -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" >>>> +EXTRA_OECONF_append_mingw32 = " --enable-static" >>>> >>>> FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" >>>> SRC_URI_append_mingw32 = " \ >>>> diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend >>>> b/recipes-devtools/gcc/gcc-runtime_%.bbappend >>>> index 1641cb9..f14edf1 100644 >>>> --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend >>>> +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend >>>> @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" >>>> # mingw builds >>>> RUNTIMETARGET_remove_mingw32 = "libmpx" >>>> >>>> -DEPENDS_append_mingw32 = " pthreads-win32" >>>> +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" >>>> diff --git a/recipes-devtools/gcc/libgcc_%.bbappend >>>> b/recipes-devtools/gcc/libgcc_%.bbappend >>>> index 2a95d02..f542cfc 100644 >>>> --- a/recipes-devtools/gcc/libgcc_%.bbappend >>>> +++ b/recipes-devtools/gcc/libgcc_%.bbappend >>>> @@ -1,3 +1,5 @@ >>>> +DEPENDS_append_mingw32 = " na
Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
Weird. Can you push them to a git repo? Ross On Thu, 15 Nov 2018 at 17:32, Samuli Piippo wrote: > > > 2/2 is also unrelated, there should 3 patches from me, sent at the same time. > Don’t know where they got stuck. > > > On 15 Nov 2018, at 19.21, Burton, Ross wrote: > > > > I see 1/2 but no 2/2, presumably this missing patch is the PIE one? > > > > Ross > >> On Thu, 15 Nov 2018 at 16:04, Samuli Piippo wrote: > >> > >> Use the winpthreads library available in the mingw64 and > >> change the thread model from win32 to posix to get access > >> to c++11 features. > >> > >> Signed-off-by: Samuli Piippo > >> --- > >> conf/machine-sdk/include/mingw32-common.inc | 2 - > >> recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- > >> recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- > >> recipes-devtools/gcc/libgcc_%.bbappend| 2 + > >> .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ > >> .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 > >> .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- > >> 7 files changed, 40 insertions(+), 54 deletions(-) > >> create mode 100644 > >> recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > >> delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb > >> > >> diff --git a/conf/machine-sdk/include/mingw32-common.inc > >> b/conf/machine-sdk/include/mingw32-common.inc > >> index cd56380..733d092 100644 > >> --- a/conf/machine-sdk/include/mingw32-common.inc > >> +++ b/conf/machine-sdk/include/mingw32-common.inc > >> @@ -1,8 +1,6 @@ > >> SDK_OS = "mingw32" > >> NATIVESDKLIBC = "libc-mingw" > >> > >> -GCCTHREADS_mingw32 = "win32" > >> - > >> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = > >> "nativesdk-mingw-w64-runtime" > >> PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = > >> "nativesdk-mingw-w64-runtime" > >> PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" > >> diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend > >> b/recipes-core/gettext/gettext_0.19.%.bbappend > >> index b26b734..21749f3 100644 > >> --- a/recipes-core/gettext/gettext_0.19.%.bbappend > >> +++ b/recipes-core/gettext/gettext_0.19.%.bbappend > >> @@ -1,7 +1,4 @@ > >> -DEPENDS_append_mingw32 = " pthreads-win32" > >> -LDFLAGS_prepend_mingw32 = " -lpthread " > >> - > >> -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" > >> +EXTRA_OECONF_append_mingw32 = " --enable-static" > >> > >> FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" > >> SRC_URI_append_mingw32 = " \ > >> diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend > >> b/recipes-devtools/gcc/gcc-runtime_%.bbappend > >> index 1641cb9..f14edf1 100644 > >> --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend > >> +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend > >> @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" > >> # mingw builds > >> RUNTIMETARGET_remove_mingw32 = "libmpx" > >> > >> -DEPENDS_append_mingw32 = " pthreads-win32" > >> +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" > >> diff --git a/recipes-devtools/gcc/libgcc_%.bbappend > >> b/recipes-devtools/gcc/libgcc_%.bbappend > >> index 2a95d02..f542cfc 100644 > >> --- a/recipes-devtools/gcc/libgcc_%.bbappend > >> +++ b/recipes-devtools/gcc/libgcc_%.bbappend > >> @@ -1,3 +1,5 @@ > >> +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" > >> + > >> FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" > >> FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" > >> > >> diff --git > >> a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > >> b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > >> index e129c32..009e5af 100644 > >> --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > >> +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > >> @@ -31,4 +31,9 @@ do_compile() { > >>: > >> } > >> > >> +do_install_append() { > >> +# install correct pthread headers > >> +install -m 0644 -t ${D}${includedir} > >> ${S}/../mingw-w64-libraries/winpthreads/include/*.h > >> +} > >> + > >> FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" > >> diff --git > >> a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > >> b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > >> new file mode 100644 > >> index 000..1308760 > >> --- /dev/null > >> +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > >> @@ -0,0 +1,31 @@ > >> +DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" > >> +LICENSE = "ZPL-2.1" > >> +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" > >> +SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c" > >>
Re: [yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
I see 1/2 but no 2/2, presumably this missing patch is the PIE one? Ross On Thu, 15 Nov 2018 at 16:04, Samuli Piippo wrote: > > Use the winpthreads library available in the mingw64 and > change the thread model from win32 to posix to get access > to c++11 features. > > Signed-off-by: Samuli Piippo > --- > conf/machine-sdk/include/mingw32-common.inc | 2 - > recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- > recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- > recipes-devtools/gcc/libgcc_%.bbappend| 2 + > .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ > .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 > .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- > 7 files changed, 40 insertions(+), 54 deletions(-) > create mode 100644 > recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb > > diff --git a/conf/machine-sdk/include/mingw32-common.inc > b/conf/machine-sdk/include/mingw32-common.inc > index cd56380..733d092 100644 > --- a/conf/machine-sdk/include/mingw32-common.inc > +++ b/conf/machine-sdk/include/mingw32-common.inc > @@ -1,8 +1,6 @@ > SDK_OS = "mingw32" > NATIVESDKLIBC = "libc-mingw" > > -GCCTHREADS_mingw32 = "win32" > - > PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = > "nativesdk-mingw-w64-runtime" > PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = > "nativesdk-mingw-w64-runtime" > PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" > diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend > b/recipes-core/gettext/gettext_0.19.%.bbappend > index b26b734..21749f3 100644 > --- a/recipes-core/gettext/gettext_0.19.%.bbappend > +++ b/recipes-core/gettext/gettext_0.19.%.bbappend > @@ -1,7 +1,4 @@ > -DEPENDS_append_mingw32 = " pthreads-win32" > -LDFLAGS_prepend_mingw32 = " -lpthread " > - > -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" > +EXTRA_OECONF_append_mingw32 = " --enable-static" > > FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" > SRC_URI_append_mingw32 = " \ > diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend > b/recipes-devtools/gcc/gcc-runtime_%.bbappend > index 1641cb9..f14edf1 100644 > --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend > +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend > @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" > # mingw builds > RUNTIMETARGET_remove_mingw32 = "libmpx" > > -DEPENDS_append_mingw32 = " pthreads-win32" > +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" > diff --git a/recipes-devtools/gcc/libgcc_%.bbappend > b/recipes-devtools/gcc/libgcc_%.bbappend > index 2a95d02..f542cfc 100644 > --- a/recipes-devtools/gcc/libgcc_%.bbappend > +++ b/recipes-devtools/gcc/libgcc_%.bbappend > @@ -1,3 +1,5 @@ > +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" > + > FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" > FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" > > diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > index e129c32..009e5af 100644 > --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb > @@ -31,4 +31,9 @@ do_compile() { > : > } > > +do_install_append() { > +# install correct pthread headers > +install -m 0644 -t ${D}${includedir} > ${S}/../mingw-w64-libraries/winpthreads/include/*.h > +} > + > FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" > diff --git > a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > new file mode 100644 > index 000..1308760 > --- /dev/null > +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb > @@ -0,0 +1,31 @@ > +DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" > +LICENSE = "ZPL-2.1" > +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" > +SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c" > +SRC_URI[sha256sum] = > "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4" > + > +S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" > +B = "${WORKDIR}/build-${TARGET_SYS}" > + > +inherit autotools nativesdk > + > +INHIBIT_DEFAULT_DEPS = "1" > +DEPENDS = "nativesdk-mingw-w64-runtime virtual/${TARGET_PREFIX}gcc-initial" > + > +do_configure() { > +oe_runconf > +} > + > +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" > +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" > +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}" >
[yocto] [meta-mingw][PATCH 1/2] winpthreads: use posix threads library from mingw64
Use the winpthreads library available in the mingw64 and change the thread model from win32 to posix to get access to c++11 features. Signed-off-by: Samuli Piippo --- conf/machine-sdk/include/mingw32-common.inc | 2 - recipes-core/gettext/gettext_0.19.%.bbappend | 5 +- recipes-devtools/gcc/gcc-runtime_%.bbappend | 2 +- recipes-devtools/gcc/libgcc_%.bbappend| 2 + .../nativesdk-mingw-w64-headers_5.0.3.bb | 5 ++ .../nativesdk-mingw-w64-winpthreads_5.0.3.bb | 31 .../pthreads-win32/pthreads-win32_2.9.1.bb| 47 --- 7 files changed, 40 insertions(+), 54 deletions(-) create mode 100644 recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb delete mode 100644 recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb diff --git a/conf/machine-sdk/include/mingw32-common.inc b/conf/machine-sdk/include/mingw32-common.inc index cd56380..733d092 100644 --- a/conf/machine-sdk/include/mingw32-common.inc +++ b/conf/machine-sdk/include/mingw32-common.inc @@ -1,8 +1,6 @@ SDK_OS = "mingw32" NATIVESDKLIBC = "libc-mingw" -GCCTHREADS_mingw32 = "win32" - PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc_mingw32 = "nativesdk-mingw-w64-runtime" PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial_mingw32 = "nativesdk-mingw-w64-runtime" PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-mingw-w64-runtime" diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend b/recipes-core/gettext/gettext_0.19.%.bbappend index b26b734..21749f3 100644 --- a/recipes-core/gettext/gettext_0.19.%.bbappend +++ b/recipes-core/gettext/gettext_0.19.%.bbappend @@ -1,7 +1,4 @@ -DEPENDS_append_mingw32 = " pthreads-win32" -LDFLAGS_prepend_mingw32 = " -lpthread " - -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static" +EXTRA_OECONF_append_mingw32 = " --enable-static" FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:" SRC_URI_append_mingw32 = " \ diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend b/recipes-devtools/gcc/gcc-runtime_%.bbappend index 1641cb9..f14edf1 100644 --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" # mingw builds RUNTIMETARGET_remove_mingw32 = "libmpx" -DEPENDS_append_mingw32 = " pthreads-win32" +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" diff --git a/recipes-devtools/gcc/libgcc_%.bbappend b/recipes-devtools/gcc/libgcc_%.bbappend index 2a95d02..f542cfc 100644 --- a/recipes-devtools/gcc/libgcc_%.bbappend +++ b/recipes-devtools/gcc/libgcc_%.bbappend @@ -1,3 +1,5 @@ +DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" + FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb index e129c32..009e5af 100644 --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb @@ -31,4 +31,9 @@ do_compile() { : } +do_install_append() { +# install correct pthread headers +install -m 0644 -t ${D}${includedir} ${S}/../mingw-w64-libraries/winpthreads/include/*.h +} + FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb new file mode 100644 index 000..1308760 --- /dev/null +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb @@ -0,0 +1,31 @@ +DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" +LICENSE = "ZPL-2.1" +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" +SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c" +SRC_URI[sha256sum] = "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4" + +S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" +B = "${WORKDIR}/build-${TARGET_SYS}" + +inherit autotools nativesdk + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "nativesdk-mingw-w64-runtime virtual/${TARGET_PREFIX}gcc-initial" + +do_configure() { +oe_runconf +} + +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}" +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" + +do_install_append() { +# headers are already installed by mingw-w64-headers +rm -rf ${D}${includedir} +} diff --git a/recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb b/recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb deleted file mode 100644 index e4a0f80..000 ---