1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
==========
gdb.config:
==========
#!/bin/sh
CFLAGS_FOR_TARGET="-g3 -O0 --sysroot=$HOME/midipix/nt64/debug/native" \
CXX_FOR_TARGET="-g3 -O0 --sysroot=$HOME/midipix/nt64/debug/native" \
LDFLAGS_FOR_TARGET="--sysroot=$HOME/midipix/nt64/debug/native" \
../gdb-7.12/configure --with-system-zlib --with-system-libiberty \
--host=x86_64-nt64-midipix --target=x86_64-nt64-midipix \
--build=$(cc -dumpmachine)
========
gdb.make:
========
#!/bin/sh
make LIBTOOL=rdlibtool MAKE="make LIBTOOL=rdlibtool" -j8 \
SYSROOT_FLAGS=--sysroot=$HOME/midipix/nt64/debug/native
===========
gdb.install:
===========
#!/bin/sh
make LIBTOOL=rdlibtool MAKE="make LIBTOOL=rdlibtool" -j8 \
SYSROOT_FLAGS=--sysroot=$HOME/midipix/nt64/debug/native \
DESTDIR=destdir install
diff -ru --new-file a/bfd/config.bfd b/bfd/config.bfd
--- a/bfd/config.bfd 2016-08-01 15:50:20.000000000 +0000
+++ b/bfd/config.bfd 2019-06-03 23:32:57.633401252 +0000
@@ -729,7 +729,7 @@
targ_archs="$targ_archs bfd_arm_arch"
want64=true
;;
- x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
+ x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | x86_64-*-midipix)
targ_defvec=x86_64_pe_vec
targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_be_vec x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec"
want64=true
@@ -782,7 +782,7 @@
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_coff_vec"
;;
- i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
+ i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe | i[3-7]86-*-midipix)
targ_defvec=i386_pe_vec
targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec"
targ_underscore=yes
diff -ru --new-file a/bfd/Makefile.in b/bfd/Makefile.in
--- a/bfd/Makefile.in 2016-10-07 17:09:21.000000000 +0000
+++ b/bfd/Makefile.in 2019-06-03 23:32:57.637401253 +0000
@@ -385,8 +385,8 @@
# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
# -I../zlib, unless we were configured with --with-system-zlib, in which
# case both are empty.
-ZLIB = @zlibdir@ -lz
-ZLIBINC = @zlibinc@
+ZLIB = @zlibdir@ -lz $(SYSROOT_FLAGS)
+ZLIBINC = @zlibinc@ $(SYSROOT_FLAGS)
AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC)
AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
diff -ru --new-file a/config.guess b/config.guess
--- a/config.guess 2016-08-01 15:50:20.000000000 +0000
+++ b/config.guess 2019-06-03 23:32:57.637401253 +0000
@@ -4,6 +4,9 @@
timestamp='2016-05-27'
+echo x86_64-nt64-midipix
+exit
+
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
diff -ru --new-file a/config.sub b/config.sub
--- a/config.sub 2016-08-01 15:50:20.000000000 +0000
+++ b/config.sub 2019-06-03 23:32:57.637401253 +0000
@@ -1389,7 +1389,7 @@
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
diff -ru --new-file a/gdb/config/i386/midipix64.mh b/gdb/config/i386/midipix64.mh
--- a/gdb/config/i386/midipix64.mh 1970-01-01 00:00:00.000000000 +0000
+++ b/gdb/config/i386/midipix64.mh 2019-06-03 23:33:23.657405443 +0000
@@ -0,0 +1 @@
+
diff -ru --new-file a/gdb/config/i386/midipix.mh b/gdb/config/i386/midipix.mh
--- a/gdb/config/i386/midipix.mh 1970-01-01 00:00:00.000000000 +0000
+++ b/gdb/config/i386/midipix.mh 2019-06-03 23:33:15.317404098 +0000
@@ -0,0 +1 @@
+
diff -ru --new-file a/gdb/configure.host b/gdb/configure.host
--- a/gdb/configure.host 2016-08-01 15:50:20.000000000 +0000
+++ b/gdb/configure.host 2019-06-03 23:32:57.637401253 +0000
@@ -109,6 +109,7 @@
;;
i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;;
i[34567]86-*-linux*) gdb_host=linux ;;
+i[34567]86-*-midipix*) gdb_host=midipix ;;
i[34567]86-*-gnu*) gdb_host=i386gnu ;;
i[3456]86-*-nto*) gdb_host=nto ;;
i[34567]86-*-openbsd*) gdb_host=obsd ;;
@@ -174,6 +175,7 @@
vax-*-openbsd*) gdb_host=obsd ;;
x86_64-*-linux*) gdb_host=linux64 ;;
+x86_64-*-midipix*) gdb_host=midipix64 ;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
gdb_host=fbsd64 ;;
x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
diff -ru --new-file a/gdb/configure.tgt b/gdb/configure.tgt
--- a/gdb/configure.tgt 2016-10-07 17:09:21.000000000 +0000
+++ b/gdb/configure.tgt 2019-06-03 23:32:57.637401253 +0000
@@ -678,6 +678,13 @@
windows-tdep.o"
build_gdbserver=yes
;;
+x86_64-*-midipix)
+ # Target: Midipix
+ gdb_target_obs="amd64-tdep.o amd64-windows-tdep.o \
+ i386-tdep.o i387-tdep.o \
+ windows-tdep.o"
+ build_gdbserver=no
+ ;;
x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
# Target: NetBSD/amd64
gdb_target_obs="amd64-tdep.o amd64nbsd-tdep.o i386-tdep.o i387-tdep.o \
@@ -718,6 +725,7 @@
*-*-mingw32ce*) gdb_osabi=GDB_OSABI_WINCE ;;
*-*-mingw* | *-*-cygwin*)
gdb_osabi=GDB_OSABI_CYGWIN ;;
+*-*-midipix*) gdb_osabi=GDB_OSABI_WINNT ;;
*-*-dicos*) gdb_osabi=GDB_OSABI_DICOS ;;
*-*-symbianelf*)
gdb_osabi=GDB_OSABI_SYMBIAN ;;
diff -ru --new-file a/gdb/defs.h b/gdb/defs.h
--- a/gdb/defs.h 2016-10-07 17:09:21.000000000 +0000
+++ b/gdb/defs.h 2019-06-03 23:32:57.637401253 +0000
@@ -602,6 +602,7 @@
GDB_OSABI_NETBSD_ELF,
GDB_OSABI_OPENBSD_ELF,
GDB_OSABI_WINCE,
+ GDB_OSABI_WINNT,
GDB_OSABI_GO32,
GDB_OSABI_IRIX,
GDB_OSABI_HPUX_ELF,
diff -ru --new-file a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
--- a/gdb/doc/Makefile.in 2016-08-01 15:50:20.000000000 +0000
+++ b/gdb/doc/Makefile.in 2019-06-03 23:32:57.637401253 +0000
@@ -74,8 +74,8 @@
# Where is the source dir for the READLINE library doc?
# Traditionally readline is in .. or .
-READLINE_DIR = ${gdbdir}/../readline/doc
-READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@
+READLINE_DIR = # ${gdbdir}/../readline/doc
+READLINE_TEXI_INCFLAG = # @READLINE_TEXI_INCFLAG@
# The GDB/MI docs come from a sibling directory ../mi
GDBMI_DIR = ${gdbdir}/mi
@@ -673,6 +673,10 @@
maintainer-clean realclean: distclean
rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf $(MANS)
+ifeq (0,0)
+install:
+else
install: install-info install-man
+endif
uninstall: uninstall-info uninstall-man
diff -ru --new-file a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in 2016-10-07 17:09:21.000000000 +0000
+++ b/gdb/Makefile.in 2019-06-03 23:32:57.637401253 +0000
@@ -150,7 +150,7 @@
# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
# -I../zlib, unless we were configured with --with-system-zlib, in which
# case both are empty.
-ZLIB = @zlibdir@ -lz
+ZLIB = @zlibdir@ -lz $(SYSROOT_FLAGS)
ZLIBINC = @zlibinc@
# Where is the decnumber library? Typically in ../libdecnumber.
@@ -162,9 +162,9 @@
# Where is the READLINE library? Typically in ../readline.
READLINE_DIR = ../readline
READLINE_SRC = $(srcdir)/$(READLINE_DIR)
-READLINE = @READLINE@
-READLINE_DEPS = @READLINE_DEPS@
-READLINE_CFLAGS = @READLINE_CFLAGS@
+READLINE = -lreadline
+READLINE_DEPS =
+READLINE_CFLAGS = $(SYSROOT_FLAGS)
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
@@ -468,12 +468,12 @@
# disassemblers?
OPCODES_DIR = ../opcodes
OPCODES_SRC = $(srcdir)/$(OPCODES_DIR)
-OPCODES = $(OPCODES_DIR)/libopcodes.a
+OPCODES = -lopcodes
# Where are the other opcode tables which only have header file
# versions?
OP_INCLUDE = $(INCLUDE_DIR)/opcode
# Some source files like to use #include "opcodes/file.h"
-OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
+OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/.. $(SYSROOT_FLAGS)
# The simulator is usually nonexistent; targets that include one
# should set this to list all the .o or .a files to be linked in.
@@ -599,7 +599,7 @@
$(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV)
CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
- $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
+ $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
diff -ru --new-file a/gdb/osabi.c b/gdb/osabi.c
--- a/gdb/osabi.c 2016-08-01 15:50:20.000000000 +0000
+++ b/gdb/osabi.c 2019-06-04 00:54:53.410635600 +0000
@@ -70,6 +70,7 @@
{ "NetBSD/ELF", NULL },
{ "OpenBSD/ELF", NULL },
{ "WindowsCE", NULL },
+ { "WINNT", "(midipix)" },
{ "DJGPP", NULL },
{ "Irix", NULL },
{ "HP-UX/ELF", NULL },
diff -ru --new-file a/gdb/stub-termcap.c b/gdb/stub-termcap.c
--- a/gdb/stub-termcap.c 2016-10-07 17:09:21.000000000 +0000
+++ b/gdb/stub-termcap.c 2019-06-03 23:32:57.637401253 +0000
@@ -50,11 +50,13 @@
weak (later versions, e.g., 4.8, do support it). Given this stub
file originally was Windows only, and we only needed this when we
made it work on other hosts, it should be OK. */
+#if 0
#ifndef __MINGW32__
char PC __attribute__((weak));
char *BC __attribute__((weak));
char *UP __attribute__((weak));
#endif
+#endif
/* Each of the files below is a minimal implementation of the standard
termcap function with the same name, suitable for use in a Windows
|