Commit 5816ae1d authored by Martin Karsten's avatar Martin Karsten

- upgrade to latest gdb, qemu, acpi

parent f7ba5ed7
......@@ -10,7 +10,7 @@ A somewhat recent version of *xorriso* (>-1.0.0) is necessary for making ISO boo
Run `setup_crossenv.sh gcc gdb grub 2>&1 | tee setup.out` (bash syntax) to build the complete tool chain. The output should contain the following (among other output; grep for SUCCESS):
`SUCCESS: gcc-5.2.0 install`
`SUCCESS: gdb-7.9.1 install`
`SUCCESS: gdb-7.10 install`
`SUCCESS: grub-2.02~beta2 install`
Note that the cross compiler expects the KOS system library (`libKOS.a`) in the `src/ulib` directory when linking user-level programs. This configuration setting is hard-coded in the *link_libgcc* and *libgcc* specs of the cross compiler. This is controlled by the variable `ULDIR` in `setup_crossenv.sh`.
......@@ -27,10 +27,10 @@ To prepare the KOS source code (starting from the main directory), download and
```
cd src/extern
wget https://acpica.org/sites/acpica/files/acpica-unix-20150717.tar.gz
tar xaf acpica-unix-20150717.tar.gz
rm acpica-unix-20150717.tar.gz
mv acpica-unix-20150717 acpica
wget https://acpica.org/sites/acpica/files/acpica-unix-20150930.tar.gz
tar xaf acpica-unix-20150930.tar.gz
rm acpica-unix-20150930.tar.gz
mv acpica-unix-20150930 acpica
patch -d acpica -p1 < ../../patches/acpica.patch
wget http://download.savannah.gnu.org/releases/lwip/lwip-1.4.1.zip
unzip -d lwip lwip-1.4.1.zip
......
diff -ruN acpica-unix-20150717/Makefile acpica/Makefile
--- acpica-unix-20150717/Makefile 2015-07-17 12:04:13.000000000 -0400
+++ acpica/Makefile 2015-08-02 22:25:07.313209232 -0400
diff -ruN acpica-unix-20150930-orig/Makefile acpica/Makefile
--- acpica-unix-20150930-orig/Makefile 2015-09-30 15:14:33.000000000 -0400
+++ acpica/Makefile 2015-09-30 21:59:31.921160130 -0400
@@ -11,12 +11,64 @@
# compilations of the same source file with different compile options.
#
......@@ -75,10 +75,10 @@ diff -ruN acpica-unix-20150717/Makefile acpica/Makefile
+ rm -rf libacpica.a
+
+dep depend Makefile.dep:
diff -ruN acpica-unix-20150717/source/include/platform/acenv.h acpica/source/include/platform/acenv.h
--- acpica-unix-20150717/source/include/platform/acenv.h 2015-07-17 12:04:23.000000000 -0400
+++ acpica/source/include/platform/acenv.h 2015-08-02 22:25:07.313209232 -0400
@@ -289,6 +289,9 @@
diff -ruN acpica-unix-20150930-orig/source/include/platform/acenv.h acpica/source/include/platform/acenv.h
--- acpica-unix-20150930-orig/source/include/platform/acenv.h 2015-09-30 15:14:42.000000000 -0400
+++ acpica/source/include/platform/acenv.h 2015-09-30 21:59:31.921160130 -0400
@@ -290,6 +290,9 @@
#elif defined(__HAIKU__)
#include "achaiku.h"
......@@ -88,10 +88,10 @@ diff -ruN acpica-unix-20150717/source/include/platform/acenv.h acpica/source/inc
#else
/* Unknown environment */
diff -ruN acpica-unix-20150717/source/include/platform/ackos.h acpica/source/include/platform/ackos.h
--- acpica-unix-20150717/source/include/platform/ackos.h 1969-12-31 19:00:00.000000000 -0500
+++ acpica/source/include/platform/ackos.h 2015-08-02 22:25:07.313209232 -0400
@@ -0,0 +1,34 @@
diff -ruN acpica-unix-20150930-orig/source/include/platform/ackos.h acpica/source/include/platform/ackos.h
--- acpica-unix-20150930-orig/source/include/platform/ackos.h 1969-12-31 19:00:00.000000000 -0500
+++ acpica/source/include/platform/ackos.h 2015-09-30 21:59:54.244420172 -0400
@@ -0,0 +1,35 @@
+#ifndef __ACKOS_H__
+#define __ACKOS_H__
+
......@@ -101,6 +101,7 @@ diff -ruN acpica-unix-20150717/source/include/platform/ackos.h acpica/source/inc
+//#define ACPI_USE_SYSTEM_CLIBRARY
+//#define ACPI_FLUSH_CPU_CACHE()
+
+#define ACPI_DEBUG_OUTPUT
+#define ACPI_USE_DO_WHILE_0
+#define ACPI_USE_LOCAL_CACHE
+#define ACPI_USE_SYSTEM_CLIBRARY
......
diff -ruN bochs-2.6.6-orig/cpu/iret.cc bochs-2.6.6/cpu/iret.cc
--- bochs-2.6.6-orig/cpu/iret.cc 2012-03-25 07:54:32.800419000 -0400
+++ bochs-2.6.6/cpu/iret.cc 2014-06-20 16:36:48.839986202 -0400
@@ -256,7 +256,7 @@
/* stack segment DPL must equal the RPL of the return CS selector,
* else #GP(SS selector) */
if (ss_descriptor.dpl != cs_selector.rpl) {
- BX_ERROR(("iret: SS.dpl != CS selector RPL"));
+ BX_ERROR(("iret: SS.dpl (%d) != CS selector RPL (%d)", ss_descriptor.dpl, cs_selector.rpl));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc);
}
@@ -496,7 +496,7 @@
/* stack segment DPL must equal the RPL of the return CS selector,
* else #GP(SS selector) */
if (ss_descriptor.dpl != cs_selector.rpl) {
- BX_ERROR(("iret64: SS.dpl != CS selector RPL"));
+ BX_ERROR(("iret64: SS.dpl (%d) != CS selector RPL (%d)", ss_descriptor.dpl, cs_selector.rpl));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc);
}
diff -ruN bochs-2.6.6-orig/Makefile.in bochs-2.6.6/Makefile.in
--- bochs-2.6.6-orig/Makefile.in 2014-06-06 14:45:31.388982000 -0400
+++ bochs-2.6.6/Makefile.in 2014-06-20 16:37:05.726628039 -0400
@@ -89,7 +89,7 @@
CXXFLAGS = @CXXFLAGS@ @GUI_CXXFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ -lpthread
# To compile with readline:
# linux needs just -lreadline
# solaris needs -lreadline -lcurses
diff -ruN binutils-2.24-orig/bfd/bfd-in2.h binutils-2.24/bfd/bfd-in2.h
--- binutils-2.24-orig/bfd/bfd-in2.h 2013-11-18 03:40:15.000000000 -0500
+++ binutils-2.24/bfd/bfd-in2.h 2014-06-20 11:51:09.203846835 -0400
@@ -300,8 +300,11 @@
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
+#define bfd_set_section_vmaX(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+#define bfd_set_section_alignmentX(bfd, ptr, val) (((ptr)->alignment_power = (val)))
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+#define bfd_set_section_userdataX(bfd, ptr, val) (((ptr)->userdata = (val)))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
diff -ruN binutils-2.24-orig/bfd/bfd-in.h binutils-2.24/bfd/bfd-in.h
--- binutils-2.24-orig/bfd/bfd-in.h 2013-11-04 10:33:37.000000000 -0500
+++ binutils-2.24/bfd/bfd-in.h 2014-06-20 11:51:09.203846835 -0400
@@ -293,8 +293,11 @@
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
+#define bfd_set_section_vmaX(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+#define bfd_set_section_alignmentX(bfd, ptr, val) (((ptr)->alignment_power = (val)))
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+#define bfd_set_section_userdataX(bfd, ptr, val) (((ptr)->userdata = (val)))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
diff -ruN binutils-2.24-orig/binutils/bucomm.c binutils-2.24/binutils/bucomm.c
--- binutils-2.24-orig/binutils/bucomm.c 2013-11-04 10:33:37.000000000 -0500
+++ binutils-2.24/binutils/bucomm.c 2014-06-20 11:51:09.207180137 -0400
@@ -127,7 +127,7 @@
}
void
-fatal VPARAMS ((const char *format, ...))
+fatal (const char *format, ...)
{
VA_OPEN (args, format);
VA_FIXEDARG (args, const char *, format);
@@ -138,7 +138,7 @@
}
void
-non_fatal VPARAMS ((const char *format, ...))
+non_fatal (const char *format, ...)
{
VA_OPEN (args, format);
VA_FIXEDARG (args, const char *, format);
diff -ruN binutils-2.24-orig/binutils/objcopy.c binutils-2.24/binutils/objcopy.c
--- binutils-2.24-orig/binutils/objcopy.c 2013-11-04 10:33:37.000000000 -0500
+++ binutils-2.24/binutils/objcopy.c 2014-06-20 11:51:09.207180137 -0400
@@ -1890,7 +1890,7 @@
/* Umm, not sure what to do in this case. */
debuglink_vma = 0x1000;
- bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma);
+ bfd_set_section_vmaX (obfd, gnu_debuglink_section, debuglink_vma);
}
}
}
diff -ruN binutils-2.24-orig/gas/config/obj-elf.c binutils-2.24/gas/config/obj-elf.c
--- binutils-2.24-orig/gas/config/obj-elf.c 2013-11-04 10:33:37.000000000 -0500
+++ binutils-2.24/gas/config/obj-elf.c 2014-06-20 11:51:09.207180137 -0400
@@ -1937,7 +1937,7 @@
/* Force the section to align to a longword boundary. Without this,
UnixWare ar crashes. */
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_alignmentX (stdoutput, seg, 2);
/* Make space for this first symbol. */
p = frag_more (12);
diff -ruN binutils-2.24-orig/gas/subsegs.c binutils-2.24/gas/subsegs.c
--- binutils-2.24-orig/gas/subsegs.c 2013-11-04 10:33:37.000000000 -0500
+++ binutils-2.24/gas/subsegs.c 2014-06-20 11:51:09.207180137 -0400
@@ -67,7 +67,7 @@
{
seginfo = (segment_info_type *) xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = seg;
- bfd_set_section_userdata (stdoutput, seg, seginfo);
+ bfd_set_section_userdataX (stdoutput, seg, seginfo);
}
}
@@ -169,7 +169,7 @@
secptr->output_section = secptr;
seginfo = (segment_info_type *) xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = secptr;
- bfd_set_section_userdata (stdoutput, secptr, seginfo);
+ bfd_set_section_userdataX (stdoutput, secptr, seginfo);
}
return secptr;
}
diff -ruN binutils-2.24-orig/gas/write.c binutils-2.24/gas/write.c
--- binutils-2.24-orig/gas/write.c 2013-11-04 10:33:38.000000000 -0500
+++ binutils-2.24/gas/write.c 2014-06-20 11:51:09.207180137 -0400
@@ -363,7 +363,7 @@
return;
if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg))
- bfd_set_section_alignment (stdoutput, seg, align);
+ bfd_set_section_alignmentX (stdoutput, seg, align);
}
int
diff -ruN binutils-2.24-orig/ld/ldlang.c binutils-2.24/ld/ldlang.c
--- binutils-2.24-orig/ld/ldlang.c 2013-11-04 10:33:39.000000000 -0500
+++ binutils-2.24/ld/ldlang.c 2014-06-20 11:53:54.755631204 -0400
@@ -4831,7 +4831,7 @@
" section %s\n"), os->name);
input = os->children.head->input_section.section;
- bfd_set_section_vma (os->bfd_section->owner,
+ bfd_set_section_vmaX (os->bfd_section->owner,
os->bfd_section,
bfd_section_vma (input->owner, input));
os->bfd_section->size = input->size;
@@ -4916,7 +4916,7 @@
os->name, (unsigned long) (newdot - savedot));
}
- bfd_set_section_vma (0, os->bfd_section, newdot);
+ bfd_set_section_vmaX (0, os->bfd_section, newdot);
os->bfd_section->output_offset = 0;
}
diff -ruN gcc-4.9.0-orig/gcc/config/i386/i386elf.h gcc-4.9.0/gcc/config/i386/i386elf.h
--- gcc-4.9.0-orig/gcc/config/i386/i386elf.h 2014-01-02 17:23:26.000000000 -0500
+++ gcc-4.9.0/gcc/config/i386/i386elf.h 2014-07-23 21:32:00.583474913 -0400
@@ -29,12 +29,12 @@
#undef CPP_SPEC
#define CPP_SPEC ""
-#define ENDFILE_SPEC "crtend.o%s"
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
#define STARTFILE_SPEC "%{!shared: \
%{!symbolic: \
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
- crtbegin.o%s"
+ crti.o%s crtbegin.o%s"
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
--- newlib-2.1.0/newlib/libc/include/machine/_default_types.h-orig 2014-02-02 15:13:50.000000000 -0600
+++ newlib-2.1.0/newlib/libc/include/machine/_default_types.h 2014-02-02 16:01:23.000000000 -0600
@@ -25,7 +25,11 @@
#ifdef __INT8_TYPE__
typedef __INT8_TYPE__ __int8_t;
+#ifdef __UINT8_TYPE__
typedef __UINT8_TYPE__ __uint8_t;
+#else
+typedef unsigned __INT8_TYPE__ __uint8_t;
+#endif
#define ___int8_t_defined 1
#elif __EXP(SCHAR_MAX) == 0x7f
typedef signed char __int8_t ;
@@ -35,7 +39,11 @@
#ifdef __INT16_TYPE__
typedef __INT16_TYPE__ __int16_t;
+#ifdef __UINT16_TYPE__
typedef __UINT16_TYPE__ __uint16_t;
+#else
+typedef unsigned __INT16_TYPE__ __uint16_t;
+#endif
#define ___int16_t_defined 1
#elif __EXP(INT_MAX) == 0x7fff
typedef signed int __int16_t;
@@ -53,7 +61,11 @@
#ifdef __INT32_TYPE__
typedef __INT32_TYPE__ __int32_t;
+#ifdef __UINT32_TYPE__
typedef __UINT32_TYPE__ __uint32_t;
+#else
+typedef unsigned __INT32_TYPE__ __uint32_t;
+#endif
#define ___int32_t_defined 1
#elif __EXP(INT_MAX) == 0x7fffffffL
typedef signed int __int32_t;
@@ -75,7 +87,11 @@
#ifdef __INT64_TYPE__
typedef __INT64_TYPE__ __int64_t;
+#ifdef __UINT64_TYPE__
typedef __UINT64_TYPE__ __uint64_t;
+#else
+typedef unsigned __INT64_TYPE__ __uint64_t;
+#endif
#define ___int64_t_defined 1
#elif __EXP(LONG_MAX) > 0x7fffffff
typedef signed long __int64_t;
@@ -102,7 +118,11 @@
#ifdef __INT_LEAST8_TYPE__
typedef __INT_LEAST8_TYPE__ __int_least8_t;
+#ifdef __UINT_LEAST8_TYPE__
typedef __UINT_LEAST8_TYPE__ __uint_least8_t;
+#else
+typedef unsigned __INT_LEAST8_TYPE__ __uint_least8_t;
+#endif
#define ___int_least8_t_defined 1
#elif defined(___int8_t_defined)
typedef __int8_t __int_least8_t;
@@ -124,7 +144,11 @@
#ifdef __INT_LEAST16_TYPE__
typedef __INT_LEAST16_TYPE__ __int_least16_t;
+#ifdef __UINT_LEAST16_TYPE__
typedef __UINT_LEAST16_TYPE__ __uint_least16_t;
+#else
+typedef unsigned __INT_LEAST16_TYPE__ __uint_least16_t;
+#endif
#define ___int_least16_t_defined 1
#elif defined(___int16_t_defined)
typedef __int16_t __int_least16_t;
@@ -142,7 +166,11 @@
#ifdef __INT_LEAST32_TYPE__
typedef __INT_LEAST32_TYPE__ __int_least32_t;
+#ifdef __UINT_LEAST32_TYPE__
typedef __UINT_LEAST32_TYPE__ __uint_least32_t;
+#else
+typedef unsigned __INT_LEAST32_TYPE__ __uint_least32_t;
+#endif
#define ___int_least32_t_defined 1
#elif defined(___int32_t_defined)
typedef __int32_t __int_least32_t;
@@ -156,7 +184,11 @@
#ifdef __INT_LEAST64_TYPE__
typedef __INT_LEAST64_TYPE__ __int_least64_t;
+#ifdef __UINT_LEAST64_TYPE__
typedef __UINT_LEAST64_TYPE__ __uint_least64_t;
+#else
+typedef unsigned __INT_LEAST64_TYPE__ __uint_least64_t;
+#endif
#define ___int_least64_t_defined 1
#elif defined(___int64_t_defined)
typedef __int64_t __int_least64_t;
@@ -166,7 +198,11 @@
#ifdef __INTPTR_TYPE__
typedef __INTPTR_TYPE__ __intptr_t;
+#ifdef __UINTPTR_TYPE__
typedef __UINTPTR_TYPE__ __uintptr_t;
+#else
+typedef unsigned __INTPTR_TYPE__ __uintptr_t;
+#endif
#elif defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__ __intptr_t;
typedef unsigned __PTRDIFF_TYPE__ __uintptr_t;
echo '#define LINK_LIBGCC_SPEC "%D -L' $2'"' >> $1/gcc/config/i386/i386elf.h
echo '#define LIBGCC_SPEC "-lgcc -lKOS -lc"'>> $1/gcc/config/i386/i386elf.h
diff -ruN gcc-4.9.0-orig/gcc/config/i386/i386elf.h gcc-4.9.0/gcc/config/i386/i386elf.h
--- gcc-4.9.0-orig/gcc/config/i386/i386elf.h 2014-01-02 17:23:26.000000000 -0500
+++ gcc-4.9.0/gcc/config/i386/i386elf.h 2014-07-23 21:32:00.583474913 -0400
@@ -29,12 +29,12 @@
#undef CPP_SPEC
#define CPP_SPEC ""
-#define ENDFILE_SPEC "crtend.o%s"
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
#define STARTFILE_SPEC "%{!shared: \
%{!symbolic: \
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
- crtbegin.o%s"
+ crti.o%s crtbegin.o%s"
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
echo '#define LINK_LIBGCC_SPEC "%D -L' $2'"' >> $1/gcc/config/i386/i386elf.h
echo '#define LIBGCC_SPEC "-lgcc -lKOS -lc"'>> $1/gcc/config/i386/i386elf.h
diff -ruN gdb-7.9-orig/gdb/configure.tgt gdb-7.9/gdb/configure.tgt
--- gdb-7.9-orig/gdb/configure.tgt 2015-02-19 06:58:27.000000000 -0500
+++ gdb-7.9/gdb/configure.tgt 2015-03-17 23:23:02.188780750 -0400
@@ -659,6 +659,13 @@
diff -ruN gdb-7.10/gdb/configure.tgt gdb-7.10-patched/gdb/configure.tgt
--- gdb-7.10/gdb/configure.tgt 2015-08-28 17:22:07.000000000 -0400
+++ gdb-7.10-patched/gdb/configure.tgt 2015-09-30 20:27:21.653290842 -0400
@@ -658,6 +658,13 @@
solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
build_gdbserver=yes
;;
......@@ -15,7 +15,7 @@ diff -ruN gdb-7.9-orig/gdb/configure.tgt gdb-7.9/gdb/configure.tgt
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
# Target: FreeBSD/amd64
gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
@@ -701,7 +708,7 @@
@@ -700,7 +707,7 @@
case "${targ}" in
*-*-freebsd* | *-*-kfreebsd*-gnu)
gdb_osabi=GDB_OSABI_FREEBSD_ELF ;;
......@@ -24,10 +24,10 @@ diff -ruN gdb-7.9-orig/gdb/configure.tgt gdb-7.9/gdb/configure.tgt
gdb_osabi=GDB_OSABI_LINUX ;;
*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;;
m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
diff -ruN gdb-7.9-orig/gdb/remote.c gdb-7.9/gdb/remote.c
--- gdb-7.9-orig/gdb/remote.c 2015-02-20 12:11:44.000000000 -0500
+++ gdb-7.9/gdb/remote.c 2015-03-17 23:23:02.192114075 -0400
@@ -6154,8 +6154,16 @@
diff -ruN gdb-7.10/gdb/remote.c gdb-7.10-patched/gdb/remote.c
--- gdb-7.10/gdb/remote.c 2015-08-28 17:22:07.000000000 -0400
+++ gdb-7.10-patched/gdb/remote.c 2015-09-30 20:27:21.656624172 -0400
@@ -6562,8 +6562,16 @@
buf_len = strlen (rs->buf);
/* Further sanity checks, with knowledge of the architecture. */
......
diff -ruN gdb-7.8-orig/gdb/configure.tgt gdb-7.8/gdb/configure.tgt
--- gdb-7.8-orig/gdb/configure.tgt 2014-06-11 12:34:41.000000000 -0400
+++ gdb-7.8/gdb/configure.tgt 2014-09-15 21:41:58.752173387 -0400
@@ -663,6 +663,13 @@
solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
build_gdbserver=yes
;;
+x86_64-*-elf*)
+ # Target: GNU/Linux x86-64
+ gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o i386-tdep.o \
+ i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
+ solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
+ build_gdbserver=yes
+ ;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
# Target: FreeBSD/amd64
gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
@@ -705,7 +712,7 @@
case "${targ}" in
*-*-freebsd* | *-*-kfreebsd*-gnu)
gdb_osabi=GDB_OSABI_FREEBSD_ELF ;;
-*-*-linux* | *-*-uclinux*)
+*-*-linux* | *-*-uclinux* | *-*-elf*)
gdb_osabi=GDB_OSABI_LINUX ;;
*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;;
m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
diff -ruN gdb-7.8-orig/gdb/remote.c gdb-7.8/gdb/remote.c
--- gdb-7.8-orig/gdb/remote.c 2014-07-29 08:37:42.000000000 -0400
+++ gdb-7.8/gdb/remote.c 2014-09-15 21:41:58.752173387 -0400
@@ -6062,8 +6062,16 @@
buf_len = strlen (rs->buf);
/* Further sanity checks, with knowledge of the architecture. */
- if (buf_len > 2 * rsa->sizeof_g_packet)
- error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
+ if (buf_len > 2 * rsa->sizeof_g_packet) {
+ rsa->sizeof_g_packet = buf_len;
+ for (i = 0; i < gdbarch_num_regs (gdbarch); i++) {
+ if (rsa->regs[i].pnum == -1) continue;
+ if (rsa->regs[i].offset >= rsa->sizeof_g_packet)
+ rsa->regs[i].in_g_packet = 0;
+ else
+ rsa->regs[i].in_g_packet = 1;
+ }
+ }
/* Save the size of the packet sent to us by the target. It is used
as a heuristic when determining the max size of packets that the
diff -ruN gdb-7.9-orig/gdb/configure.tgt gdb-7.9/gdb/configure.tgt
--- gdb-7.9-orig/gdb/configure.tgt 2015-02-19 06:58:27.000000000 -0500
+++ gdb-7.9/gdb/configure.tgt 2015-03-17 23:23:02.188780750 -0400
@@ -659,6 +659,13 @@
solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
build_gdbserver=yes
;;
+x86_64-*-elf*)
+ # Target: GNU/Linux x86-64
+ gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o i386-tdep.o \
+ i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
+ solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
+ build_gdbserver=yes
+ ;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
# Target: FreeBSD/amd64
gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
@@ -701,7 +708,7 @@
case "${targ}" in
*-*-freebsd* | *-*-kfreebsd*-gnu)
gdb_osabi=GDB_OSABI_FREEBSD_ELF ;;
-*-*-linux* | *-*-uclinux*)
+*-*-linux* | *-*-uclinux* | *-*-elf*)
gdb_osabi=GDB_OSABI_LINUX ;;
*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;;
m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
diff -ruN gdb-7.9-orig/gdb/remote.c gdb-7.9/gdb/remote.c
--- gdb-7.9-orig/gdb/remote.c 2015-02-20 12:11:44.000000000 -0500
+++ gdb-7.9/gdb/remote.c 2015-03-17 23:23:02.192114075 -0400
@@ -6154,8 +6154,16 @@
buf_len = strlen (rs->buf);
/* Further sanity checks, with knowledge of the architecture. */
- if (buf_len > 2 * rsa->sizeof_g_packet)
- error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
+ if (buf_len > 2 * rsa->sizeof_g_packet) {
+ rsa->sizeof_g_packet = buf_len;
+ for (i = 0; i < gdbarch_num_regs (gdbarch); i++) {
+ if (rsa->regs[i].pnum == -1) continue;
+ if (rsa->regs[i].offset >= rsa->sizeof_g_packet)
+ rsa->regs[i].in_g_packet = 0;
+ else
+ rsa->regs[i].in_g_packet = 1;
+ }
+ }
/* Save the size of the packet sent to us by the target. It is used
as a heuristic when determining the max size of packets that the
echo "\
.section .text
.global _start
_start:
# Set up end of the stack frame linked list.
xor %rbp, %rbp # clear %rbp
pushq %rbp # previous %rip = 0
pushq %rbp # previous %rbp = 0
movq %rsp, %rbp
# We need those in a moment when we call main.
pushq %rsi
pushq %rdi
# Prepare signals, memory allocation, stdio and such.
call _initialize_KOS_standard_library
# Run the global constructors.
call _init
# Restore argc and argv.
popq %rdi
popq %rsi
# Run main
call main
# Terminate the process with the exit code.
movq %rax, %rdi
call exit"\
> $1/libgloss/libnosys/crt0.S
echo "\
.section .init
.global _init
_init:
push %rbp
movq %rsp, %rbp
/* gcc will nicely put the contents of crtbegin.o's .init section here. */
.section .fini
.global _fini
_fini:
push %rbp
movq %rsp, %rbp
/* gcc will nicely put the contents of crtbegin.o's .fini section here. */"\
> $1/libgloss/libnosys/crti.S
echo "\
.section .init
/* gcc will nicely put the contents of crtend.o's .init section here. */
popq %rbp
ret
.section .fini
/* gcc will nicely put the contents of crtend.o's .fini section here. */
popq %rbp
ret"\
> $1/libgloss/libnosys/crtn.S
sed -i 's/OUTPUTS = /OUTPUTS = crt0.o crti.o crtn.o /' $1/libgloss/libnosys/Makefile.in
sed -i 's/#define _READ_WRITE_RETURN_TYPE int/#define _READ_WRITE_RETURN_TYPE _ssize_t/' $1/newlib/libc/include/sys/config.h
echo 'newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DABORT_PROVIDED"'\
>> $1/newlib/configure.host
cd $1/libgloss
autoconf
echo "\
.section .text
.global _start
_start:
# Set up end of the stack frame linked list.
xor %rbp, %rbp # clear %rbp
pushq %rbp # previous %rip = 0
pushq %rbp # previous %rbp = 0
movq %rsp, %rbp
# We need those in a moment when we call main.
pushq %rsi
pushq %rdi
# Prepare signals, memory allocation, stdio and such.
call _initialize_KOS_standard_library
# Run the global constructors.
call _init
# Restore argc and argv.
popq %rdi
popq %rsi
# Run main
call main
# Terminate the process with the exit code.
movq %rax, %rdi
call exit"\
> $1/libgloss/libnosys/crt0.S
echo "\
.section .init
.global _init
_init:
push %rbp
movq %rsp, %rbp
/* gcc will nicely put the contents of crtbegin.o's .init section here. */
.section .fini
.global _fini
_fini:
push %rbp
movq %rsp, %rbp
/* gcc will nicely put the contents of crtbegin.o's .fini section here. */"\
> $1/libgloss/libnosys/crti.S
echo "\
.section .init
/* gcc will nicely put the contents of crtend.o's .init section here. */
popq %rbp
ret
.section .fini
/* gcc will nicely put the contents of crtend.o's .fini section here. */
popq %rbp
ret"\
> $1/libgloss/libnosys/crtn.S
sed -i 's/OUTPUTS = /OUTPUTS = crt0.o crti.o crtn.o /' $1/libgloss/libnosys/Makefile.in
sed -i 's/#define _READ_WRITE_RETURN_TYPE int/#define _READ_WRITE_RETURN_TYPE _ssize_t/' $1/newlib/libc/include/sys/config.h
echo 'newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DABORT_PROVIDED"'\
>> $1/newlib/configure.host
cd $1/libgloss
autoconf
......@@ -20,10 +20,10 @@ cd -
BINUTILS=binutils-2.25.1 # GNU mirror
BOCHS=bochs-2.6.8 # http://bochs.sourceforge.net/
GCC=gcc-$GCCVER # GNU mirror
GDB=gdb-7.9.1 # GNU mirror
GDB=gdb-7.10 # GNU mirror
GRUB=grub-2.02~beta2 # http://alpha.gnu.org/gnu/grub/
NEWLIB=newlib-2.2.0.20150623 # http://sourceware.org/newlib/
QEMU=qemu-2.3.0 # http://www.qemu.org/