From 29aabba0ea759c6a2864ff5631735b67ee38e5e0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 5 Feb 2020 18:44:56 +0000 Subject: gentoo resync : 05.02.2020 --- dev-util/mingw64-runtime/Manifest | 2 + .../mingw64-runtime-7.0.0-fortify-only-ssp.patch | 16 +++ .../mingw64-runtime-7.0.0-r1.ebuild | 118 +++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 dev-util/mingw64-runtime/files/mingw64-runtime-7.0.0-fortify-only-ssp.patch create mode 100644 dev-util/mingw64-runtime/mingw64-runtime-7.0.0-r1.ebuild (limited to 'dev-util/mingw64-runtime') diff --git a/dev-util/mingw64-runtime/Manifest b/dev-util/mingw64-runtime/Manifest index 71146c760210..79fcf975c5a4 100644 --- a/dev-util/mingw64-runtime/Manifest +++ b/dev-util/mingw64-runtime/Manifest @@ -1,5 +1,7 @@ +AUX mingw64-runtime-7.0.0-fortify-only-ssp.patch 637 BLAKE2B 3a8eff14b3150446da51354324a3b29e327982fd586339e5f8df4309de2bbdb2722773e0d145d87363183ff70fd02fcdcbc46c560bef9a5111dc33ee8105bede SHA512 991d4294d81a05bfa86d2bed102b3f5bf58435ef02b0a38abe905cc4a0416896b01ffc3a2fe64e78d44e78c9c65051428426b7d19561bd337a229bf7281c7040 DIST mingw-w64-v6.0.0.tar.bz2 9045653 BLAKE2B 8a54dca2d06c92ab968a93240996d07ab3b1ed4652555a48b7581c477856d5784ed192c578d78186e171e400bd18b4de3c6cafbdd96109367ad13c37792015c1 SHA512 e3d3663e0cb33a16f90b1a33e81b5a30d26f7e34270b14e865c10068f2a2d32da9ef8cbbb0c3fed9c71429ae11c82152ff3b87d81558929b2a4993dc99cfc11e DIST mingw-w64-v7.0.0.tar.bz2 9071231 BLAKE2B da00794ec456ede5913a565248c79255407c058469cb7338cf81b8d03c1e39f4189016b01734b786c0ad8f18166a24fdb95ca72edc954f31151e5d3aa2b2a899 SHA512 30e5b2824a24eeb99ab519e3fc134cc9a7f04ee8b853bc8d66a13d1ab74144bf78b93e162bfe6de2a5e61f63c0e620a933b260b02d019cd68cc4b78bd36c67fd EBUILD mingw64-runtime-6.0.0-r3.ebuild 2958 BLAKE2B 8f91f93b5cf45c52dd8750eacf640a76d56115710a5e58930a6176db7c54a67a42ad59ad74c5503235fa946473bb8c1bbba68b5fd939640768e22375f95696b8 SHA512 30cc5cb2e975a0048007734836b8ef0052ea9470622d71fcc4c2e343996f564b9f402fc273a8bdd03961148a8156c6e38fd8eff6b26c1d830d47d6c619a81bbd +EBUILD mingw64-runtime-7.0.0-r1.ebuild 2973 BLAKE2B ed88e0b84beaddf41c8464897af520f5cd10af2680953935a4b088c67e5d355f57187f6f6d9cd22327493a33e37c6a27f4afb74e86ecb42f7ded830af5ce3969 SHA512 f9387e967090fd8b40f88c1733c3f2e8b1ff5bf60b142986074f3f4186247e83d63dd2765c296981b14aae60772b29cc5d6a382d542477a59766d4e07f2ec54f EBUILD mingw64-runtime-7.0.0.ebuild 2917 BLAKE2B ff108cced053a135936dd0deea64c585a010831b002118de38cd7b816decf3daded03cabe6caaee684930e73c32a71731690eb8be4dc0f8398cbce978fe104af SHA512 ef52c741f89719f7284a516b4b4651a0ea0d8aafade99153e5e5d7541a8d12b083f9b5458450cae66f617a0890c052a50869b22c7a35112b086459c3acd0f623 MISC metadata.xml 643 BLAKE2B a66741716a2729da314650e4435c616a0a3912cedcc142f23ce74b23c59e21b8a456697a7d38880c1b7d876909ba4b3617a0c72c9f054fcbcbe68841d76c5903 SHA512 fd9528a194bcda889d719ba7f4759414b86cc0d75d9790a9478c46e2abf62b01355e4e01b8e05b7accda0ff0dab94607182671f367cf600e47443b0d4a0bcd53 diff --git a/dev-util/mingw64-runtime/files/mingw64-runtime-7.0.0-fortify-only-ssp.patch b/dev-util/mingw64-runtime/files/mingw64-runtime-7.0.0-fortify-only-ssp.patch new file mode 100644 index 000000000000..72ddd775a2ea --- /dev/null +++ b/dev-util/mingw64-runtime/files/mingw64-runtime-7.0.0-fortify-only-ssp.patch @@ -0,0 +1,16 @@ +--- a/mingw-w64-headers/crt/_mingw_mac.h ++++ b/mingw-w64-headers/crt/_mingw_mac.h +@@ -301,7 +301,12 @@ + # define __mingw_attribute_artificial + #endif + +-#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 && __MINGW_GNUC_PREREQ(4, 1) ++/* __SSP__ is a workaround to avoid reference to libssp when user did not request it: ++ * https://sourceforge.net/p/mingw-w64/bugs/818/ ++ * Otherwise it breaks both USE=ssp gcc bootstrap and projects that happen to use ++ * strcpy/memcpy. ++ */ ++#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 && __MINGW_GNUC_PREREQ(4, 1) && __SSP__ > 0 + # if _FORTIFY_SOURCE > 1 + # define __MINGW_FORTIFY_LEVEL 2 + # else diff --git a/dev-util/mingw64-runtime/mingw64-runtime-7.0.0-r1.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-7.0.0-r1.ebuild new file mode 100644 index 000000000000..82f85e2e5435 --- /dev/null +++ b/dev-util/mingw64-runtime/mingw64-runtime-7.0.0-r1.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY} == cross-* ]] ; then + export CTARGET=${CATEGORY#cross-} + fi +fi + +inherit autotools flag-o-matic eutils + +DESCRIPTION="Free Win64 runtime and import library definitions" +HOMEPAGE="http://mingw-w64.sourceforge.net/" +SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +# USE=libraries needs working stage2 compiler: bug #665512 +IUSE="headers-only idl libraries tools" +RESTRICT="strip" + +S="${WORKDIR}/mingw-w64-v${PV}" + +PATCHES=( + "${FILESDIR}"/${P}-fortify-only-ssp.patch +) + +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} +just_headers() { + use headers-only +} +alt_prefix() { + is_crosscompile && echo /usr/${CTARGET} +} +crt_with() { + just_headers && echo --without-$1 || echo --with-$1 +} +crt_use_enable() { + just_headers && echo --without-$2 || use_enable "$@" +} +crt_use_with() { + just_headers && echo --without-$2 || use_with "$@" +} + +pkg_setup() { + if [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then + die "Invalid configuration" + fi +} + +src_configure() { + CHOST=${CTARGET} strip-unsupported-flags + # Normally mingw-64 does not use dynamic linker. + # But at configure time it uses $LDFLAGS. + # When default -Wl,--hash-style=gnu is passed + # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected + # for target ld and binaries crash at shutdown. + filter-ldflags '-Wl,--hash-style=*' + + if ! just_headers; then + mkdir "${WORKDIR}/headers" + pushd "${WORKDIR}/headers" > /dev/null + CHOST=${CTARGET} "${S}/configure" \ + --prefix="${T}/tmproot" \ + --with-headers \ + --without-crt \ + || die + popd > /dev/null + append-cppflags "-I${T}/tmproot/include" + fi + + # By default configure tries to set --sysroot=${prefix}. We disable + # this behaviour with --with-sysroot=no to use gcc's sysroot default. + # That way we can cross-build mingw64-runtime with cross-emerge. + local prefix="${EPREFIX}"$(alt_prefix)/usr + CHOST=${CTARGET} econf \ + --with-sysroot=no \ + --prefix="${prefix}" \ + --libdir="${prefix}"/lib \ + --with-headers \ + --enable-sdk \ + $(crt_with crt) \ + $(crt_use_enable idl idl) \ + $(crt_use_with libraries libraries) \ + $(crt_use_with tools tools) \ + $( + $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - < /dev/null | grep -q __MINGW64__ \ + && echo --disable-lib32 --enable-lib64 \ + || echo --enable-lib32 --disable-lib64 + ) +} + +src_compile() { + if ! just_headers; then + emake -C "${WORKDIR}/headers" install + fi + default +} + +src_install() { + default + + if is_crosscompile ; then + # gcc is configured to look at specific hard-coded paths for mingw #419601 + dosym usr /usr/${CTARGET}/mingw + dosym usr /usr/${CTARGET}/${CTARGET} + dosym usr/include /usr/${CTARGET}/sys-include + fi + + rm -rf "${ED}/usr/share" +} -- cgit v1.2.3