From 2018227e9344edb9da15fc6a4a8298086cc2aa77 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 2 Jun 2019 21:45:28 +0100 Subject: gentoo resync : 02.06.2019 --- dev-lang/erlang/Manifest | 3 + dev-lang/erlang/erlang-21.3-r1.ebuild | 162 +++++++++++++++++++++++ dev-lang/erlang/files/erlang-21.3-lto.patch | 140 ++++++++++++++++++++ dev-lang/erlang/files/erlang-21.3-pgo-loop.patch | 13 ++ 4 files changed, 318 insertions(+) create mode 100644 dev-lang/erlang/erlang-21.3-r1.ebuild create mode 100644 dev-lang/erlang/files/erlang-21.3-lto.patch create mode 100644 dev-lang/erlang/files/erlang-21.3-pgo-loop.patch (limited to 'dev-lang/erlang') diff --git a/dev-lang/erlang/Manifest b/dev-lang/erlang/Manifest index 79530a47c67d..9bc282e07559 100644 --- a/dev-lang/erlang/Manifest +++ b/dev-lang/erlang/Manifest @@ -3,6 +3,8 @@ AUX 50erlang-gentoo.el 134 BLAKE2B df2da5c0c4be3e6855b51b820e3304f5c212a92d13ec4 AUX epmd.init 537 BLAKE2B 8b7c45ec9820d37b01cbbe824e0fd13f4651ac280383f8830dc42037f76f918569ce68c00d6c880ab34a95f5c2831dfb3edaf62e13112e5a1c0e77534fd9239c SHA512 231eb48c02eb183eac7aa2f6ec811b0934098e04faf49b130d5f6e184d351f3c1d6484ff5330e5c8d707473be79f220247a9b7076cf3bf27fdd659b1ccdcc111 AUX epmd.service 138 BLAKE2B f56c907ec51bb85c437235334cf01c6a43ccf2316be3b226ab557e3f71cab48baf59b5a9533a4dccb2cb61a4434e3a51d44eae06010718dbf9a732d605c40f73 SHA512 405740f8f9cd55d4ecd7420748399ab3f374b7cb09e53605f44ba49d0af86b70e4a1baf1fde05a703fb90c8a83dbcdd5cfbbf09185e9d7b58ff9612aefc2dd28 AUX erlang-20.3.2-dont-ignore-LDFLAGS.patch 1337 BLAKE2B 7272c96b1ee947a98f0a5b1f3bd1fce11e8d02f121348208196ae60af965dfde7fac15263ca0a58df96dff21785a1a63f4fc10f7e7e10c0f68a618e760e5ffd7 SHA512 59d39b1680ac3406e4c37f81a0207588208a873279920258235af54700f80bd67584c3e55c9278f893cd7813573bbec8b13195e47ba00101fc578d5a2b40fa34 +AUX erlang-21.3-lto.patch 5277 BLAKE2B 32bfdda0c1deb8bd7d2403ad6810b6f8cd8bf6ec3bfd54d02ab4637d800ef0fe77b4da883877ba3c08a9c24596c7af09069aab5449fc22627d811ccc6257f18c SHA512 fb3460e4d881e8c9bc256840d62f8ba988456abc581c01e2b8c43d1302549cdb59b179f613f65139bd89b6e1fb8395e74472ba0a000ff0dcf8af84c4593dac03 +AUX erlang-21.3-pgo-loop.patch 420 BLAKE2B e0ad61bd592c7a3ddf2410ecbcd38a3f72ad34a58223af9b73eba586cc1970b289886c71a7d7e23a69318d86bd2bb220c21bb4b7e5db1984586ed5bd81990159 SHA512 97f7239b729e9f809a4b6226a4e69a833db94cdd4f5d937b26b33ae432663ceab1c0bab7c3168ca729bd8eb3bb5ead2fbf0510ef88bb124a44541d6b18f0d0f3 AUX erlang-add-epmd-pid-file-creation-for-openrc.patch 2359 BLAKE2B 54a3148144bcbb9a4dd68e89fd609a09a9e9a0a9c7a71a4e9eaafc12632e23da44411d72c1590e482fda73d5464b1071386aa564b8d9a73b032b62c474d20570 SHA512 301aed1980a8638a8cd069ecb6e968e5c15d3e82b38580861a0ed6a2fc7a9505d99525a53a6ac19c2d9b786703aac6bf51751275a6a7fafd8f530c07ea0c7e8c AUX erlang-custom-autoconf.patch 398 BLAKE2B c99d3bc311bbca379786b9e4d29ee4983354a069508328c95e99a62bdfb8d15dbf372124acdf66c603f64acd9cabeb146e5bd5ec1e1ffd09af125fc4a076abdc SHA512 b82e09d0cd686c07b9d370e397edda10bd96435e70f4a0995ec06638e237e3b8fd0e1195ecc036b51367ffa36a0b4db5a2b1fe5d389a0b97e19d32aec51755d9 DIST erlang-20.3.8.10.tar.gz 53511918 BLAKE2B 5f430bda415a5b59e9dec3222abe311264277ee91b2e7e9e69dba1016169492dc621df314c057e39f16b7bfe01686f405b9ccde362f84c5c2f0ffde68a923ffa SHA512 0d5ab27d17ff203d2c719fd5a03d843e3046037240e97ae9ad59d9f0690cf46cfb5fac2569590ce68f62169b1b2b2bc693e9a9b82f6ab0371693c5324bd3288b @@ -32,5 +34,6 @@ EBUILD erlang-20.3.ebuild 4826 BLAKE2B 80ccf3e15c5cb5fc585c4b014b8093ce2306222d6 EBUILD erlang-21.1.1.ebuild 4429 BLAKE2B f873d7d5af5207811e314d640f88fa0e0d8bee9012d5ffd17d2c77910d2c2e68869e58d7cd68ddbde07b09c101e32f44f7dcfc6770d9a9fda7504c26a722c96e SHA512 7d8d3261811ce9f3fda2e51d24d24015ac1780100a1c7550d2606b5da6ae8cf10014cb3af109aee3b138e1fa4c9072f2ede50b4cf3beb139f7b861f805cdc597 EBUILD erlang-21.2.6.ebuild 4434 BLAKE2B d0a694be6cf620a6034235d8fa0a8bbbc9a419ba44ade3d3c946e2af662aa11fb26c1fb6b58d4541c805bcb979c8f8390374a1f423c54101f180d803e5e4a059 SHA512 734b4ca60ed34ffabac86fc4f5bd5d32c8b22ded33a12bacf9c76cfbce62590a4e8faba2ec0344d69ec6d58613ee02e9f73dbdb8eaf927d452f97421b01ea0ef EBUILD erlang-21.2.7.ebuild 4434 BLAKE2B d0a694be6cf620a6034235d8fa0a8bbbc9a419ba44ade3d3c946e2af662aa11fb26c1fb6b58d4541c805bcb979c8f8390374a1f423c54101f180d803e5e4a059 SHA512 734b4ca60ed34ffabac86fc4f5bd5d32c8b22ded33a12bacf9c76cfbce62590a4e8faba2ec0344d69ec6d58613ee02e9f73dbdb8eaf927d452f97421b01ea0ef +EBUILD erlang-21.3-r1.ebuild 4511 BLAKE2B 2c6845a8bb9ed75313108397a7231188904f27c92fb711da841c04a57bc0559724b6f9b0c761149f8801efb1d778f55e4f3bcf5576a05edd7367b788372b65e8 SHA512 f6ef4c7613150745520302652d4a322e7a333e480c9b41838b0b83545ba6b8d89691208fe18482ec5636de3d7c0e9a91af490ee52bebe14e475f032a4de88c0b EBUILD erlang-21.3.ebuild 4434 BLAKE2B d0a694be6cf620a6034235d8fa0a8bbbc9a419ba44ade3d3c946e2af662aa11fb26c1fb6b58d4541c805bcb979c8f8390374a1f423c54101f180d803e5e4a059 SHA512 734b4ca60ed34ffabac86fc4f5bd5d32c8b22ded33a12bacf9c76cfbce62590a4e8faba2ec0344d69ec6d58613ee02e9f73dbdb8eaf927d452f97421b01ea0ef MISC metadata.xml 767 BLAKE2B 7b4e24e035cc581418aa0509baad9913b3abb195414f2e91136510a5910b69a186853b352557f1e49280aae7871cc2e033b6e2ea6f22b3b73c88d78853937309 SHA512 c816f414d07fac9433a22bdfb083db600200f45cc0fcc0eb06389056df4ccdfa31767ff0a25b8f7caf1b17dffc303ff3f766a642cfd263c0c723623c31c5a716 diff --git a/dev-lang/erlang/erlang-21.3-r1.ebuild b/dev-lang/erlang/erlang-21.3-r1.ebuild new file mode 100644 index 000000000000..ed159555d82f --- /dev/null +++ b/dev-lang/erlang/erlang-21.3-r1.ebuild @@ -0,0 +1,162 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +WX_GTK_VER="3.0" + +inherit autotools eapi7-ver elisp-common java-pkg-opt-2 systemd wxwidgets + +# NOTE: If you need symlinks for binaries please tell maintainers or +# open up a bug to let it be created. + +UPSTREAM_V="$(ver_cut 1-2)" + +DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)" +HOMEPAGE="https://www.erlang.org/" +SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz + http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz + doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" +IUSE="doc emacs +hipe java +kpoll libressl odbc pgo sctp ssl systemd tk wxwidgets" + +RDEPEND=" + sys-libs/ncurses:0 + sys-libs/zlib + emacs? ( virtual/emacs ) + java? ( >=virtual/jdk-1.8:* ) + odbc? ( dev-db/unixODBC ) + sctp? ( net-misc/lksctp-tools ) + ssl? ( + !libressl? ( >=dev-libs/openssl-0.9.7d:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + systemd? ( sys-apps/systemd ) + tk? ( dev-lang/tk:0 ) + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] ) +" +DEPEND="${RDEPEND} + dev-lang/perl +" + +S="${WORKDIR}/otp-OTP-${PV}" + +PATCHES=( + "${FILESDIR}/18.2.1-wx3.0.patch" + "${FILESDIR}/${PN}-20.3.2-dont-ignore-LDFLAGS.patch" + "${FILESDIR}/${PN}-add-epmd-pid-file-creation-for-openrc.patch" + "${FILESDIR}/${PN}-custom-autoconf.patch" + "${FILESDIR}/${PN}-21.3-lto.patch" + "${FILESDIR}/${PN}-21.3-pgo-loop.patch" +) + +SITEFILE=50"${PN}"-gentoo.el + +src_prepare() { + default + + ./otp_build autoconf + find -name configure.in -execdir mv '{}' configure.ac \; || die "find failed" + eautoreconf +} + +src_configure() { + use wxwidgets && setup-wxwidgets + + local myconf=( + --disable-builtin-zlib + $(use_enable hipe) + $(use_enable kpoll kernel-poll) + $(use_with java javac) + $(use_with odbc) + $(use_enable sctp) + $(use_with ssl ssl "${EPREFIX}"/usr) + $(use_enable ssl dynamic-ssl-lib) + $(use_enable systemd) + $(use_enable pgo) + $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null") + --enable-threads + ) + econf "${myconf[@]}" +} + +src_compile() { + if use pgo; then + # disable distcc and ccache + export DISTCC_HOSTS="" + export CCACHE_DISABLE=1 + fi + + emake + + if use emacs ; then + pushd lib/tools/emacs &>/dev/null || die + elisp-compile *.el + popd &>/dev/null || die + fi +} + +extract_version() { + local path="$1" + local var_name="$2" + sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed" +} + +src_install() { + local erl_libdir_rel="$(get_libdir)/erlang" + local erl_libdir="/usr/${erl_libdir_rel}" + local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)" + local erl_erts_ver="$(extract_version erts VSN)" + local my_manpath="/usr/share/${PN}/man" + + [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version" + [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version" + + emake INSTALL_PREFIX="${D}" install + + if use doc ; then + local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" "${WORKDIR}"/doc/. "${WORKDIR}"/lib/. "${WORKDIR}"/erts-* ) + docompress -x /usr/share/doc/${PF} + else + local DOCS=("README.md") + fi + + einstalldocs + + dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl + dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc + dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript + dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call + dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp + + ## Clean up the no longer needed files + rm "${ED}/${erl_libdir}/Install" || die + + insinto "${my_manpath}" + doins -r "${WORKDIR}"/man/* + # extend MANPATH, so the normal man command can find it + # see bug 189639 + newenvd - "90erlang" <<-_EOF_ + MANPATH="${my_manpath}" + _EOF_ + + if use emacs ; then + elisp-install erlang lib/tools/emacs/*.{el,elc} + sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \ + "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die + elisp-site-file-install "${T}/${SITEFILE}" + fi + + newinitd "${FILESDIR}"/epmd.init epmd + use systemd && systemd_dounit "${FILESDIR}"/epmd.service +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-lang/erlang/files/erlang-21.3-lto.patch b/dev-lang/erlang/files/erlang-21.3-lto.patch new file mode 100644 index 000000000000..c41e89f42c6c --- /dev/null +++ b/dev-lang/erlang/files/erlang-21.3-lto.patch @@ -0,0 +1,140 @@ +https://github.com/erlang/otp/pull/2194 +https://bugs.gentoo.org/681778 + +From ed751968d8dc4c0b58210247e94409a8a52cc501 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Thu, 28 Mar 2019 08:38:56 +0000 +Subject: [PATCH] stdlib: fix re:replace on LTO builds + +Fabio Coatti reported elixir build failure in https://bugs.gentoo.org/681778. +The minimal reproducer looks like that (from otp git tree): + + $ ./configure CFLAGS='-O2 -flto' LDFLAGS='-O2 -flto=8' + $ make + $ ERL_TOP=$PWD \ + PATH=$ERL_TOP/bin:$PATH \ + \ + bin/erl \ + \ + -noshell -eval 're:replace("a","b","c",[{return,list}]).' \ + -s erlang halt + + {"init terminating in do_boot",{badarg,[{re,replace,["a","b","c",[{return,list}]], + [{file,"re.erl"},{line,362}]}, + {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]}, + {init,start_it,1,[]}, + {init,start_em,1,[]}, + {init,do_boot,3,[]}]}} + init terminating in do_boot ({badarg,[{re,replace,[[_],[_],[_],[_]],[{_},{_}]}, + {erl_eval,do_apply,6,[{_},{_}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}) + Crash dump is being written to: erl_crash.dump...done + +The failure happens in libpcre2 where stack overflow is mis-identified +at function entry of + + erts_pcre_compile2() + compile_regex() + if (PUBL(stack_guard) != NULL && PUBL(stack_guard)()) + { + *errorcodeptr= ERR85; + return FALSE; + } + +The stack "overflow" detection happens in + + thr_wrapper() + ethr_set_stacklimit__() + +because the stack usage code relies on the fact that ethr_set_stacklimit__() +and similar functions don't get inlined into callers for stack growth +measurement. + +Before the change inlining avoidance was achieved by putting functions +into standalone translation units. LTO makes this technique inefficient. + +The change marks functions explicitly as __attribute__((__noinline__)) on gcc. + +Reported-by: Fabio Coatti +Bug: https://bugs.gentoo.org/681778 +Signed-off-by: Sergei Trofimovich +--- + erts/emulator/beam/global.h | 9 +++++---- + erts/emulator/beam/sys.h | 10 ++++++++++ + erts/include/internal/ethr_internal.h | 2 +- + erts/include/internal/ethread_inline.h | 3 +++ + 4 files changed, 19 insertions(+), 5 deletions(-) + +diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h +index f9bbe4167f9..4c8d3d3dbe6 100644 +--- a/erts/emulator/beam/global.h ++++ b/erts/emulator/beam/global.h +@@ -1216,10 +1216,11 @@ Uint64 erts_timestamp_millis(void); + + Export* erts_find_function(Eterm, Eterm, unsigned int, ErtsCodeIndex); + +-void *erts_calc_stacklimit(char *prev_c, UWord stacksize); +-int erts_check_below_limit(char *ptr, char *limit); +-int erts_check_above_limit(char *ptr, char *limit); +-void *erts_ptr_id(void *ptr); ++/* ERTS_NOINLINE prevents link-time optimization across modules */ ++void *erts_calc_stacklimit(char *prev_c, UWord stacksize) ERTS_NOINLINE; ++int erts_check_below_limit(char *ptr, char *limit) ERTS_NOINLINE; ++int erts_check_above_limit(char *ptr, char *limit) ERTS_NOINLINE; ++void *erts_ptr_id(void *ptr) ERTS_NOINLINE; + + Eterm store_external_or_ref_in_proc_(Process *, Eterm); + Eterm store_external_or_ref_(Uint **, ErlOffHeap*, Eterm); +diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h +index a6312293cc8..24b6738e082 100644 +--- a/erts/emulator/beam/sys.h ++++ b/erts/emulator/beam/sys.h +@@ -63,6 +63,16 @@ + # endif + #endif + ++#ifndef ERTS_NOINLINE ++# if ERTS_AT_LEAST_GCC_VSN__(3,1,1) ++# define ERTS_NOINLINE __attribute__((__noinline__)) ++# elif defined(__WIN32__) ++# define ERTS_NOINLINE __declspec(noinline) ++# else ++# define ERTS_NOINLINE ++# endif ++#endif ++ + #if defined(DEBUG) || defined(ERTS_ENABLE_LOCK_CHECK) + # undef ERTS_CAN_INLINE + # define ERTS_CAN_INLINE 0 +diff --git a/erts/include/internal/ethr_internal.h b/erts/include/internal/ethr_internal.h +index ac27ff2ed09..17ec84c52b6 100644 +--- a/erts/include/internal/ethr_internal.h ++++ b/erts/include/internal/ethr_internal.h +@@ -90,7 +90,7 @@ int ethr_init_common__(ethr_init_data *id); + int ethr_late_init_common__(ethr_late_init_data *lid); + void ethr_run_exit_handlers__(void); + void ethr_ts_event_destructor__(void *vtsep); +-void ethr_set_stacklimit__(char *prev_c, size_t stacksize); ++void ethr_set_stacklimit__(char *prev_c, size_t stacksize) ETHR_NOINLINE; + + #if defined(ETHR_X86_RUNTIME_CONF__) + void ethr_x86_cpuid__(int *eax, int *ebx, int *ecx, int *edx); +diff --git a/erts/include/internal/ethread_inline.h b/erts/include/internal/ethread_inline.h +index 8e6bcfc4a8c..f25ba4ae721 100644 +--- a/erts/include/internal/ethread_inline.h ++++ b/erts/include/internal/ethread_inline.h +@@ -62,12 +62,15 @@ + # define ETHR_INLINE __inline__ + # if ETHR_AT_LEAST_GCC_VSN__(3, 1, 1) + # define ETHR_FORCE_INLINE __inline__ __attribute__((__always_inline__)) ++# define ETHR_NOINLINE __attribute__((__noinline__)) + # else + # define ETHR_FORCE_INLINE __inline__ ++# define ETHR_NOINLINE + # endif + #elif defined(__WIN32__) + # define ETHR_INLINE __forceinline + # define ETHR_FORCE_INLINE __forceinline ++# define ETHR_NOINLINE __declspec(noinline) + #endif + + #endif /* #ifndef ETHREAD_INLINE_H__ */ diff --git a/dev-lang/erlang/files/erlang-21.3-pgo-loop.patch b/dev-lang/erlang/files/erlang-21.3-pgo-loop.patch new file mode 100644 index 000000000000..82add992a448 --- /dev/null +++ b/dev-lang/erlang/files/erlang-21.3-pgo-loop.patch @@ -0,0 +1,13 @@ +https://bugs.gentoo.org/686786 + +--- a/erts/configure.in ++++ b/erts/configure.in +@@ -682,7 +682,7 @@ elif test "X$PROFILE_INSTR_GENERATE" = "Xtrue" -a "X$PROFILE_INSTR_USE" = "Xtrue + PROFILE_COMPILER=clang + AC_MSG_RESULT([yes, using -fprofile-instr-generate]) + else +- if $enable_pgo = yes; then ++ if test $enable_pgo = yes; then + AC_MSG_ERROR(cannot use PGO with this compiler) + else + AC_MSG_RESULT([no]) -- cgit v1.2.3