summaryrefslogtreecommitdiff
path: root/sys-libs/libunwind
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-libs/libunwind
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/libunwind')
-rw-r--r--sys-libs/libunwind/Manifest15
-rw-r--r--sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch15
-rw-r--r--sys-libs/libunwind/files/libunwind-1.1-lzma.patch63
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch16
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch93
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch34
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch17
-rw-r--r--sys-libs/libunwind/libunwind-1.1-r1.ebuild72
-rw-r--r--sys-libs/libunwind/libunwind-1.2.1.ebuild100
-rw-r--r--sys-libs/libunwind/libunwind-1.2.ebuild101
-rw-r--r--sys-libs/libunwind/metadata.xml12
11 files changed, 538 insertions, 0 deletions
diff --git a/sys-libs/libunwind/Manifest b/sys-libs/libunwind/Manifest
new file mode 100644
index 000000000000..92b365321a42
--- /dev/null
+++ b/sys-libs/libunwind/Manifest
@@ -0,0 +1,15 @@
+AUX libunwind-1.1-fix-CVE-2015-3239.patch 523 SHA256 3d37676dfaf88e267fd2e0422db93b9613f91af40fc5f4189806a64a23b07de9 SHA512 71f28720486c07cbbc31cf2747096e324cc43dd57c4ec9312da12fd4aa9d5af83e4cbe80071b6192cdf14a2e2afd090c136e57476ac981204a933db67d609c01 WHIRLPOOL 5c2b15253ca2ef597ebf6a6ae1b26c5728ce50dd5468c6115546b0af83e19b73c5becf3d1885b275e7619318f279dbb0eab531905b64c3bc87c8fb2cdd1fc31b
+AUX libunwind-1.1-lzma.patch 3004 SHA256 84716d048c507862761f4889871ab6428f9ca5818baeb3bddbc5612d5ff3ef15 SHA512 d15f849d743426fd030de2990d683a5373273ecfc407b081280e7f5fb2e65350496badb7b094911719e5b3f6bdac5ddf2653e556391c58a8559938a11f60250c WHIRLPOOL 3d56eed2a93fa373516d923bf0c491c68c464e62c0302ba0bc995d2491b27b01b109dd750bc47079f66c163c5f1a1a5d13c541709c0090ff78926bcdc98da992
+AUX libunwind-1.2-coredump-regs.patch 619 SHA256 81383383135b5f12aab63d62fa54c18bf13fe659e1a5a8a5ae35dba95b72c755 SHA512 48536ef54590221b42a3ca568ec781e526807b3d8aed3e33e19e6efacfa05a428a6101d3a51e79ea5d3e1d783bcba9acb92f7623c121d3e00cd3e1a17d13e282 WHIRLPOOL caa4a9a7b9fa1ee2aede2e2af5010472a459076d093191994496afd0beb7446b18e619041594cce346e03313808413fead02a0f4e65ef91da5a66d38f51e2e0a
+AUX libunwind-1.2-ia64-missing.patch 3863 SHA256 e5163247366ca68c5e2671208f2a848e1e25c23d1e56099ddabe0b65d36c538e SHA512 e8f65d706839770d993f9801371e1e294a0231c4bfe29b497e4a859567b7f5b6561b0a15d59b1626311e549fe57149046f5a76424a2ad69c521610aaa3019c17 WHIRLPOOL 10304bd170ce4e23bf82ca656ab460ff1d7ba0414b103329916afb6eea238155e001b70d83c4a138e950b095b5d259e966c00733c8f750e6e748a5fd577b11f9
+AUX libunwind-1.2-ia64-ptrace-coredump.patch 1445 SHA256 003e6a4724cb2ffb25bd5f18666e0b5866d5f701ca26275a8a1c90617ae79e73 SHA512 0bab310ff16294d7617077ffa1261fe9c1a6aaeb4339c96918869c4dd9a2b1b73fbe2ebb5c895f1a420ff7922da85cbb44ccfcd69df6e2518c1f2ff64b7b2d76 WHIRLPOOL 56878f6eed550b99dac1104d7a227d3954d57ad3e374bdee8049599035cd508945df2ec98c51376e9f0b719dc30b76295087df208609e5d0494e4215f918b106
+AUX libunwind-1.2-ia64-undwarf.patch 581 SHA256 24dc59a2e18c8638430cb492e2c0655a1b4f9a5e14166fc89be403878913ea28 SHA512 a83dd2d2bea706fb0f57b854015c6f1db882d649e931e12bb1a5524c8176e326d7d4a448f986c9475d1bd4c6e22a0e9a1c813c7a5b47fcd61457806c1f32fe85 WHIRLPOOL 2e0b3fb09b96312ad492d62cc7ce00ab5277bca810725e45f71a77a441acc46f6fe7719bc8a9809999a0f2b44323f56ccd4d3d105419e243f24359945f89bda7
+DIST libunwind-1.1.tar.gz 1098603 SHA256 9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a SHA512 bfe04f2bfac9f9e47c37f0b23ed2f264d8d3d3d6f1392fe9d794ee13cad216b3740979e922e4276fb65c1ccdc836fce48812cb5459ecdd2a89a621036a35d7c1 WHIRLPOOL 1a0e566edf92c0563cb5525203f2718c3454bc0be25ec8079cde8441de08b6d8951db7cbf2f0a02a4a0f1e6c350e74e551a482d9094996daefa216a79bc9d383
+DIST libunwind-1.2.1.tar.gz 780774 SHA256 3f3ecb90e28cbe53fba7a4a27ccce7aad188d3210bb1964a923a731a27a75acb SHA512 af7c280d2a963779a4a2711887618bc96383011e4e5d52e4085aa7fb351e55e357468f6ff85e66a216f1c6826538f498335a917a5970575c93be74c96316319b WHIRLPOOL 68cd0bd09b08000b11edb0912ccb7b6b17c8a4ac73fa3c409f17eb9581ac29e7ca015a37cb13a9741725e89caba58d91fa4f5cd18995449593188aedccbddc25
+DIST libunwind-1.2.tar.gz 747369 SHA256 1de38ffbdc88bd694d10081865871cd2bfbb02ad8ef9e1606aee18d65532b992 SHA512 985d0817944e3cafd99aaa5642862d878972e0851f7954289247e808c9319f399ca29342395f0571cb6568a1104a82bd92d585936f2ca888dda37ac796fde0d4 WHIRLPOOL d110ab7243157a617c1a9f01a5e7941cd4a63032317a7a6d372dd656aad9c1b49769909b3f37ff7dbbdb82a21f2d25dc00548cb5cac4d89c2b825b1e5e5fa634
+EBUILD libunwind-1.1-r1.ebuild 2444 SHA256 ec4fdc08f6f53dce5dc6c90afdb7318972cf1aa47db5c2203d896b67308de078 SHA512 d6c4099defbbe27c2a0c7df12299a21be655345b6480a61d3a67dea4dd3f732088b734f28eba4a5ee43ac7323ca6cef45fdba05e9c79d2d8e8b41ef5667299eb WHIRLPOOL 7181963d52710f9e4213874344f35e21f2113d1cd959292098281277c9f1339e0423e6e1bbd64ed66f102d0bd68a4cdd51f38bc23a5c5ee49cea724d98903045
+EBUILD libunwind-1.2.1.ebuild 2981 SHA256 628755816e805b5f3edbe66172b1b9bcaadc0a835867f471bf76a7a7b673c388 SHA512 85902b3910fbb16a518fab6ad93a163b2f8693f5280f7729bb685d53e7b15b9a366e77b7821cc23a94cad6fea5f496da310d6b5f7acc234fbb242fc2d6e96f47 WHIRLPOOL cda23fdd3a1ba59c204f4a9cbc90d7101c97f2ef6b35dd6759201e77d32d3bc5a25c257c7a0d48c469bd6f642604421be9686b53af44b92ec05ec490267e5d15
+EBUILD libunwind-1.2.ebuild 3178 SHA256 0d87457df73bb415da671922d85a06e76773a4709dc3960f012fabd4ef3c46f3 SHA512 8c2cf271f613eb43552631444d262ed3bc163d943d9913fb2c130ef2ef2c45012059ff8db0a1564ba40f50408f7c97e5004c69f9625a60f07bd9ff835aaa2bd6 WHIRLPOOL ece5ec06972421f95c39dac4f97e724e68272ae5c6d754ebe7a6e59a9a4018711f4095357b22b4751d6aee48de9ef95976fbc3d9cf8e08659c17a61a0849d177
+MISC ChangeLog 6364 SHA256 cfdfcb71b6f9c7e74e972401a53343e62bdb9c32a5f4958a3033e943d9009454 SHA512 6c697712de3611c72b4f1ed067408330349ce4c079b556b1d4d3bb29b165647350057aabedd0196629ebfbc7f943f3a660380838c900a43fb3188b10632f242b WHIRLPOOL 41907c911741205ea9e6b20090287ac3e5836686232ec554d31cd6a67d273465e1ec550b1f2a426ba73ce059eea39f9d55a4b668af22bdbea2ac7b27dc3e03cb
+MISC ChangeLog-2015 5849 SHA256 4cadfc068be0783f052df0873eaa0173dbacb45cbc30fc6074f5ac8af84ba028 SHA512 747ecf107b7d043e535fd4c70e4b76b4ad5e8179e25bc7f0afb9276627b804ba871a311c5f7d0612cc7a8fff86bc34da7ce9663136ccfdacda14a458d174cebb WHIRLPOOL b65f5e6cd656b950a0db442ab0beb55f48bb6da7dc76f9e37084e2d6479501b9b85ed4c56e1150f21ecf4f722837bca5850963662c2d9bcdddaec053d6dc603e
+MISC metadata.xml 489 SHA256 e9634971ffc782bc0996a6a2433b586950ac81f33823251aadbe43ccd8c1a3b0 SHA512 d7586420e24a7b841cb090ce8dc7bb1c1260a3e2afbc6606d0a974243ca20c0586b4aa3e770b5b98787f8d34b8255846d87550c16f68da6e9d3f55f8b57bde40 WHIRLPOOL 74078c66b9b85d6e3c36c21ee5d1c0cdc9fb0d5bbacd31e771a972b8c15af7fce1d9f6872ff2230f8ebf6e7ce5833361b130dc7d6f7df6aa3770eb686ab09fc8
diff --git a/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch b/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch
new file mode 100644
index 000000000000..153108bbb151
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch
@@ -0,0 +1,15 @@
+taken from Fedora
+
+https://bugs.gentoo.org/585830
+
+--- libunwind-1.1/include/dwarf_i.h.CVE20153239
++++ libunwind-1.1/include/dwarf_i.h
+@@ -20,7 +20,7 @@
+ extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH];
+ /* REG is evaluated multiple times; it better be side-effects free! */
+ # define dwarf_to_unw_regnum(reg) \
+- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
++ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
+ #endif
+
+ #ifdef UNW_LOCAL_ONLY
diff --git a/sys-libs/libunwind/files/libunwind-1.1-lzma.patch b/sys-libs/libunwind/files/libunwind-1.1-lzma.patch
new file mode 100644
index 000000000000..09cefa028539
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.1-lzma.patch
@@ -0,0 +1,63 @@
+From 38c349bb000b427c376e756e3ecdb764a2b4d297 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 15 Feb 2014 21:00:59 -0500
+Subject: [PATCH] link sublibs against liblzma as needed
+
+The coredump/elf32/elf64/elfxx libs use lzma funcs but don't link against
+it. This produces sub-shared libs that don't link against lzma and can
+make the linker angry due to underlinking like so:
+
+libtool: link: x86_64-pc-linux-gnu-gcc -O2 -march=amdfam10 -pipe -g \
+ -frecord-gcc-switches -Wimplicit-function-declaration -fexceptions \
+ -Wall -Wsign-compare -Wl,-O1 -Wl,--hash-style=gnu \
+ -o .libs/test-coredump-unwind test-coredump-unwind.o \
+ ../src/.libs/libunwind-coredump.so ../src/.libs/libunwind-x86_64.so
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_footer_decode'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_buffer_decode'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_size'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_end'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_uncompressed_size'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_buffer_decode'
+collect2: error: ld returned 1 exit status
+
+So add LIBLZMA to the right LIBADD for each of these libraries.
+
+URL: https://bugs.gentoo.org/444050
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ src/Makefile.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -169,7 +169,7 @@ libunwind_arm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libunwind_arm_la_LDFLAGS) $(LDFLAGS) -o $@
+ @ARCH_ARM_TRUE@am_libunwind_arm_la_rpath = -rpath $(libdir)
+-libunwind_coredump_la_LIBADD =
++libunwind_coredump_la_LIBADD = $(LIBLZMA)
+ am__libunwind_coredump_la_SOURCES_DIST = coredump/_UCD_accessors.c \
+ coredump/_UCD_create.c coredump/_UCD_destroy.c \
+ coredump/_UCD_access_mem.c coredump/_UCD_elf_map_image.c \
+@@ -214,15 +214,15 @@ am_libunwind_dwarf_local_la_OBJECTS = dwarf/Lexpr.lo dwarf/Lfde.lo \
+ libunwind_dwarf_local_la_OBJECTS = \
+ $(am_libunwind_dwarf_local_la_OBJECTS)
+ @REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am_libunwind_dwarf_local_la_rpath =
+-libunwind_elf32_la_LIBADD =
++libunwind_elf32_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elf32_la_OBJECTS = elf32.lo
+ libunwind_elf32_la_OBJECTS = $(am_libunwind_elf32_la_OBJECTS)
+ @USE_ELF32_TRUE@am_libunwind_elf32_la_rpath =
+-libunwind_elf64_la_LIBADD =
++libunwind_elf64_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elf64_la_OBJECTS = elf64.lo
+ libunwind_elf64_la_OBJECTS = $(am_libunwind_elf64_la_OBJECTS)
+ @USE_ELF64_TRUE@am_libunwind_elf64_la_rpath =
+-libunwind_elfxx_la_LIBADD =
++libunwind_elfxx_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elfxx_la_OBJECTS = elfxx.lo
+ libunwind_elfxx_la_OBJECTS = $(am_libunwind_elfxx_la_OBJECTS)
+ @USE_ELFXX_TRUE@am_libunwind_elfxx_la_rpath =
+--
+1.8.5.5
+
diff --git a/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch b/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch
new file mode 100644
index 000000000000..3ddc610d4afc
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/586092
+
+this might not be correct, but at least it builds, and doesn't crash
+
+--- a/src/coredump/_UCD_access_reg_linux.c
++++ b/src/coredump/_UCD_access_reg_linux.c
+@@ -51,6 +51,9 @@ _UCD_access_reg (unw_addr_space_t as,
+ #elif defined(UNW_TARGET_TILEGX)
+ if (regnum < 0 || regnum > UNW_TILEGX_CFA)
+ goto badreg;
++#elif defined(UNW_TARGET_IA64) || defined(UNW_TARGET_HPPA) || defined(UNW_TARGET_PPC32) || defined(UNW_TARGET_PPC64)
++ if (regnum < 0 || regnum >= ARRAY_SIZE(ui->prstatus->pr_reg))
++ goto badreg;
+ #else
+ #if defined(UNW_TARGET_MIPS)
+ static const uint8_t remap_regs[] =
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch
new file mode 100644
index 000000000000..e15250b4c61f
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch
@@ -0,0 +1,93 @@
+Original libunwind release is missing a few ia64-specific files in tarball.
+diff --git a/src/ia64/mk_Gcursor_i.c b/src/ia64/mk_Gcursor_i.c
+new file mode 100644
+index 0000000..67b14d5
+--- /dev/null
++++ b/src/ia64/mk_Gcursor_i.c
+@@ -0,0 +1,65 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2003 Hewlett-Packard Co
++ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
++
++/* Utility to generate cursor_i.h. */
++
++#include "libunwind_i.h"
++
++#ifdef offsetof
++# undef offsetof
++#endif
++
++#define offsetof(type,field) ((char *) &((type *) 0)->field - (char *) 0)
++
++#define OFFSET(sym, offset) \
++ asm volatile("\n->" #sym " %0" : : "i" (offset))
++
++int
++main (void)
++{
++ OFFSET("IP_OFF", offsetof (struct cursor, ip));
++ OFFSET("PR_OFF", offsetof (struct cursor, pr));
++ OFFSET("BSP_OFF", offsetof (struct cursor, bsp));
++ OFFSET("PSP_OFF", offsetof (struct cursor, psp));
++ OFFSET("PFS_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_PFS]));
++ OFFSET("RNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_RNAT]));
++ OFFSET("UNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_UNAT]));
++ OFFSET("LC_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_LC]));
++ OFFSET("FPSR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_FPSR]));
++ OFFSET("B1_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B1]));
++ OFFSET("B2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B2]));
++ OFFSET("B3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B3]));
++ OFFSET("B4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B4]));
++ OFFSET("B5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B5]));
++ OFFSET("F2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F2]));
++ OFFSET("F3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F3]));
++ OFFSET("F4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F4]));
++ OFFSET("F5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F5]));
++ OFFSET("FR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F16]));
++ OFFSET("LOC_SIZE",
++ (offsetof (struct cursor, loc[1]) - offsetof (struct cursor, loc[0])));
++ OFFSET("SIGCONTEXT_ADDR_OFF", offsetof (struct cursor, sigcontext_addr));
++ return 0;
++}
+diff --git a/src/ia64/mk_Lcursor_i.c b/src/ia64/mk_Lcursor_i.c
+new file mode 100644
+index 0000000..aee2e7e
+--- /dev/null
++++ b/src/ia64/mk_Lcursor_i.c
+@@ -0,0 +1,2 @@
++#define UNW_LOCAL_ONLY
++#include "mk_Gcursor_i.c"
+diff --git a/src/ia64/mk_cursor_i b/src/ia64/mk_cursor_i
+new file mode 100755
+index 0000000..9211f91
+--- /dev/null
++++ b/src/ia64/mk_cursor_i
+@@ -0,0 +1,7 @@
++#!/bin/sh
++test -z "$1" && exit 1
++echo "/* GENERATED */"
++echo "#ifndef cursor_i_h"
++echo "#define cursor_i_h"
++sed -ne 's/^->"\(\S*\)" \(\d*\)/#define \1 \2/p' < $1 || exit $?
++echo "#endif"
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch
new file mode 100644
index 000000000000..3785d8820cd9
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch
@@ -0,0 +1,34 @@
+Fix build failure on ia64.
+ coredump/_UPT_get_dyn_info_list_addr.c
+is almost identical to
+ ptrace/_UPT_get_dyn_info_list_addr.c
+It's clearly an __ia64 implementation copy.
+diff --git a/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/coredump/_UPT_get_dyn_info_list_addr.c
+index 0d11905..176b146 100644
+--- a/src/coredump/_UPT_get_dyn_info_list_addr.c
++++ b/src/coredump/_UPT_get_dyn_info_list_addr.c
+@@ -31,2 +31,3 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ # include "os-linux.h"
++# include "../ptrace/_UPT_internal.h"
+
+@@ -40,3 +41,2 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+ char path[PATH_MAX];
+- unw_dyn_info_t *di;
+ unw_word_t res;
+@@ -50,5 +50,5 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+
+- invalidate_edi (&ui->edi);
++ invalidate_edi(&ui->edi);
+
+- if (elf_map_image (&ui->ei, path) < 0)
++ if (elf_map_image (&ui->edi.ei, path) < 0)
+ /* ignore unmappable stuff like "/SYSV00001b58 (deleted)" */
+@@ -58,6 +58,5 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+
+- di = tdep_find_unwind_table (&ui->edi, as, path, lo, off);
+- if (di)
++ if (tdep_find_unwind_table (&ui->edi, as, path, lo, off, 0) > 0)
+ {
+- res = _Uia64_find_dyn_list (as, di, arg);
++ res = _Uia64_find_dyn_list (as, &ui->edi.di_cache, arg);
+ if (res && count++ == 0)
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch
new file mode 100644
index 000000000000..1e3e2489828e
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch
@@ -0,0 +1,17 @@
+diff --git a/src/mi/Gget_proc_name.c b/src/mi/Gget_proc_name.c
+index 5376f82..64d2503 100644
+--- a/src/mi/Gget_proc_name.c
++++ b/src/mi/Gget_proc_name.c
+@@ -106,8 +106,12 @@ unw_get_proc_name (unw_cursor_t *cursor, char *buf, size_t buf_len,
+ ip = tdep_get_ip (c);
++#if !defined(__ia64)
+ if (c->dwarf.use_prev_instr)
+ --ip;
++#endif
+ error = get_proc_name (tdep_get_as (c), ip, buf, buf_len, offp,
+ tdep_get_as_arg (c));
++#if !defined(__ia64)
+ if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
+ *offp += 1;
++#endif
+ return error;
diff --git a/sys-libs/libunwind/libunwind-1.1-r1.ebuild b/sys-libs/libunwind/libunwind-1.1-r1.ebuild
new file mode 100644
index 000000000000..466898099cff
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.1-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils libtool
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="amd64 arm hppa ia64 ~mips ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame libatomic lzma +static-libs"
+
+RESTRICT="test" #461958 -- re-enable tests with >1.1 again for retesting, this is here for #461394
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+QA_DT_NEEDED_x86_fbsd="usr/lib/libunwind.so.7.0.0"
+
+src_prepare() {
+ # These tests like to fail. bleh.
+ echo 'int main(){return 0;}' > tests/Gtest-dyn1.c
+ echo 'int main(){return 0;}' > tests/Ltest-dyn1.c
+
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure{.ac,} || die #444050
+ epatch "${FILESDIR}"/${P}-lzma.patch #444050
+ epatch "${FILESDIR}"/${P}-fix-CVE-2015-3239.patch #585830
+ elibtoolize
+}
+
+src_configure() {
+ # https://savannah.nongnu.org/bugs/index.php?34324
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ $(use_enable debug-frame) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/libunwind-1.2.1.ebuild b/sys-libs/libunwind/libunwind-1.2.1.ebuild
new file mode 100644
index 000000000000..7b3677c4a1a2
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.2.1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+inherit eutils libtool multilib-minimal
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame doc libatomic lzma +static-libs"
+
+RESTRICT="test" # half of tests are broken (toolchain version dependent)
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/libunwind.h
+
+ # see libunwind.h for the full list of arch-specific headers
+ /usr/include/libunwind-aarch64.h
+ /usr/include/libunwind-arm.h
+ /usr/include/libunwind-hppa.h
+ /usr/include/libunwind-ia64.h
+ /usr/include/libunwind-mips.h
+ /usr/include/libunwind-ppc32.h
+ /usr/include/libunwind-ppc64.h
+ /usr/include/libunwind-sh.h
+ /usr/include/libunwind-tilegx.h
+ /usr/include/libunwind-x86.h
+ /usr/include/libunwind-x86_64.h
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.2-coredump-regs.patch #586092
+ "${FILESDIR}"/${PN}-1.2-ia64-undwarf.patch
+ "${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch
+ "${FILESDIR}"/${PN}-1.2-ia64-missing.patch
+)
+
+src_prepare() {
+ default
+ chmod +x src/ia64/mk_cursor_i || die
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ECONF_SOURCE="${S}" \
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ --enable-coredump \
+ --enable-ptrace \
+ --enable-setjmp \
+ $(use_enable debug-frame) \
+ $(use_enable doc documentation) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+multilib_src_compile() {
+ # Bug 586208
+ CCACHE_NODIRECT=1 default
+}
+
+multilib_src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+multilib_src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/libunwind-1.2.ebuild b/sys-libs/libunwind/libunwind-1.2.ebuild
new file mode 100644
index 000000000000..8528582e02c7
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.2.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+inherit eutils libtool multilib-minimal
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="~amd64 ~arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame doc libatomic lzma +static-libs"
+
+RESTRICT="test" #461958 -- re-enable tests with >1.1 again for retesting, this is here for #461394
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+QA_DT_NEEDED_x86_fbsd="usr/lib/libunwind.so.7.0.0"
+
+# Bug 586208
+CCACHE_NODIRECT=1
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/libunwind.h
+
+ # see libunwind.h for the full list of arch-specific headers
+ /usr/include/libunwind-aarch64.h
+ /usr/include/libunwind-arm.h
+ /usr/include/libunwind-hppa.h
+ /usr/include/libunwind-ia64.h
+ /usr/include/libunwind-mips.h
+ /usr/include/libunwind-ppc32.h
+ /usr/include/libunwind-ppc64.h
+ /usr/include/libunwind-sh.h
+ /usr/include/libunwind-tilegx.h
+ /usr/include/libunwind-x86.h
+ /usr/include/libunwind-x86_64.h
+)
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.2-coredump-regs.patch #586092
+ epatch "${FILESDIR}"/${PN}-1.2-ia64-undwarf.patch
+ epatch "${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch
+ epatch -p1 "${FILESDIR}"/${PN}-1.2-ia64-missing.patch
+ chmod +x src/ia64/mk_cursor_i || die
+
+ # These tests like to fail. bleh.
+ echo 'int main(){return 0;}' > tests/Gtest-dyn1.c
+ echo 'int main(){return 0;}' > tests/Ltest-dyn1.c
+
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ECONF_SOURCE="${S}" \
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ --enable-coredump \
+ --enable-ptrace \
+ --enable-setjmp \
+ $(use_enable debug-frame) \
+ $(use_enable doc documentation) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+multilib_src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+multilib_src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/metadata.xml b/sys-libs/libunwind/metadata.xml
new file mode 100644
index 000000000000..95faca4e7634
--- /dev/null
+++ b/sys-libs/libunwind/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="debug-frame">Adds support for DWARF .debug_frame section: Use the information from this section if available</flag>
+ <flag name="libatomic">Use libatomic instead of builtin atomic operations</flag>
+ </use>
+</pkgmetadata>