summaryrefslogtreecommitdiff
path: root/mdb/debian
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-04-25 20:28:02 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-04-25 20:28:02 +0400
commit581beb3af942294f46abbf526c7a2b34150920be (patch)
tree6e35a5181a28108210d0dceb704c38407feaafde /mdb/debian
parent6f8d0fe1133bc6f7071106b3c7bde925f5a4f333 (diff)
downloadillumos-packaging-581beb3af942294f46abbf526c7a2b34150920be.tar.gz
Can compile mdb
Diffstat (limited to 'mdb/debian')
-rw-r--r--mdb/debian/control2
-rw-r--r--mdb/debian/patches/mdb-demangle.patch30
-rw-r--r--mdb/debian/patches/mdb-disable-demangle.patch14
-rw-r--r--mdb/debian/patches/mdb-hdr2map-echo.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb-kaif.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb-kmdb_kvm.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb-kvm_cpu_amd.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb-kvm_cpu_p4.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb-libstanddisasm.so.patch12
-rw-r--r--mdb/debian/patches/mdb-kmdb_promif.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-kmdb_terminfo_skel.c-ncurses.patch12
-rw-r--r--mdb/debian/patches/mdb-kvm_ia32dep.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-libtinfo.patch17
-rw-r--r--mdb/debian/patches/mdb-mdb_amd64util.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_cmds.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_cmds.c-poiters.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_ks-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_kvm.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_modapi.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_print.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_proc.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_target.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-mdb_termio.c-pointers.patch6
-rw-r--r--mdb/debian/patches/mdb-teminfo.patch6
-rw-r--r--mdb/debian/patches/mdb-tigen-echo.patch6
-rw-r--r--mdb/debian/patches/mdb-use-libsundisasm.patch52
-rw-r--r--mdb/debian/patches/series4
-rwxr-xr-xmdb/debian/rules25
28 files changed, 194 insertions, 88 deletions
diff --git a/mdb/debian/control b/mdb/debian/control
index dd40f22..5c2ba2e 100644
--- a/mdb/debian/control
+++ b/mdb/debian/control
@@ -13,6 +13,8 @@ Build-Depends:
libscf1-dev,
libsunelf1-dev | libelfg0-dev,
libumem-dev,
+ libsundisasm1-dev,
+ libstanddisasm-dev,
ncurses-term,
quilt,
sgs-lex,
diff --git a/mdb/debian/patches/mdb-demangle.patch b/mdb/debian/patches/mdb-demangle.patch
new file mode 100644
index 0000000..fe41896
--- /dev/null
+++ b/mdb/debian/patches/mdb-demangle.patch
@@ -0,0 +1,30 @@
+Description: mdb_demangle dlopen()'s libdemangle.so.1 which
+ is a close source library from Solaris Studio. Sorry.
+Index: mdb/usr/src/cmd/mdb/common/mdb/mdb_demangle.c
+===================================================================
+--- mdb.orig/usr/src/cmd/mdb/common/mdb/mdb_demangle.c 2012-10-08 04:25:29.000000000 +0400
++++ mdb/usr/src/cmd/mdb/common/mdb/mdb_demangle.c 2013-04-25 20:23:59.307338344 +0400
+@@ -31,17 +31,17 @@
+ #include <mdb/mdb_err.h>
+ #include <mdb/mdb.h>
+
+-#include <demangle.h>
++/* #include <demangle.h> */
++#ifndef DEMANGLE_ESPACE
++#define DEMANGLE_ESPACE -1 /* the interpretation buffer is too small */
++#endif
++
+ #include <strings.h>
+ #include <unistd.h>
+ #include <dlfcn.h>
+ #include <link.h>
+
+-#ifdef _LP64
+-static const char LIB_DEMANGLE[] = "/usr/lib/64/libdemangle.so.1";
+-#else
+-static const char LIB_DEMANGLE[] = "/usr/lib/libdemangle.so.1";
+-#endif
++static const char LIB_DEMANGLE[] = "libdemangle.so.1";
+
+ mdb_demangler_t *
+ mdb_dem_load(const char *path)
diff --git a/mdb/debian/patches/mdb-disable-demangle.patch b/mdb/debian/patches/mdb-disable-demangle.patch
deleted file mode 100644
index 6180110..0000000
--- a/mdb/debian/patches/mdb-disable-demangle.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Description: mdb_demangle dlopen()'s libdemangle.so.1 which
- is a close source library from Solaris Studio. Sorry.
-Index: mdb/usr/src/cmd/mdb/Makefile.mdb
-===================================================================
---- mdb.orig/usr/src/cmd/mdb/Makefile.mdb 2012-10-08 04:25:29.000000000 +0400
-+++ mdb/usr/src/cmd/mdb/Makefile.mdb 2013-04-25 15:03:04.966348042 +0400
-@@ -46,7 +46,6 @@
- mdb_ctf.c \
- mdb_ctf_open.c \
- mdb_debug.c \
-- mdb_demangle.c \
- mdb_disasm.c \
- mdb_dump.c \
- mdb_err.c \
diff --git a/mdb/debian/patches/mdb-hdr2map-echo.patch b/mdb/debian/patches/mdb-hdr2map-echo.patch
index bc20b0d..baa1f29 100644
--- a/mdb/debian/patches/mdb-hdr2map-echo.patch
+++ b/mdb/debian/patches/mdb-hdr2map-echo.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/tools/scripts/hdr2map.sh
+Index: b/usr/src/cmd/mdb/tools/scripts/hdr2map.sh
===================================================================
---- uts.orig/usr/src/cmd/mdb/tools/scripts/hdr2map.sh 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/tools/scripts/hdr2map.sh 2012-12-24 22:11:59.422043463 +0400
+--- a/usr/src/cmd/mdb/tools/scripts/hdr2map.sh 2013-04-25 20:12:44.441299906 +0400
++++ b/usr/src/cmd/mdb/tools/scripts/hdr2map.sh 2013-04-25 20:12:47.121638555 +0400
@@ -246,11 +246,11 @@
extract_section $mapfile_skel PROLOGUE
diff --git a/mdb/debian/patches/mdb-kmdb-kaif.c-pointers.patch b/mdb/debian/patches/mdb-kmdb-kaif.c-pointers.patch
index cdfb463..bdfa751 100644
--- a/mdb/debian/patches/mdb-kmdb-kaif.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kmdb-kaif.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/intel/kmdb/kaif.c
+Index: b/usr/src/cmd/mdb/intel/kmdb/kaif.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/kmdb/kaif.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/kmdb/kaif.c 2012-12-25 00:08:37.980068681 +0400
+--- a/usr/src/cmd/mdb/intel/kmdb/kaif.c 2013-04-25 20:12:43.901637909 +0400
++++ b/usr/src/cmd/mdb/intel/kmdb/kaif.c 2013-04-25 20:12:49.213161808 +0400
@@ -685,7 +685,7 @@
{
int i;
diff --git a/mdb/debian/patches/mdb-kmdb-kmdb_kvm.c-pointers.patch b/mdb/debian/patches/mdb-kmdb-kmdb_kvm.c-pointers.patch
index 97143c1..f70ee4b 100644
--- a/mdb/debian/patches/mdb-kmdb-kmdb_kvm.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kmdb-kmdb_kvm.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
+Index: b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c 2012-12-25 00:17:36.724169552 +0400
+--- a/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c 2013-04-25 20:12:43.385656426 +0400
++++ b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c 2013-04-25 20:12:51.236047641 +0400
@@ -1153,7 +1153,7 @@
m.map_cb = func;
m.map_data = private;
diff --git a/mdb/debian/patches/mdb-kmdb-kvm_cpu_amd.c-pointers.patch b/mdb/debian/patches/mdb-kmdb-kvm_cpu_amd.c-pointers.patch
index 81478d4..59bd028 100644
--- a/mdb/debian/patches/mdb-kmdb-kvm_cpu_amd.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kmdb-kvm_cpu_amd.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c
+Index: b/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c 2012-12-25 00:10:30.891887887 +0400
+--- a/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c 2013-04-25 20:12:42.867278972 +0400
++++ b/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_amd.c 2013-04-25 20:12:53.373452893 +0400
@@ -78,7 +78,7 @@
{ MSR_LBR_FROM, KDI_MSR_READ },
{ MSR_LEX_TO, KDI_MSR_READ },
diff --git a/mdb/debian/patches/mdb-kmdb-kvm_cpu_p4.c-pointers.patch b/mdb/debian/patches/mdb-kmdb-kvm_cpu_p4.c-pointers.patch
index 9c1d32e..35d4644 100644
--- a/mdb/debian/patches/mdb-kmdb-kvm_cpu_p4.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kmdb-kvm_cpu_p4.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c
+Index: b/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c 2012-12-25 00:12:37.655899394 +0400
+--- a/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c 2013-04-25 20:12:42.242083645 +0400
++++ b/usr/src/cmd/mdb/intel/kmdb/kvm_cpu_p4.c 2013-04-25 20:12:55.408407606 +0400
@@ -237,7 +237,7 @@
{ MSR_PRP4_LBSTK_TO_13, KDI_MSR_READ },
{ MSR_PRP4_LBSTK_TO_14, KDI_MSR_READ },
diff --git a/mdb/debian/patches/mdb-kmdb-libstanddisasm.so.patch b/mdb/debian/patches/mdb-kmdb-libstanddisasm.so.patch
index e089922..0fd484b 100644
--- a/mdb/debian/patches/mdb-kmdb-libstanddisasm.so.patch
+++ b/mdb/debian/patches/mdb-kmdb-libstanddisasm.so.patch
@@ -1,8 +1,8 @@
Description: use libstanddisasm in-place, not installing it.
-Index: uts/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile
+Index: b/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2012-12-26 05:07:58.897648143 +0400
+--- a/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2013-04-25 20:12:41.725669239 +0400
++++ b/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2013-04-25 20:12:57.464674136 +0400
@@ -61,7 +61,7 @@
include ../../Makefile.amd64
include ../../../Makefile.kmdb
@@ -12,10 +12,10 @@ Index: uts/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile
INCDIRS += $(SRC)/uts/i86pc $(SRC)/common/dis/i386
-Index: uts/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile
+Index: b/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2012-12-26 05:08:30.267333441 +0400
+--- a/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2013-04-25 20:12:41.725568280 +0400
++++ b/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2013-04-25 20:12:57.467162040 +0400
@@ -52,7 +52,7 @@
include ../../Makefile.ia32
include ../../../Makefile.kmdb
diff --git a/mdb/debian/patches/mdb-kmdb_promif.c-pointers.patch b/mdb/debian/patches/mdb-kmdb_promif.c-pointers.patch
index 462dca4..c386376 100644
--- a/mdb/debian/patches/mdb-kmdb_promif.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kmdb_promif.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c
+Index: b/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c 2012-12-25 18:14:12.209283331 +0400
+--- a/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c 2013-04-25 20:12:40.712339569 +0400
++++ b/usr/src/cmd/mdb/common/kmdb/kmdb_promif.c 2013-04-25 20:12:59.691692966 +0400
@@ -72,7 +72,7 @@
getchar = (uintptr_t)pio->cons_polledio_getchar;
arg = (uintptr_t)pio->cons_polledio_argument;
diff --git a/mdb/debian/patches/mdb-kmdb_terminfo_skel.c-ncurses.patch b/mdb/debian/patches/mdb-kmdb_terminfo_skel.c-ncurses.patch
index d96ec32..fbe1987 100644
--- a/mdb/debian/patches/mdb-kmdb_terminfo_skel.c-ncurses.patch
+++ b/mdb/debian/patches/mdb-kmdb_terminfo_skel.c-ncurses.patch
@@ -2,10 +2,10 @@ Description: avoid curses.h
We only need OK and ERR macros (sic!)
But curses.h from ncurses also defines some function
which conflict with mdb's internal functions.
-Index: uts/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c
+Index: b/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c 2012-12-17 02:27:59.920901771 +0400
-+++ uts/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c 2012-12-17 02:39:21.591831517 +0400
+--- a/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c 2013-04-25 20:12:40.198228618 +0400
++++ b/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c 2013-04-25 20:13:01.723573251 +0400
@@ -36,7 +36,14 @@
#include <strings.h>
@@ -22,10 +22,10 @@ Index: uts/usr/src/cmd/mdb/common/kmdb/kmdb_terminfo_skel.c
#include <mdb/mdb_io.h>
#include <mdb/mdb_debug.h>
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_termio.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_termio.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2012-12-17 03:07:26.681093843 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2013-04-25 20:12:40.198051801 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2013-04-25 20:13:01.727908695 +0400
@@ -88,7 +88,18 @@
#undef ERR
#endif
diff --git a/mdb/debian/patches/mdb-kvm_ia32dep.c-pointers.patch b/mdb/debian/patches/mdb-kvm_ia32dep.c-pointers.patch
index f94bb53..d922796 100644
--- a/mdb/debian/patches/mdb-kvm_ia32dep.c-pointers.patch
+++ b/mdb/debian/patches/mdb-kvm_ia32dep.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: mdb/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c
+Index: b/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c
===================================================================
---- mdb.orig/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c 2012-10-08 04:25:29.000000000 +0400
-+++ mdb/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c 2013-04-25 10:33:09.916013728 +0400
+--- a/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c 2013-04-25 20:12:33.981897167 +0400
++++ b/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c 2013-04-25 20:13:22.515378141 +0400
@@ -268,7 +268,7 @@
}
diff --git a/mdb/debian/patches/mdb-libtinfo.patch b/mdb/debian/patches/mdb-libtinfo.patch
new file mode 100644
index 0000000..50f9fec
--- /dev/null
+++ b/mdb/debian/patches/mdb-libtinfo.patch
@@ -0,0 +1,17 @@
+Description: given libncurses, we need libtinfo
+ in Debian libncurses is a linker script which adds -ltinfo, but sunld does
+ not understand GNU linker scripts. So we created libcurses.so symlink
+ under debian/tmp, and need to add libtinfo here.
+Index: b/usr/src/cmd/mdb/Makefile.mdb
+===================================================================
+--- a/usr/src/cmd/mdb/Makefile.mdb 2013-04-25 20:13:30.689188941 +0400
++++ b/usr/src/cmd/mdb/Makefile.mdb 2013-04-25 20:13:33.336234833 +0400
+@@ -127,6 +127,8 @@
+
+ all: $(PROG)
+
++LDLIBS += -ltinfo
++
+ $(PROG): $(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+ $(CTFMERGE) -L VERSION -o $@ $(OBJS)
diff --git a/mdb/debian/patches/mdb-mdb_amd64util.c-pointers.patch b/mdb/debian/patches/mdb-mdb_amd64util.c-pointers.patch
index 2f3fcae..7ad8bc6 100644
--- a/mdb/debian/patches/mdb-mdb_amd64util.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_amd64util.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
+Index: b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2012-12-25 00:07:36.502943874 +0400
+--- a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2013-04-25 20:12:39.205063720 +0400
++++ b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2013-04-25 20:13:03.982265776 +0400
@@ -239,7 +239,7 @@
0xec8b4855, /* pushq %rbp; movq %rsp,%rbp, encoding 2 */
0xe58948cc, /* int $0x3; movq %rsp,%rbp, encoding 1 */
diff --git a/mdb/debian/patches/mdb-mdb_cmds.c-pointers.patch b/mdb/debian/patches/mdb-mdb_cmds.c-pointers.patch
index ef4a0b2..267f307 100644
--- a/mdb/debian/patches/mdb-mdb_cmds.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_cmds.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: mdb/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
===================================================================
---- mdb.orig/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 02:36:49.769216257 +0400
-+++ mdb/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 10:57:21.644362744 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 20:13:06.021186308 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 20:13:24.518543710 +0400
@@ -2700,7 +2700,7 @@
mdb_warn("failed to create new target");
return (DCMD_ERR);
diff --git a/mdb/debian/patches/mdb-mdb_cmds.c-poiters.patch b/mdb/debian/patches/mdb-mdb_cmds.c-poiters.patch
index fec1d13..38c6b5c 100644
--- a/mdb/debian/patches/mdb-mdb_cmds.c-poiters.patch
+++ b/mdb/debian/patches/mdb-mdb_cmds.c-poiters.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2012-12-25 00:14:46.617275312 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 20:12:38.689622937 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c 2013-04-25 20:13:06.021186308 +0400
@@ -2720,7 +2720,7 @@
if (vid < 0)
return (0); /* skip over target implementation events */
diff --git a/mdb/debian/patches/mdb-mdb_ks-pointers.patch b/mdb/debian/patches/mdb-mdb_ks-pointers.patch
index e9d644e..287a6b6 100644
--- a/mdb/debian/patches/mdb-mdb_ks-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_ks-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c
+Index: b/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c 2012-12-25 00:04:49.125566632 +0400
+--- a/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c 2013-04-25 20:12:37.696738162 +0400
++++ b/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c 2013-04-25 20:13:08.117588497 +0400
@@ -507,7 +507,7 @@
bzero(&path, sizeof (mdb_path_t));
diff --git a/mdb/debian/patches/mdb-mdb_kvm.c-pointers.patch b/mdb/debian/patches/mdb-mdb_kvm.c-pointers.patch
index a78fa66..d358d9f 100644
--- a/mdb/debian/patches/mdb-mdb_kvm.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_kvm.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: mdb/usr/src/cmd/mdb/common/mdb/mdb_kvm.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_kvm.c
===================================================================
---- mdb.orig/usr/src/cmd/mdb/common/mdb/mdb_kvm.c 2012-10-08 04:25:29.000000000 +0400
-+++ mdb/usr/src/cmd/mdb/common/mdb/mdb_kvm.c 2013-04-25 15:05:23.176262283 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_kvm.c 2013-04-25 20:12:32.956656945 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_kvm.c 2013-04-25 20:13:26.542982908 +0400
@@ -136,7 +136,7 @@
addr = head = (uintptr_t)sym.st_value;
diff --git a/mdb/debian/patches/mdb-mdb_modapi.c-pointers.patch b/mdb/debian/patches/mdb-mdb_modapi.c-pointers.patch
index 39ead85..1c73187 100644
--- a/mdb/debian/patches/mdb-mdb_modapi.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_modapi.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_modapi.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_modapi.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_modapi.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_modapi.c 2012-12-25 00:19:03.737742887 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_modapi.c 2013-04-25 20:12:37.088542511 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_modapi.c 2013-04-25 20:13:10.132589245 +0400
@@ -527,7 +527,7 @@
int
mdb_walk(const char *name, mdb_walk_cb_t func, void *data)
diff --git a/mdb/debian/patches/mdb-mdb_print.c-pointers.patch b/mdb/debian/patches/mdb-mdb_print.c-pointers.patch
index 3ae8956..5a449f7 100644
--- a/mdb/debian/patches/mdb-mdb_print.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_print.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_print.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_print.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_print.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_print.c 2012-12-25 00:21:33.362410182 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_print.c 2013-04-25 20:12:36.573504176 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_print.c 2013-04-25 20:13:12.168332326 +0400
@@ -786,7 +786,7 @@
}
diff --git a/mdb/debian/patches/mdb-mdb_proc.c-pointers.patch b/mdb/debian/patches/mdb-mdb_proc.c-pointers.patch
index f544c1b..a00ffad 100644
--- a/mdb/debian/patches/mdb-mdb_proc.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_proc.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: mdb/usr/src/cmd/mdb/common/mdb/mdb_proc.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_proc.c
===================================================================
---- mdb.orig/usr/src/cmd/mdb/common/mdb/mdb_proc.c 2012-10-08 04:25:29.000000000 +0400
-+++ mdb/usr/src/cmd/mdb/common/mdb/mdb_proc.c 2013-04-25 15:08:39.275427130 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_proc.c 2013-04-25 20:12:32.358127401 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_proc.c 2013-04-25 20:13:28.674346568 +0400
@@ -3111,7 +3111,7 @@
(void) strncpy(mp->map_name, s, MDB_TGT_MAPSZ);
mp->map_name[MDB_TGT_MAPSZ - 1] = '\0';
diff --git a/mdb/debian/patches/mdb-mdb_target.c-pointers.patch b/mdb/debian/patches/mdb-mdb_target.c-pointers.patch
index dd47091..d040095 100644
--- a/mdb/debian/patches/mdb-mdb_target.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_target.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_target.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_target.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_target.c 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_target.c 2012-12-25 18:16:08.960764170 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_target.c 2013-04-25 20:12:36.060072440 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_target.c 2013-04-25 20:13:14.268517087 +0400
@@ -1467,7 +1467,7 @@
sp->spec_limit = vep->ve_limit;
sp->spec_state = sep->se_state;
diff --git a/mdb/debian/patches/mdb-mdb_termio.c-pointers.patch b/mdb/debian/patches/mdb-mdb_termio.c-pointers.patch
index 5582a4e..96637b9 100644
--- a/mdb/debian/patches/mdb-mdb_termio.c-pointers.patch
+++ b/mdb/debian/patches/mdb-mdb_termio.c-pointers.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/common/mdb/mdb_termio.c
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_termio.c
===================================================================
---- uts.orig/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2012-12-25 18:19:24.219630714 +0400
-+++ uts/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2012-12-25 19:24:12.065682972 +0400
+--- a/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2013-04-25 20:13:01.727908695 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_termio.c 2013-04-25 20:13:16.290438769 +0400
@@ -361,7 +361,7 @@
{ "cnorm", TIO_ATTR_STR, &termio_info.ti_cnorm },
{ "nel", TIO_ATTR_STR, &termio_info.ti_nel },
diff --git a/mdb/debian/patches/mdb-teminfo.patch b/mdb/debian/patches/mdb-teminfo.patch
index 791cf31..4ebc53f 100644
--- a/mdb/debian/patches/mdb-teminfo.patch
+++ b/mdb/debian/patches/mdb-teminfo.patch
@@ -1,7 +1,7 @@
-Index: uts/usr/src/cmd/mdb/Makefile.kmdb.targ
+Index: b/usr/src/cmd/mdb/Makefile.kmdb.targ
===================================================================
---- uts.orig/usr/src/cmd/mdb/Makefile.kmdb.targ 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/Makefile.kmdb.targ 2012-12-24 00:45:49.843773854 +0400
+--- a/usr/src/cmd/mdb/Makefile.kmdb.targ 2013-04-25 20:12:35.010739648 +0400
++++ b/usr/src/cmd/mdb/Makefile.kmdb.targ 2013-04-25 20:13:18.398482793 +0400
@@ -54,9 +54,8 @@
# Specialized object construction
#
diff --git a/mdb/debian/patches/mdb-tigen-echo.patch b/mdb/debian/patches/mdb-tigen-echo.patch
index d3148ec..7ada042 100644
--- a/mdb/debian/patches/mdb-tigen-echo.patch
+++ b/mdb/debian/patches/mdb-tigen-echo.patch
@@ -1,8 +1,8 @@
Description: echo may not expand \t and \n by default
-Index: uts/usr/src/cmd/mdb/tools/scripts/tigen.sh
+Index: b/usr/src/cmd/mdb/tools/scripts/tigen.sh
===================================================================
---- uts.orig/usr/src/cmd/mdb/tools/scripts/tigen.sh 2012-10-08 04:25:29.000000000 +0400
-+++ uts/usr/src/cmd/mdb/tools/scripts/tigen.sh 2012-12-25 18:50:01.159335692 +0400
+--- a/usr/src/cmd/mdb/tools/scripts/tigen.sh 2013-04-25 20:12:34.499022379 +0400
++++ b/usr/src/cmd/mdb/tools/scripts/tigen.sh 2013-04-25 20:13:20.429045116 +0400
@@ -142,11 +142,12 @@
echo "`basename $0`: unknown type for $attr: $type" >& 2
exit 1
diff --git a/mdb/debian/patches/mdb-use-libsundisasm.patch b/mdb/debian/patches/mdb-use-libsundisasm.patch
new file mode 100644
index 0000000..6984ed4
--- /dev/null
+++ b/mdb/debian/patches/mdb-use-libsundisasm.patch
@@ -0,0 +1,52 @@
+Index: b/usr/src/cmd/mdb/common/mdb/mdb_disasm.c
+===================================================================
+--- a/usr/src/cmd/mdb/common/mdb/mdb_disasm.c 2013-04-25 20:12:31.843392783 +0400
++++ b/usr/src/cmd/mdb/common/mdb/mdb_disasm.c 2013-04-25 20:13:30.684436944 +0400
+@@ -34,7 +34,7 @@
+ #include <mdb/mdb_nv.h>
+ #include <mdb/mdb.h>
+
+-#include <libdisasm.h>
++#include <libsundisasm.h>
+
+ int
+ mdb_dis_select(const char *name)
+Index: b/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile
+===================================================================
+--- a/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2013-04-25 20:12:57.464674136 +0400
++++ b/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2013-04-25 20:13:30.686210453 +0400
+@@ -61,7 +61,7 @@
+ include ../../Makefile.amd64
+ include ../../../Makefile.kmdb
+
+-STANDLIBS += $(SRC)/lib/libdisasm/amd64/libstanddisasm.so
++STANDLIBS += $(DEB_USRLIBDIR_64)/libstanddisasm.so
+
+ INCDIRS += $(SRC)/uts/i86pc $(SRC)/common/dis/i386
+
+Index: b/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile
+===================================================================
+--- a/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2013-04-25 20:12:57.467162040 +0400
++++ b/usr/src/cmd/mdb/intel/ia32/kmdb/Makefile 2013-04-25 20:13:30.687912295 +0400
+@@ -52,7 +52,7 @@
+ include ../../Makefile.ia32
+ include ../../../Makefile.kmdb
+
+-STANDLIBS += $(SRC)/lib/libdisasm/i386/libstanddisasm.so
++STANDLIBS += $(DEB_USRLIBDIR_32)/libstanddisasm.so
+
+ INCDIRS += $(SRC)/uts/i86pc
+
+Index: b/usr/src/cmd/mdb/Makefile.mdb
+===================================================================
+--- a/usr/src/cmd/mdb/Makefile.mdb 2013-04-25 20:12:31.843416381 +0400
++++ b/usr/src/cmd/mdb/Makefile.mdb 2013-04-25 20:13:30.689188941 +0400
+@@ -97,7 +97,7 @@
+ C99MODE= -xc99=%all
+ C99LMODE= -Xc99=%all
+
+-LDLIBS += -lcurses -lkvm -lproc -lrtld_db -lctf -lumem -ldisasm -lscf
++LDLIBS += -lcurses -lkvm -lproc -lrtld_db -lctf -lumem -lsundisasm -lscf
+
+ CERRWARN += -_gcc=-Wno-uninitialized
+ CERRWARN += -_gcc=-Wno-char-subscripts
diff --git a/mdb/debian/patches/series b/mdb/debian/patches/series
index 5f070d6..72b5b8b 100644
--- a/mdb/debian/patches/series
+++ b/mdb/debian/patches/series
@@ -17,6 +17,8 @@ mdb-teminfo.patch
mdb-tigen-echo.patch
mdb-kvm_ia32dep.c-pointers.patch
mdb-mdb_cmds.c-pointers.patch
-mdb-disable-demangle.patch
mdb-mdb_kvm.c-pointers.patch
mdb-mdb_proc.c-pointers.patch
+mdb-use-libsundisasm.patch
+mdb-libtinfo.patch
+mdb-demangle.patch
diff --git a/mdb/debian/rules b/mdb/debian/rules
index b628197..4106742 100755
--- a/mdb/debian/rules
+++ b/mdb/debian/rules
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
-include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/architecture.mk
export DH_VERBOSE = 1
@@ -25,6 +25,10 @@ unpack-stamp:
echo 'export YACC=/usr/bin/sgs-yacc' >> usr/env.sh
echo 'export LEX=/usr/bin/sgs-lex' >> usr/env.sh
+ # GCC still does not support -msave-args, and I'm not sure
+ # if this option is good at all:
+ echo 'export SAVEARGS=' >> usr/env.sh
+
touch $@
patch: patch-stamp
@@ -40,8 +44,21 @@ unpatch:
dirs-stamp: unpack-stamp
. usr/env.sh; mkdir -p \
- debian/tmp/usr/lib \
- debian/tmp/usr/include/sys
+ debian/tmp/usr/include/sys \
+ debian/tmp$$DEB_LIBDIR_32 \
+ debian/tmp$$DEB_LIBDIR_64 \
+ debian/tmp$$DEB_USRLIBDIR_32 \
+ debian/tmp$$DEB_USRLIBDIR_64
+ # libncurses workaround:
+ # libcurses.so is a linker script for GNU ld.
+ # The linker we have to use (SunOS ld) does not understand it.
+ # So we create symbolic links for libncurses.so.5 under debian/tmp.
+ # Also note that we've patched mdb to explicitly link with libtinfo
+ ln -sf /lib32/libncurses.so.5 debian/tmp/usr/lib32/libcurses.so
+ ln -sf /lib/$(DEB_HOST_MULTIARCH)/libncurses.so.5 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcurses.so
+ touch $@
+
+headers-stamp: patch-stamp dirs-stamp
touch $@
install: install-stamp
@@ -50,7 +67,7 @@ install-stamp: build-stamp
touch $@
build build-arch build-indep: build-stamp
-build-stamp: dirs-stamp patch-stamp
+build-stamp: dirs-stamp patch-stamp headers-stamp
dh_illumos_make -m sunmake $(cmd:%=usr/src/cmd/%)
touch $@