From 9b88f8a526eba71fe67c6d35845f51fd9523fd02 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 30 Aug 2019 16:53:37 +0000 Subject: project: applied new directory layout (./etc and ./patches sub-directories). --- binutils-2.24.51.midipix.patch | 1391 ------------------------ config.cache | 166 --- config.sub | 1823 -------------------------------- etc/config.cache | 166 +++ etc/config.sub | 1823 ++++++++++++++++++++++++++++++++ gdb-7.12.midipix.patch | 368 ------- gmp-5.1.1.midipix.patch | 23 - gmp-5.1.3.midipix.patch | 22 - libelf-0.8.13.midipix.patch | 39 - libffi-3.2.1.midipix.patch | 108 -- patches/binutils-2.24.51.midipix.patch | 1391 ++++++++++++++++++++++++ patches/gdb-7.12.midipix.patch | 368 +++++++ patches/gmp-5.1.1.midipix.patch | 23 + patches/gmp-5.1.3.midipix.patch | 22 + patches/libelf-0.8.13.midipix.patch | 39 + patches/libffi-3.2.1.midipix.patch | 108 ++ 16 files changed, 3940 insertions(+), 3940 deletions(-) delete mode 100644 binutils-2.24.51.midipix.patch delete mode 100644 config.cache delete mode 100644 config.sub create mode 100644 etc/config.cache create mode 100644 etc/config.sub delete mode 100644 gdb-7.12.midipix.patch delete mode 100644 gmp-5.1.1.midipix.patch delete mode 100644 gmp-5.1.3.midipix.patch delete mode 100644 libelf-0.8.13.midipix.patch delete mode 100644 libffi-3.2.1.midipix.patch create mode 100644 patches/binutils-2.24.51.midipix.patch create mode 100644 patches/gdb-7.12.midipix.patch create mode 100644 patches/gmp-5.1.1.midipix.patch create mode 100644 patches/gmp-5.1.3.midipix.patch create mode 100644 patches/libelf-0.8.13.midipix.patch create mode 100644 patches/libffi-3.2.1.midipix.patch diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch deleted file mode 100644 index 928e059..0000000 --- a/binutils-2.24.51.midipix.patch +++ /dev/null @@ -1,1391 +0,0 @@ -diff -ru --new-file a/ld/pe-mdso.c b/ld/pe-mdso.c ---- a/ld/pe-mdso.c 2019-08-14 06:12:57.193333307 -0400 -+++ a/ld/pe-mdso.c 2019-08-17 00:59:46.886167655 -0400 -@@ -0,0 +1,241 @@ -+#include "sysdep.h" -+#include "pe-mdso.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+extern char * program_name; -+extern int xatexit(void (*)(void)); -+ -+static char pe_mdso_tmp_lib_name[] = "/tmp/mdso_XXXXXXXXXXXX"; -+static char pe_perk_tmp_def_name[] = "/tmp/perk_XXXXXXXXXXXX"; -+static struct pe_driver_ctx * pe_dctx; -+ -+struct pe_mdso_lib { -+ dev_t st_dev; -+ ino_t st_ino; -+ char ar_name[24]; -+}; -+ -+struct pe_mdso_lib * pe_mdso_lib_arr; -+struct pe_mdso_lib * pe_mdso_lib_ptr; -+struct pe_mdso_lib * pe_mdso_lib_cap; -+ -+static int pe_mdso_perk_init(void) -+{ -+ char * argv[2]; -+ -+ if (pe_dctx) -+ return 0; -+ -+ argv[0] = program_name; -+ argv[1] = 0; -+ -+ return pe_get_driver_ctx(argv,0,0,0,&pe_dctx); -+} -+ -+static void pe_mdso_cache_unlink(void) -+{ -+ struct pe_mdso_lib * pe_mdso; -+ -+ for (pe_mdso=pe_mdso_lib_arr; pe_mdsoar_name); -+} -+ -+static int pe_mdso_cache_alloc(void) -+{ -+ void * prev; -+ size_t size; -+ size_t nlib; -+ -+ if (pe_mdso_lib_cap > pe_mdso_lib_ptr) -+ return 0; -+ -+ prev = pe_mdso_lib_arr; -+ nlib = pe_mdso_lib_cap - pe_mdso_lib_arr; -+ size = nlib * sizeof(struct pe_mdso_lib); -+ -+ if (!(pe_mdso_lib_arr = calloc(nlib+2,sizeof(struct pe_mdso_lib)))) -+ return -1; -+ -+ if (!prev) -+ xatexit(pe_mdso_cache_unlink); -+ -+ memcpy(pe_mdso_lib_arr,prev,size); -+ -+ pe_mdso_lib_ptr = &pe_mdso_lib_arr[nlib]; -+ pe_mdso_lib_cap = &pe_mdso_lib_arr[nlib+2]; -+ -+ return 0; -+} -+ -+const char * pe_mdso_input_name(const char * input_name) -+{ -+ int fdin; -+ int fdout; -+ char * libname; -+ char * argv[8]; -+ -+ struct stat st; -+ struct pe_mdso_lib * pe_mdso; -+ struct pe_unit_ctx * pe_uctx; -+ struct pe_fd_ctx pe_fdctx; -+ struct mdso_driver_ctx * mdso_dctx; -+ -+ /* perk driver context */ -+ if (pe_mdso_perk_init() < 0) -+ return 0; -+ -+ /* defer when input_name cannot be opened */ -+ if ((fdin = open(input_name,O_RDONLY)) < 0) -+ return input_name; -+ -+ /* stat */ -+ if (fstat(fdin,&st) < 0) { -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ pe_output_error_vector(pe_dctx); -+ return 0; -+ } -+ -+ /* repeated input argument? */ -+ for (pe_mdso=pe_mdso_lib_arr; pe_mdsost_dev == st.st_dev) && (pe_mdso->st_ino == st.st_ino)) { -+ close(fdin); -+ return pe_mdso->ar_name; -+ } -+ } -+ -+ /* defer when perk object/image context cannot be created */ -+ if (pe_get_unit_ctx(pe_dctx,input_name,&pe_uctx) < 0) { -+ close(fdin); -+ return input_name; -+ } -+ -+ /* defer when input file is not an image */ -+ switch (pe_uctx->meta->m_subtype) { -+ case PE_SUBTYPE_DLL: -+ case PE_SUBTYPE_EXE: -+ break; -+ -+ default: -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ return input_name; -+ } -+ -+ /* image bits */ -+ switch (pe_uctx->meta->m_abi) { -+ case PE_ABI_PE32: -+ argv[1] = "-m32"; -+ break; -+ -+ case PE_ABI_PE64: -+ argv[1] = "-m64"; -+ break; -+ -+ default: -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ return 0; -+ } -+ -+ /* perk driver fd context (get) */ -+ if ((pe_get_driver_fdctx(pe_dctx,&pe_fdctx)) < 0) { -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ pe_output_error_vector(pe_dctx); -+ return 0; -+ } -+ -+ /* template init */ -+ memset (&pe_perk_tmp_def_name[10],'X',12); -+ memset (&pe_mdso_tmp_lib_name[10],'X',12); -+ -+ /* perk .def file (create) */ -+ if ((pe_fdctx.fdout = mkstemp(pe_perk_tmp_def_name)) < 0) { -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ pe_output_error_vector(pe_dctx); -+ return 0; -+ } -+ -+ /* perk driver fd context (set) */ -+ if ((pe_set_driver_fdctx(pe_dctx,&pe_fdctx)) < 0) { -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ pe_output_error_vector(pe_dctx); -+ return 0; -+ } -+ -+ /* perk .def file (populate) */ -+ if (pe_output_export_symbols(pe_dctx,pe_uctx->meta) < 0) { -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ pe_output_error_vector(pe_dctx); -+ return 0; -+ }; -+ -+ /* done with perk */ -+ close(fdin); -+ pe_free_unit_ctx(pe_uctx); -+ -+ /* libname */ -+ if ((libname = strrchr(input_name,'/'))) -+ libname++; -+ else if ((libname = strrchr(input_name,'\\'))) -+ libname++; -+ else -+ libname = (char *)input_name; -+ -+ /* cache alloc (as needed) */ -+ if (pe_mdso_cache_alloc() < 0) -+ return 0; -+ -+ /* mdso lib file (create) */ -+ if ((fdout = mkstemp(pe_mdso_tmp_lib_name)) < 0) -+ return 0; -+ -+ /* mdso driver context (argv[1] already set, see above) */ -+ argv[0] = program_name; -+ argv[2] = "--libname"; -+ argv[3] = libname; -+ argv[4] = "--implib"; -+ argv[5] = pe_mdso_tmp_lib_name; -+ argv[6] = pe_perk_tmp_def_name; -+ argv[7] = 0; -+ -+ if (mdso_get_driver_ctx(argv,0,0,0,&mdso_dctx) < 0) { -+ close(fdout); -+ return 0; -+ } -+ -+ /* mdso lib file (generate) */ -+ if (mdso_create_implib_archive(mdso_dctx) < 0) { -+ close(fdout); -+ mdso_output_error_vector(mdso_dctx); -+ mdso_free_driver_ctx(mdso_dctx); -+ return 0; -+ } -+ -+ /* cache */ -+ strcpy(pe_mdso_lib_ptr->ar_name,pe_mdso_tmp_lib_name); -+ -+ pe_mdso_lib_ptr->st_dev = st.st_dev; -+ pe_mdso_lib_ptr->st_ino = st.st_ino; -+ pe_mdso_lib_ptr++; -+ -+ /* all done */ -+ unlink(pe_perk_tmp_def_name); -+ mdso_free_driver_ctx(mdso_dctx); -+ close(fdout); -+ -+ return pe_mdso_tmp_lib_name; -+} -diff -ru --new-file a/bfd/pe-mdso.h b/bfd/pe-mdso.h ---- a/bfd/pe-mdso.h 1969-12-31 19:00:00.000000000 -0500 -+++ b/bfd/pe-mdso.h 2019-08-15 07:00:00.000000000 -0400 -@@ -0,0 +1,10 @@ -+#ifndef PEMDSO_H -+#define PEMDSO_H -+ -+#define PE_DSO_SUFFIX ".so" -+#define PE_DSOLIB_SUFFIX ".dso.a" -+#define PE_IMPLIB_SUFFIX ".lib.a" -+ -+const char * pe_mdso_input_name(const char * input_name); -+ -+#endif -diff --ru --new-file a/ld/ldfile.c b/ld/ldfile.c ---- a/ld/ldfile.c 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/ldfile.c 2019-08-17 11:38:31.062209027 -0400 -@@ -122,6 +122,16 @@ bfd_boolean - ldfile_try_open_bfd (const char *attempt, - lang_input_statement_type *entry) - { -+ -+#ifdef PE_TARGET_MDSO -+ if (!entry->flags.dynamic) { -+ (void)0; -+ } else if (!(attempt = pe_mdso_input_name(attempt))) { -+ fprintf(stderr,"%s: pe_mdso_input_name() returned an error.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+#endif -+ - entry->the_bfd = bfd_openr (attempt, entry->target); - - if (verbose) -diff -ru --new-file a/ld/configure b/ld/configure ---- a/ld/configure 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/configure 2015-03-11 20:01:08.888756786 -0400 -@@ -19773,3 +19773,31 @@ - $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} - fi - -+sed -i -e 's/@pe_executable_name@/'"$PE_EXECUTABLE_NAME"'/g' Makefile -+sed -i -e 's/@pe_framework_libs@/'"$PE_FRAMEWORK_LIBS"'/g' Makefile -+sed -i -e 's/@pe_crt_section@/'"$PE_CRT_SECTION"'/g' Makefile -+sed -i -e 's/@pe_cygwin_fork_support@/'"$PE_CYGWIN_FORK_SUPPORT"'/g' Makefile -+ -+#PE custom import library support -+if [ -f peimplib.h ]; then -+ echo 'build directory is not clean (peimplib.h already exists)' -+ exit 2 -+fi -+ -+touch peimplib.h || exit 2 -+ -+case $target_os in -+ *midipix*) -+ cat >> peimplib.h << EOF -+/* PE target-specific bits, generated by ld/configure */ -+#ifndef PE_TARGET_MIDIPIX -+#define PE_TARGET_MIDIPIX -+#endif -+ -+#ifndef PE_TARGET_MDSO -+#define PE_TARGET_MDSO 1 -+#endif -+ -+#include "pe-mdso.h" -+EOF -+esac -diff --ru --new-file a/ld/sysdep.h b/ld/sysdep.h ---- a/ld/sysdep.h 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/sysdep.h 2019-08-16 03:08:47.771929753 -0400 -@@ -26,6 +26,7 @@ - #endif - - #include "config.h" -+#include "peimplib.h" - - #include - #include -diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em ---- a/ld/emultempl/pe.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pe.em 2019-08-17 11:38:31.062209027 -0400 -@@ -69,6 +69,14 @@ fragment < When linking dynamically to a dll without\n\ -- an importlib, use .dll\n\ -- in preference to lib.dll \n")); -+ an importlib, use "PE_DSO_SUFFIX"\n\ -+ in preference to lib"PE_DSO_SUFFIX" \n")); - fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ - __imp_sym for DATA references\n")); - fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); -@@ -808,6 +822,12 @@ gld${EMULATION_NAME}_handle_option (int optc) - case OPTION_IMPLIB_FILENAME: - pe_implib_filename = xstrdup (optarg); - break; -+ case OPTION_DSOLIB_FILENAME: -+ pe_dsolib_filename = xstrdup (optarg); -+ break; -+ case OPTION_DSOLIB_LOADER_PATH: -+ pe_dsolib_loader_path = xstrdup (optarg); -+ break; - case OPTION_WARN_DUPLICATE_EXPORTS: - pe_dll_warn_dup_exports = 1; - break; -@@ -1698,7 +1718,7 @@ gld_${EMULATION_NAME}_after_open (void) - extension, and use that for the remainder of the - comparisons. */ - pnt = strrchr (is3->the_bfd->filename, '.'); -- if (pnt != NULL && filename_cmp (pnt, ".dll") == 0) -+ if (pnt != NULL && filename_cmp (pnt, PE_DSO_SUFFIX) == 0) - break; - } - -@@ -1733,7 +1753,7 @@ gld_${EMULATION_NAME}_after_open (void) - then leave the filename alone. */ - pnt = strrchr (is->the_bfd->filename, '.'); - -- if (is_ms_arch && (filename_cmp (pnt, ".dll") == 0)) -+ if (is_ms_arch && (filename_cmp (pnt, PE_DSO_SUFFIX) == 0)) - { - int idata2 = 0, reloc_count=0; - asection *sec; -@@ -2063,8 +2083,14 @@ gld_${EMULATION_NAME}_finish (void) - ) - { - pe_dll_fill_sections (link_info.output_bfd, &link_info); -+ -+ /* generate legacy implib? */ - if (pe_implib_filename) - pe_dll_generate_implib (pe_def_file, pe_implib_filename, &link_info); -+ -+ /* generate mdso implib? */ -+ if (pe_dsolib_filename) -+ pe_dll_generate_dsolib (pe_def_file, 0, pe_dsolib_filename, pe_dsolib_loader_path, 32); - } - #if defined(TARGET_IS_shpe) - /* ARM doesn't need relocs. */ -@@ -2298,16 +2324,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive - } - libname_fmt [] = - { -+ /* optionally support ldso-specific import libraries */ -+ #ifdef PE_TARGET_MDSO -+ { "lib%s"PE_DSOLIB_SUFFIX, FALSE }, -+ #endif - /* Preferred explicit import library for dll's. */ -- { "lib%s.dll.a", FALSE }, -+ { "lib%s"PE_IMPLIB_SUFFIX, FALSE }, - /* Alternate explicit import library for dll's. */ -- { "%s.dll.a", FALSE }, -+ { "%s"PE_IMPLIB_SUFFIX, FALSE }, -+#ifdef PE_TARGET_MDSO -+ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ -+ { "lib%s"PE_DSO_SUFFIX, FALSE }, -+#endif - /* "libfoo.a" could be either an import lib or a static lib. - For backwards compatibility, libfoo.a needs to precede - libfoo.dll and foo.dll in the search. */ - { "lib%s.a", FALSE }, - /* The 'native' spelling of an import lib name is "foo.lib". */ - { "%s.lib", FALSE }, -+#ifndef PE_TARGET_MDSO - #ifdef DLL_SUPPORT - /* Try "foo.dll" (preferred dll name, if specified). */ - { "%s%s.dll", TRUE }, -@@ -2316,6 +2351,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive - { "lib%s.dll", FALSE }, - /* Finally try 'native' dll name "foo.dll". */ - { "%s.dll", FALSE }, -+#endif - /* Note: If adding more formats to this table, make sure to check to - see if their length is longer than libname_fmt[0].format, and if - so, update the call to xmalloc() below. */ -diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em ---- a/ld/emultempl/pep.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pep.em 2019-08-17 11:38:31.062209027 -0400 -@@ -67,6 +67,14 @@ fragment < When linking dynamically to a dll without\n\ -- an importlib, use .dll\n\ -- in preference to lib.dll \n")); -+ an importlib, use "PE_DSO_SUFFIX"\n\ -+ in preference to lib"PE_DSO_SUFFIX" \n")); - fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ - __imp_sym for DATA references\n")); - fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); -@@ -760,6 +774,12 @@ gld${EMULATION_NAME}_handle_option (int optc) - case OPTION_IMPLIB_FILENAME: - pep_implib_filename = xstrdup (optarg); - break; -+ case OPTION_DSOLIB_FILENAME: -+ pep_dsolib_filename = xstrdup (optarg); -+ break; -+ case OPTION_DSOLIB_LOADER_PATH: -+ pep_dsolib_loader_path = xstrdup (optarg); -+ break; - case OPTION_WARN_DUPLICATE_EXPORTS: - pep_dll_warn_dup_exports = 1; - break; -@@ -1635,7 +1655,7 @@ gld_${EMULATION_NAME}_after_open (void) - extension, and use that for the remainder of the - comparisons. */ - pnt = strrchr (is3->the_bfd->filename, '.'); -- if (pnt != NULL && filename_cmp (pnt, ".dll") == 0) -+ if (pnt != NULL && filename_cmp (pnt, PE_DSO_SUFFIX) == 0) - break; - } - -@@ -1670,7 +1690,7 @@ gld_${EMULATION_NAME}_after_open (void) - then leave the filename alone. */ - pnt = strrchr (is->the_bfd->filename, '.'); - -- if (is_ms_arch && (filename_cmp (pnt, ".dll") == 0)) -+ if (is_ms_arch && (filename_cmp (pnt, PE_DSO_SUFFIX) == 0)) - { - int idata2 = 0, reloc_count=0; - asection *sec; -@@ -1834,8 +1854,14 @@ gld_${EMULATION_NAME}_finish (void) - || (!link_info.relocatable && pep_def_file->num_exports != 0)) - { - pep_dll_fill_sections (link_info.output_bfd, &link_info); -+ -+ /* generate legacy implib? */ - if (pep_implib_filename) - pep_dll_generate_implib (pep_def_file, pep_implib_filename, &link_info); -+ -+ /* generate mdso implib? */ -+ if (pep_dsolib_filename) -+ pep_dll_generate_dsolib (pep_def_file, 0, pep_dsolib_filename, pep_dsolib_loader_path, 64); - } - - if (pep_out_def_filename) -@@ -2062,16 +2088,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive - } - libname_fmt [] = - { -+ /* optionally support ldso-specific import libraries */ -+#ifdef PE_TARGET_MDSO -+ { "lib%s"PE_DSOLIB_SUFFIX, FALSE }, -+#endif - /* Preferred explicit import library for dll's. */ -- { "lib%s.dll.a", FALSE }, -+ { "lib%s"PE_IMPLIB_SUFFIX, FALSE }, - /* Alternate explicit import library for dll's. */ -- { "%s.dll.a", FALSE }, -+ { "%s"PE_IMPLIB_SUFFIX, FALSE }, -+#ifdef PE_TARGET_MDSO -+ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ -+ { "lib%s"PE_DSO_SUFFIX, FALSE }, -+#endif - /* "libfoo.a" could be either an import lib or a static lib. - For backwards compatibility, libfoo.a needs to precede - libfoo.dll and foo.dll in the search. */ - { "lib%s.a", FALSE }, - /* The 'native' spelling of an import lib name is "foo.lib". */ - { "%s.lib", FALSE }, -+#ifndef PE_TARGET_MDSO - #ifdef DLL_SUPPORT - /* Try "foo.dll" (preferred dll name, if specified). */ - { "%s%s.dll", TRUE }, -@@ -2080,6 +2115,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive - { "lib%s.dll", FALSE }, - /* Finally try 'native' dll name "foo.dll". */ - { "%s.dll", FALSE }, -+#endif - /* Note: If adding more formats to this table, make sure to check to - see if their length is longer than libname_fmt[0].format, and if - so, update the call to xmalloc() below. */ -diff -ru --new-file a/ld/configure.tgt b/ld/configure.tgt ---- a/ld/configure.tgt 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/configure.tgt 2019-08-15 06:52:04.192983142 -0400 -@@ -319,6 +319,12 @@ - test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; - i[3-7]86-*-mingw32*) targ_emul=i386pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" ;; -+i[3-7]86-*-midipix*) targ_emul=i386pe ; -+ targ_extra_ofiles="deffilep.o pe-dll.o pe-mdso.o" ; -+ PE_FRAMEWORK_LIBS="-lperk -lmdso" ; -+ PE_EXECUTABLE_NAME=a.out ; -+ PE_CRT_SECTION=no ; -+ PE_CYGWIN_FORK_SUPPORT=no ;; - x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ; - targ_extra_emuls=i386pe ; - targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; -@@ -329,7 +335,14 @@ - x86_64-*-mingw*) targ_emul=i386pep ; - targ_extra_emuls=i386pe - targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; --i[3-7]86-*-interix*) targ_emul=i386pe_posix; -+x86_64-*-midipix*) targ_emul=i386pep ; -+ targ_extra_emuls=i386pe ; -+ targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o pe-mdso.o" ; -+ PE_FRAMEWORK_LIBS="-lperk -lmdso" ; -+ PE_EXECUTABLE_NAME=a.out ; -+ PE_CRT_SECTION=no ; -+ PE_CYGWIN_FORK_SUPPORT=no ;; -+i[3-7]86-*-interix*) targ_emul=i386pe_posix ; - targ_extra_ofiles="deffilep.o pe-dll.o" ;; - i[3-7]86-*-beospe*) targ_emul=i386beos ;; - i[3-7]86-*-beos*) targ_emul=elf_i386_be ;; -@@ -825,6 +838,10 @@ - *-*-linux*) - ;; - -+*-*-midipix*) -+ NATIVE_LIB_DIRS= -+ ;; -+ - *-*-netbsd*) - ;; - -diff -ru --new-file a/ld/Makefile.in b/ld/Makefile.in ---- a/ld/Makefile.in 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/Makefile.in 2019-08-15 05:53:23.807970635 -0400 -@@ -54,6 +54,10 @@ - host_triplet = @host@ - target_triplet = @target@ - bin_PROGRAMS = ld-new$(EXEEXT) -+PE_EXECUTABLE_NAME = @pe_executable_name@ -+PE_FRAMEWORK_LIBS = @pe_framework_libs@ -+PE_CRT_SECTION = @pe_crt_section@ -+PE_CYGWIN_FORK_SUPPORT = @pe_cygwin_fork_support@ - - # Automake 1.9 will only build info files in the objdir if they are - # mentioned in DISTCLEANFILES. It doesn't have to be unconditional, -@@ -831,7 +835,7 @@ - POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES) - - # These all start with e so 'make clean' can find them. --GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ -+GENSCRIPTS = EXECUTABLE_NAME='${PE_EXECUTABLE_NAME}' PE_FRAMEWORK_LIBS='${PE_FRAMEWORK_LIBS}' PE_CRT_SECTION='${PE_CRT_SECTION}' PE_CYGWIN_FORK_SUPPORT='${PE_CYGWIN_FORK_SUPPORT}' LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ - GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed - ELF_DEPS = $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/scripttempl/DWARF.sc - ELF_GEN_DEPS = $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/emultempl/genelf.em $(srcdir)/scripttempl/DWARF.sc -@@ -1032,7 +1036,7 @@ - else :; fi - ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) - @rm -f ld-new$(EXEEXT) -- $(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) -+ $(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) $(PE_FRAMEWORK_LIBS) - - mostlyclean-compile: - -rm -f *.$(OBJEXT) -@@ -3411,16 +3415,16 @@ - ld-partial.@OBJEXT@: ld-new$(EXEEXT) - ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES) - ld1$(EXEEXT): ld-partial.@OBJEXT@ -- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) -+ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) - - ld1-full$(EXEEXT): ld-new -- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) -+ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) - - ld2$(EXEEXT): ld1$(EXEEXT) -- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) -+ ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) - - ld3$(EXEEXT): ld2$(EXEEXT) -- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) -+ ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) - - bootstrap: ld3$(EXEEXT) - cmp ld2$(EXEEXT) ld3$(EXEEXT) -diff -ru --new-file a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc ---- a/ld/scripttempl/pep.sc 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/scripttempl/pep.sc 2015-03-11 20:10:05.324773952 -0400 -@@ -92,12 +92,17 @@ - ${RELOCATING+ *(.gcc_except_table)} - } - -+EOF -+if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF - /* The Cygwin32 library uses a section to avoid copying certain data - on fork. This used to be named ".data$nocopy". The linker used - to include this between __data_start__ and __data_end__, but that - breaks building the cygwin32 dll. Instead, we name the section - ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ - -+EOF -+fi -+cat << EOF - .data ${RELOCATING+BLOCK(__section_alignment__)} : - { - ${RELOCATING+__data_start__ = . ;} -@@ -106,7 +111,12 @@ - ${R_DATA} - *(.jcr) - ${RELOCATING+__data_end__ = . ;} -+EOF -+if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF - ${RELOCATING+*(.data_cygwin_nocopy)} -+EOF -+fi -+cat << EOF - } - - .rdata ${RELOCATING+BLOCK(__section_alignment__)} : -@@ -170,6 +180,8 @@ - ${RELOCATING+__IAT_end__ = .;} - ${R_IDATA67} - } -+EOF -+if [ x"$PE_CRT_SECTION" != xno ]; then cat << EOF - .CRT ${RELOCATING+BLOCK(__section_alignment__)} : - { - ${RELOCATING+___crt_xc_start__ = . ;} -@@ -188,6 +200,9 @@ - ${R_CRT_XT} - ${RELOCATING+___crt_xt_end__ = . ;} - } -+EOF -+fi -+cat << EOF - - /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be - at the end of the .tls section. This is important because _tls_start MUST -diff -ru --new-file a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc ---- a/ld/scripttempl/pe.sc 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/scripttempl/pe.sc 2015-03-11 20:10:10.036774102 -0400 -@@ -92,12 +92,17 @@ - ${RELOCATING+ *(.gcc_except_table)} - } - -+EOF -+if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF - /* The Cygwin32 library uses a section to avoid copying certain data - on fork. This used to be named ".data$nocopy". The linker used - to include this between __data_start__ and __data_end__, but that - breaks building the cygwin32 dll. Instead, we name the section - ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ - -+EOF -+fi -+cat << EOF - .data ${RELOCATING+BLOCK(__section_alignment__)} : - { - ${RELOCATING+__data_start__ = . ;} -@@ -106,7 +111,12 @@ - ${R_DATA} - *(.jcr) - ${RELOCATING+__data_end__ = . ;} -+EOF -+if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF - ${RELOCATING+*(.data_cygwin_nocopy)} -+EOF -+fi -+cat << EOF - } - - .rdata ${RELOCATING+BLOCK(__section_alignment__)} : -@@ -165,6 +175,8 @@ - ${RELOCATING+__IAT_end__ = .;} - ${R_IDATA67} - } -+EOF -+if [ x"$PE_CRT_SECTION" != xno ]; then cat << EOF - .CRT ${RELOCATING+BLOCK(__section_alignment__)} : - { - ${RELOCATING+___crt_xc_start__ = . ;} -@@ -183,6 +195,9 @@ - ${R_CRT_XT} - ${RELOCATING+___crt_xt_end__ = . ;} - } -+EOF -+fi -+cat << EOF - - /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be - at the end of section. This is important because _tls_start MUST -diff -ru --new-file a/binutils/winduni.c b/binutils/winduni.c ---- a/binutils/winduni.c 2014-07-03 01:37:23.000000000 -0400 -+++ b/binutils/winduni.c 2015-02-14 11:18:32.987163288 -0500 -@@ -57,7 +57,7 @@ - /* Codepages mapped. */ - static local_iconv_map codepages[] = - { -- { 0, "MS-ANSI" }, -+ { 0, "cp1252" }, - { 1, "WINDOWS-1252" }, - { 437, "MS-ANSI" }, - { 737, "MS-GREEK" }, -diff -ru a/ld/pe-dll.c b/ld/pe-dll.c ---- a/ld/pe-dll.c 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/pe-dll.c 2019-06-30 22:22:22.643202346 -0400 -@@ -27,6 +27,7 @@ - #include "safe-ctype.h" - - #include -+#include - - #include "ld.h" - #include "ldexp.h" -@@ -40,6 +41,7 @@ - #include "coff/internal.h" - #include "../bfd/libcoff.h" - #include "deffile.h" -+#include "peimplib.h" - - #ifdef pe_use_x86_64 - -@@ -234,7 +236,11 @@ - { STRING_COMMA_LEN ("impure_ptr") }, - { STRING_COMMA_LEN ("_impure_ptr") }, - { STRING_COMMA_LEN ("_fmode") }, -+ #ifdef PE_TARGET_MIDIPIX -+ /* (default) excluded symbols are defined by the caller (specs, etc.) */ -+ #else - { STRING_COMMA_LEN ("environ") }, -+ #endif - { NULL, 0 } - }; - -@@ -644,10 +650,13 @@ - { - int i, j; - struct bfd_link_hash_entry *blhe; -+ struct bfd_link_hash_entry *blhew; - bfd *b; - struct bfd_section *s; - def_file_export *e = 0; - bfd_boolean resort_needed; -+ char *weaksym; -+ char *objsym; - - if (!pe_def_file) - pe_def_file = def_file_empty (); -@@ -737,6 +746,16 @@ - if (is_import (sn)) - continue; - -+ if (!strncmp (sn, ".weak.", 6) && strchr (sn + 6, '.')) -+ { -+ objsym = strdup (sn); -+ weaksym = strdup (sn + 6); -+ *(strchr (weaksym, '.')) = '\0'; -+ sn = weaksym; -+ } -+ else -+ weaksym = 0; -+ - name = xmalloc (strlen ("__imp_") + strlen (sn) + 1); - sprintf (name, "%s%s", "__imp_", sn); - -@@ -745,7 +764,9 @@ - free (name); - - if (blhe && blhe->type == bfd_link_hash_defined) -- continue; -+ if (strncmp (blhe->u.def.section->name, ".got$", 5)) -+ if (strncmp (blhe->u.def.section->name, ".dsosyms$", 9)) -+ continue; - } - - if (pe_details->underscored && *sn == '_') -@@ -756,12 +777,30 @@ - int is_dup = 0; - def_file_export *p; - -- p = def_file_add_export (pe_def_file, sn, 0, -1, -- NULL, &is_dup); -- /* Fill data flag properly, from dlltool.c. */ -- if (!is_dup) -- p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); -- } -+ if (weaksym) { -+ blhew = bfd_link_hash_lookup (info->hash, weaksym, -+ FALSE, FALSE, FALSE); -+ } -+ -+ if (!weaksym || blhew) { -+ p = def_file_add_export (pe_def_file, sn, 0, -1, -+ NULL, &is_dup); -+ -+ /* Fill data flag properly, from dlltool.c. */ -+ if (!is_dup) -+ p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); -+ -+ if (weaksym) { -+ if (blhew->type != bfd_link_hash_defined) { -+ free (p->internal_name); -+ p->internal_name = objsym; -+ } -+ } -+ -+ if (weaksym) -+ free (weaksym); -+ } -+ } - } - } - } -@@ -910,6 +949,7 @@ - - if (blhe - && (blhe->type == bfd_link_hash_defined -+ || (blhe->type == bfd_link_hash_defweak) - || (blhe->type == bfd_link_hash_common))) - { - count_exported++; -@@ -919,7 +959,7 @@ - /* Only fill in the sections. The actual offsets are computed - in fill_exported_offsets() after common symbols are laid - out. */ -- if (blhe->type == bfd_link_hash_defined) -+ if ((blhe->type == bfd_link_hash_defined) || (blhe->type == bfd_link_hash_defweak)) - exported_symbol_sections[i] = blhe->u.def.section; - else - exported_symbol_sections[i] = blhe->u.c.p->section; -@@ -2688,6 +2728,160 @@ - } - - -+ -+ -+void -+pe_dll_generate_dsolib( -+ def_file * def, -+ const char ** expsyms, -+ const char * dsolib_file_name, -+ const char * loader_path, -+ unsigned char bits) -+{ -+ char * mdso_exe_path; -+ char * slash; -+ char * mark; -+ FILE * fout; -+ char * argv[10]; -+ int fd[2]; -+ int pid; -+ int rpid; -+ int ecode; -+ int i; -+ -+ /* sigh; even though pe_dll_generate_implib() might fail, */ -+ /* ld's _finish() code path assumes no errors could occur */ -+ /* and accordingly does not perform any checks upon return. */ -+ /* handle errors here and invoke xexit() as needed. */ -+ -+ /* bits */ -+ if ((bits != 32) && (bits != 64)) { -+ fprintf(stderr,"%s: internal error (bits == %d.\n",program_name,bits); -+ xexit(EXIT_FAILURE); -+ } -+ -+ /* mdso_exe_path buffer alloc */ -+ if (!(mdso_exe_path = calloc(1,strlen(program_name) + strlen("mdso") + 1))) { -+ fprintf(stderr,"%s: cannot allocate mdso_exe_path buffer.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ /* mdso_exe_path init */ -+ strcpy(mdso_exe_path,program_name); -+ -+ if ((slash = strrchr(mdso_exe_path,'/'))) -+ slash++; -+ else -+ slash = mdso_exe_path; -+ -+ if ((mark = strrchr(slash,'-'))) -+ mark++; -+ else -+ mark = slash; -+ -+ sprintf(mark,"%s","mdso"); -+ -+ /* pipe */ -+ if (pipe(fd)) { -+ fprintf(stderr,"%s: cannot create a pipe.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ /* fout init */ -+ if (!(fout = fdopen(fd[1],"a"))) { -+ fprintf(stderr,"%s: pipe fdopen failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ /* fork */ -+ if ((pid = fork()) < 0) { -+ fprintf(stderr,"%s: fork failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ /* child: execvp */ -+ if (pid == 0) { -+ argv[0] = mdso_exe_path; -+ argv[1] = (bits == 64) ? "-m64" : "-m32"; -+ argv[2] = "--implib"; -+ argv[3] = (char *)dsolib_file_name; -+ argv[4] = "--libname"; -+ argv[5] = (def->name) ? def->name : (char *)dll_name; -+ -+ if (loader_path) { -+ argv[6] = "--libpath"; -+ argv[7] = (char *)loader_path; -+ argv[8] = "-"; -+ argv[9] = 0; -+ } else { -+ argv[6] = "-"; -+ argv[7] = 0; -+ } -+ -+ fclose(fout); -+ close(fd[1]); -+ close(0); -+ -+ if (dup(fd[0]) == 0) -+ execvp(mdso_exe_path,argv); -+ -+ exit(EXIT_FAILURE); -+ } -+ -+ /* be good */ -+ free(mdso_exe_path); -+ -+ /* parent: expsyms --> pipe */ -+ if (expsyms) { -+ for (; *expsyms; ) { -+ if (fprintf(fout,"%s\n",*expsyms++) < 0) { -+ fprintf(stderr,"%s: pipe write operation failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ } -+ } else { -+ for (i=0; i < def->num_exports; i++) { -+ if (!(pe_def_file->exports[i].flag_private)) { -+ if (fprintf(fout,"%s\n",def->exports[i].name) < 0) { -+ fprintf(stderr,"%s: pipe write operation failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ } -+ } -+ } -+ -+ if (fflush(fout) < 0) { -+ fprintf(stderr,"%s: pipe fflush operation failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ fclose(fout); -+ close(fd[0]); -+ -+ /* obtain child exit status */ -+ if ((rpid = waitpid(pid,&ecode,0)) < 0) { -+ fprintf(stderr,"%s: waitpid operation failed.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ if (rpid != pid) { -+ fprintf(stderr,"%s: waitpid returned an unexpected pid.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ if (!(WIFEXITED(ecode))) { -+ fprintf(stderr,"%s: waitpid reported abnormal child process termination.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+ -+ if (WEXITSTATUS(ecode)) { -+ fprintf(stderr,"%s: the child process returned an error.\n",program_name); -+ xexit(EXIT_FAILURE); -+ } -+} -+ -+ -+ - void - pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_info *info) - { -diff -ru a/ld/pe-dll.h b/ld/pe-dll.h ---- a/ld/pe-dll.h 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/pe-dll.h 2017-10-14 20:01:45.817295022 -0400 -@@ -49,6 +49,8 @@ - (const char *); - extern void pe_dll_generate_implib - (def_file *, const char *, struct bfd_link_info *); -+extern void pe_dll_generate_dsolib -+ (def_file *, const char **, const char *, const char *, unsigned char); - extern void pe_process_import_defs - (bfd *, struct bfd_link_info *); - extern bfd_boolean pe_implied_import_dll -diff -ru a/ld/pep-dll.c b/ld/pep-dll.c ---- a/ld/pep-dll.c 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/pep-dll.c 2017-10-14 10:14:35.490521636 -0400 -@@ -54,6 +54,7 @@ - #define pe_dll_fill_sections pep_dll_fill_sections - #define pe_exe_fill_sections pep_exe_fill_sections - #define pe_dll_generate_implib pep_dll_generate_implib -+#define pe_dll_generate_dsolib pep_dll_generate_dsolib - #define pe_dll_add_excludes pep_dll_add_excludes - #define pe_walk_relocs_of_symbol pep_walk_relocs_of_symbol - #define pe_bfd_is_dll pep_bfd_is_dll -diff -ru a/ld/pep-dll.h b/ld/pep-dll.h ---- a/ld/pep-dll.h 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/pep-dll.h 2017-10-14 19:17:26.885792850 -0400 -@@ -46,6 +46,7 @@ - extern void pep_dll_add_excludes (const char *, const exclude_type); - extern void pep_dll_generate_def_file (const char *); - extern void pep_dll_generate_implib (def_file *, const char *, struct bfd_link_info *); -+extern void pep_dll_generate_dsolib (def_file *, const char **, const char *, const char *, unsigned char); - extern void pep_process_import_defs (bfd *, struct bfd_link_info *); - extern bfd_boolean pep_implied_import_dll (const char *); - extern void pep_dll_build_sections (bfd *, struct bfd_link_info *); -diff -ru --new-file a/bfd/config.bfd b/bfd/config.bfd ---- a/bfd/config.bfd 2014-07-03 01:37:20.000000000 -0400 -+++ b/bfd/config.bfd 2015-02-14 11:27:08.199179775 -0500 -@@ -679,7 +679,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" - want64=true -@@ -731,7 +731,7 @@ - targ_defvec=i386_elf32_vec - targ_selvecs=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" - targ_underscore=yes -diff -ru --new-file a/binutils/configure b/binutils/configure ---- a/binutils/configure 2014-07-03 01:37:22.000000000 -0400 -+++ b/binutils/configure 2015-09-13 21:35:09.738957435 -0400 -@@ -14015,7 +14015,7 @@ - BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' - BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' - ;; -- x86_64-*-mingw* | x86_64-*-cygwin*) -+ x86_64-*-mingw* | x86_64-*-midipix* | x86_64-*-cygwin*) - BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' - if test -z "$DLLTOOL_DEFAULT"; then - DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" -@@ -14025,7 +14025,7 @@ - BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' - BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' - ;; -- i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) -+ i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-midipix* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) - BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' - if test -z "$DLLTOOL_DEFAULT"; then - DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" -diff -ru --new-file a/configure b/configure ---- a/configure 2014-07-03 01:37:23.000000000 -0400 -+++ b/configure 2015-03-11 17:07:15.820422926 -0400 -@@ -3428,6 +3428,9 @@ - x86_64-*-mingw*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-midipix*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - mmix-*-*) - noconfigdirs="$noconfigdirs target-libffi target-boehm-gc" - ;; -@@ -3549,6 +3552,9 @@ - *-*-mingw*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-midipix*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-netbsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -6257,7 +6263,7 @@ - - target_elf=no - case $target in -- *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ -+ *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-midipix* | *-aout* | *-*coff* | \ - *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \ - alpha*-dec-osf* | *-interix* | hppa[12]*-*-hpux*) - target_elf=no -diff -ru --new-file a/gas/configure.tgt b/gas/configure.tgt ---- a/gas/configure.tgt 2014-07-03 01:37:25.000000000 -0400 -+++ b/gas/configure.tgt 2015-02-14 11:27:08.223179776 -0500 -@@ -262,7 +262,7 @@ - i*) fmt=coff em=pe ;; - esac ;; - i386-*-interix*) fmt=coff em=interix ;; -- i386-*-mingw*) -+ i386-*-mingw* | i386-*-midipix*) - case ${cpu} in - x86_64*) fmt=coff em=pep ;; - i*) fmt=coff em=pe ;; -diff -ru a/bfd/cofflink.c b/bfd/cofflink.c ---- a/bfd/cofflink.c 2014-07-03 01:37:20.000000000 -0400 -+++ b/bfd/cofflink.c 2015-06-13 20:22:46.000389638 -0400 -@@ -202,6 +202,7 @@ - bfd_size_type symesz; - bfd_byte *esym; - bfd_byte *esym_end; -+ char *weaksym; - - *pneeded = FALSE; - -@@ -236,6 +237,16 @@ - && CONST_STRNEQ (name, "__imp_")) - h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); - -+ if (!h && !strncmp (name, ".weak.", 6) && strchr (name + 6, '.')) -+ { -+ weaksym = strdup (name + 6); -+ *(strchr (weaksym, '.')) = '\0'; -+ h = bfd_link_hash_lookup (info->hash, weaksym, FALSE, FALSE, TRUE); -+ name = weaksym; -+ } -+ else -+ weaksym = 0; -+ - /* We are only interested in symbols that are currently - undefined. If a symbol is currently known to be common, - COFF linkers do not bring in an object file which defines -@@ -249,6 +260,9 @@ - *pneeded = TRUE; - return TRUE; - } -+ -+ if (weaksym) -+ free (weaksym); - } - - esym += (sym.n_numaux + 1) * symesz; -@@ -320,6 +334,7 @@ - bfd_byte *esym; - bfd_byte *esym_end; - bfd_size_type amt; -+ char *weaksym; - - symcount = obj_raw_syment_count (abfd); - -@@ -476,6 +491,20 @@ - addit = FALSE; - } - -+ if (!strncmp (name, ".weak.", 6) && strchr (name + 6, '.')) -+ { -+ if (! (bfd_coff_link_add_one_symbol -+ (info, abfd, name, flags, section, value, -+ (const char *) NULL, copy, FALSE, -+ (struct bfd_link_hash_entry **) sym_hash))) -+ goto error_return; -+ -+ weaksym = strdup (name + 6); -+ *(strchr(weaksym, '.')) = 0; -+ name = weaksym; -+ flags |= BSF_WEAK; -+ } -+ - if (addit) - { - if (! (bfd_coff_link_add_one_symbol -diff -ru a/bfd/linker.c b/bfd/linker.c ---- a/bfd/linker.c 2014-07-03 01:37:21.000000000 -0400 -+++ b/bfd/linker.c 2015-06-06 17:51:24.148275212 -0400 -@@ -1050,6 +1050,7 @@ - struct archive_hash_table arsym_hash; - unsigned int indx; - struct bfd_link_hash_entry **pundef; -+ char *weaksym; - - if (! bfd_has_map (abfd)) - { -@@ -1073,6 +1074,13 @@ - struct archive_hash_entry *arh; - struct archive_list *l, **pp; - -+ if (!strncmp (arsym->name, ".weak.", 6) && strchr (arsym->name + 6, '.')) -+ { -+ weaksym = strdup (arsym->name + 6); -+ *(strchr (weaksym, '.')) = '\0'; -+ arsym->name = weaksym; -+ } -+ - arh = archive_hash_lookup (&arsym_hash, arsym->name, TRUE, FALSE); - if (arh == NULL) - goto error_return; -diff -ru a/gas/config/tc-i386.c b/gas/config/tc-i386.c ---- a/gas/config/tc-i386.c 2014-07-03 01:37:25.000000000 -0400 -+++ b/gas/config/tc-i386.c 2015-06-12 22:40:37.100250091 -0400 -@@ -9148,25 +9148,6 @@ - value += md_pcrel_from (fixP); - #endif - } --#if defined (OBJ_COFF) && defined (TE_PE) -- if (fixP->fx_addsy != NULL -- && S_IS_WEAK (fixP->fx_addsy) -- /* PR 16858: Do not modify weak function references. */ -- && ! fixP->fx_pcrel) -- { --#if !defined (TE_PEP) -- /* For x86 PE weak function symbols are neither PC-relative -- nor do they set S_IS_FUNCTION. So the only reliable way -- to detect them is to check the flags of their containing -- section. */ -- if (S_GET_SEGMENT (fixP->fx_addsy) != NULL -- && S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_CODE) -- ; -- else --#endif -- value -= S_GET_VALUE (fixP->fx_addsy); -- } --#endif - - /* Fix a few things - the dynamic linker expects certain values here, - and we must not disappoint it. */ -@@ -9237,8 +9218,11 @@ - fixP->fx_done = 0; - /* Remember value for tc_gen_reloc. */ - fixP->fx_addnumber = value; -- /* Clear out the frag for now. */ -- value = 0; -+ /* for data symbols, cancel the effect of the relocation */ -+ if (!((S_GET_SEGMENT (fixP->fx_addsy)->flags) & SEC_CODE)) -+ value = -S_GET_VALUE (fixP->fx_addsy); -+ else -+ value = 0; - } - #endif - else if (use_rela_relocations) - ---- a/binutils/rename.c 2014-07-03 01:37:22.000000000 -0400 -+++ b/binutils/rename.c 2015-11-25 23:13:38.086948592 -0500 -@@ -167,7 +167,10 @@ - && s.st_nlink == 1) - ) - { -- ret = rename (from, to); -+ if ((ret = rename (from, to))) -+ if (!(ret = simple_copy (from, to))) -+ unlink (from); -+ - if (ret == 0) - { - if (exists) diff --git a/config.cache b/config.cache deleted file mode 100644 index 2910ce7..0000000 --- a/config.cache +++ /dev/null @@ -1,166 +0,0 @@ -# autoconf -ac_cv_buggy_getaddrinfo=no -ac_cv_func_calloc_0_nonnull=yes -ac_cv_func_chown_works=yes -ac_cv_func_getgroups_works=yes -ac_cv_func_malloc_0_nonnull=yes -ac_cv_func_strnlen_working=yes -ac_cv_func_mmap_fixed_mapped=yes -ac_cv_func_strcoll_works=yes -ac_cv_func_working_mktime=yes -ac_cv_file__dev_ptmx=yes -ac_cv_file__dev_ptc=no -gt_cv_int_divbyzero_sigfpe=yes - -# gnulib -gl_cv_func_cbrtl_ieee=yes -gl_cv_func_ceilf_ieee=yes -gl_cv_func_ceil_ieee=yes -gl_cv_func_ceill_ieee=yes -gl_cv_func_chown_ctime_works=yes -gl_cv_func_chown_slash_works=yes -gl_cv_func_exp2l_ieee=yes -gl_cv_func_expm1_ieee=yes -gl_cv_func_fcntl_f_dupfd_works=yes -gl_cv_func_fdopendir_works=yes -gl_cv_func_floorf_ieee=yes -gl_cv_func_fflush_stdin=yes -gl_cv_func_fmaf_works=yes -gl_cv_func_fmal_works=yes -gl_cv_func_fma_works=yes -gl_cv_func_fmodf_ieee=yes -gl_cv_func_fmod_ieee=yes -gl_cv_func_fmodl_ieee=yes -gl_cv_func_fpurge_works=yes -gl_cv_func_fseeko=yes -gl_cv_func_futimens_works=yes -gl_cv_func_futimesat_works=yes -gl_cv_func_getgroups_works=yes -gl_cv_func_gettimeofday_clobber=no -gl_cv_func_hypotf_ieee=yes -gl_cv_func_hypotl_ieee=yes -gl_cv_func_hypot_ieee=yes -gl_cv_func_isfinitel_works=yes -gl_cv_func_isnanl_works=yes -gl_cv_func_linkat_slash=yes -gl_cv_func_link_works=yes -gl_cv_func_log10f_ieee=yes -gl_cv_func_log10_ieee=yes -gl_cv_func_log1pf_ieee=yes -gl_cv_func_log1p_ieee=yes -gl_cv_func_log1pl_ieee=yes -gl_cv_func_log2f_ieee=yes -gl_cv_func_log2_ieee=yes -gl_cv_func_logf_ieee=yes -gl_cv_func_log_ieee=yes -gl_cv_func_lstat_dereferences_slashed_symlink=yes -gl_cv_func_mbrlen_empty_input=yes -gl_cv_func_mbrtowc_empty_input=yes -gl_cv_func_memchr_works=yes -gl_cv_func_memmem_works_fast=yes -gl_cv_func_mkdir_trailing_dot_works=yes -gl_cv_func_mkdir_trailing_slash_works=yes -gl_cv_func_mkfifo_works=yes -gl_cv_func_mknod_works=yes -gl_cv_func_modff_ieee=yes -gl_cv_func_modf_ieee=yes -gl_cv_func_modfl_ieee=yes -gl_cv_func_nanosleep=yes -gl_cv_func_open_directory_works=yes -gl_cv_func_perror_works=yes -gl_cv_func_printf_directive_a=yes -gl_cv_func_printf_directive_f=yes -gl_cv_func_printf_directive_n=yes -gl_cv_func_printf_enomem=yes -gl_cv_func_printf_flag_zero=yes -gl_cv_func_printf_infinite_long_double=yes -gl_cv_func_printf_infinite=yes -gl_cv_func_printf_sizes_c99=yes -gl_cv_func_pselect_detects_ebadf=yes -gl_cv_func_ptsname_sets_errno=yes -gl_cv_func_readlink_works=yes -gl_cv_func_realpath_works=yes -gl_cv_func_remainderf_ieee=yes -gl_cv_func_remainder_ieee=yes -gl_cv_func_remainderl_ieee=yes -gl_cv_func_rename_dest_works=yes -gl_cv_func_rename_link_works=yes -gl_cv_func_rename_slash_dst_works=yes -gl_cv_func_rename_slash_src_works=yes -gl_cv_func_rmdir_works=yes -gl_cv_func_roundf_ieee=yes -gl_cv_func_round_ieee=yes -gl_cv_func_select_detects_ebadf=yes -gl_cv_func_setenv_works=yes -gl_cv_func_signbit_gcc=yes -gl_cv_func_signbit=yes -gl_cv_func_sleep_works=yes -gl_cv_func_snprintf_directive_n=yes -gl_cv_func_snprintf_retval_c99=yes -gl_cv_func_snprintf_truncation_c99=yes -gl_cv_func_stat_dir_slash=yes -gl_cv_func_stat_file_slash=yes -gl_cv_func_stpncpy=yes -gl_cv_func_strcasestr_linear=yes -gl_cv_func_strchrnul_works=yes -gl_cv_func_strerror_0_works=yes -gl_cv_func_strstr_linear=yes -gl_cv_func_strtod_works=yes -gl_cv_func_svid_putenv=yes -gl_cv_func_symlink_works=yes -gl_cv_func_tdelete_works=yes -gl_cv_func_truncf_ieee=yes -gl_cv_func_trunc_ieee=yes -gl_cv_func_truncl_ieee=yes -gl_cv_func_tzset_clobber=no -gl_cv_func_ungetc_works=yes -gl_cv_func_unlink_honors_slashes=yes -gl_cv_func_unsetenv_works=yes -gl_cv_func_usleep_works=yes -gl_cv_func_utimensat_works=yes -gl_cv_func_vsnprintf_posix=yes -gl_cv_func_vsnprintf_zerosize_c99=yes -gl_cv_func_vsprintf_posix=yes -gl_cv_func_wcwidth_works=yes -gl_cv_func_working_getdelim=yes -gl_cv_func_working_mkstemp=yes -gl_cv_func_working_mktime=yes -gl_cv_func_working_strerror=yes -ac_cv_func___fseterr=yes -gl_cv_func_getcwd_null=yes -gl_cv_struct_dirent_d_ino=yes - -# bash -bash_cv_func_sigsetjmp=present -bash_cv_getcwd_malloc=yes -bash_cv_job_control_missing=present -bash_cv_printf_a_format=yes -bash_cv_sys_named_pipes=present -bash_cv_ulimit_maxfds=yes -bash_cv_under_sys_siglist=yes -bash_cv_unusable_rtsigs=no - -# libX11 -xorg_cv_malloc0_returns_null=yes - -# mc -ac_list_mounted_fs=found - -# procps_ng -ac_cv_func_realloc_0_nonnull=yes - -# vim -ac_cv_small_wchar_t=no -ac_x_header_dirs=${PKG_PREFIX}/include -vim_cv_bcopy_handles_overlap=yes -vim_cv_getcwd_broken=no -vim_cv_memcpy_handles_overlap=no -vim_cv_memmove_handles_overlap=yes -vim_cv_stat_ignores_slash=no -vim_cv_terminfo=yes -vim_cv_toupper_broken=no -vim_cv_tty_group=tty -vim_cv_tty_mode=0666 - -# libevent -ac_pe_target=true diff --git a/config.sub b/config.sub deleted file mode 100644 index 9feb73b..0000000 --- a/config.sub +++ /dev/null @@ -1,1823 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. - -timestamp='2016-06-20' - -# 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 -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2016 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -ios) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/etc/config.cache b/etc/config.cache new file mode 100644 index 0000000..2910ce7 --- /dev/null +++ b/etc/config.cache @@ -0,0 +1,166 @@ +# autoconf +ac_cv_buggy_getaddrinfo=no +ac_cv_func_calloc_0_nonnull=yes +ac_cv_func_chown_works=yes +ac_cv_func_getgroups_works=yes +ac_cv_func_malloc_0_nonnull=yes +ac_cv_func_strnlen_working=yes +ac_cv_func_mmap_fixed_mapped=yes +ac_cv_func_strcoll_works=yes +ac_cv_func_working_mktime=yes +ac_cv_file__dev_ptmx=yes +ac_cv_file__dev_ptc=no +gt_cv_int_divbyzero_sigfpe=yes + +# gnulib +gl_cv_func_cbrtl_ieee=yes +gl_cv_func_ceilf_ieee=yes +gl_cv_func_ceil_ieee=yes +gl_cv_func_ceill_ieee=yes +gl_cv_func_chown_ctime_works=yes +gl_cv_func_chown_slash_works=yes +gl_cv_func_exp2l_ieee=yes +gl_cv_func_expm1_ieee=yes +gl_cv_func_fcntl_f_dupfd_works=yes +gl_cv_func_fdopendir_works=yes +gl_cv_func_floorf_ieee=yes +gl_cv_func_fflush_stdin=yes +gl_cv_func_fmaf_works=yes +gl_cv_func_fmal_works=yes +gl_cv_func_fma_works=yes +gl_cv_func_fmodf_ieee=yes +gl_cv_func_fmod_ieee=yes +gl_cv_func_fmodl_ieee=yes +gl_cv_func_fpurge_works=yes +gl_cv_func_fseeko=yes +gl_cv_func_futimens_works=yes +gl_cv_func_futimesat_works=yes +gl_cv_func_getgroups_works=yes +gl_cv_func_gettimeofday_clobber=no +gl_cv_func_hypotf_ieee=yes +gl_cv_func_hypotl_ieee=yes +gl_cv_func_hypot_ieee=yes +gl_cv_func_isfinitel_works=yes +gl_cv_func_isnanl_works=yes +gl_cv_func_linkat_slash=yes +gl_cv_func_link_works=yes +gl_cv_func_log10f_ieee=yes +gl_cv_func_log10_ieee=yes +gl_cv_func_log1pf_ieee=yes +gl_cv_func_log1p_ieee=yes +gl_cv_func_log1pl_ieee=yes +gl_cv_func_log2f_ieee=yes +gl_cv_func_log2_ieee=yes +gl_cv_func_logf_ieee=yes +gl_cv_func_log_ieee=yes +gl_cv_func_lstat_dereferences_slashed_symlink=yes +gl_cv_func_mbrlen_empty_input=yes +gl_cv_func_mbrtowc_empty_input=yes +gl_cv_func_memchr_works=yes +gl_cv_func_memmem_works_fast=yes +gl_cv_func_mkdir_trailing_dot_works=yes +gl_cv_func_mkdir_trailing_slash_works=yes +gl_cv_func_mkfifo_works=yes +gl_cv_func_mknod_works=yes +gl_cv_func_modff_ieee=yes +gl_cv_func_modf_ieee=yes +gl_cv_func_modfl_ieee=yes +gl_cv_func_nanosleep=yes +gl_cv_func_open_directory_works=yes +gl_cv_func_perror_works=yes +gl_cv_func_printf_directive_a=yes +gl_cv_func_printf_directive_f=yes +gl_cv_func_printf_directive_n=yes +gl_cv_func_printf_enomem=yes +gl_cv_func_printf_flag_zero=yes +gl_cv_func_printf_infinite_long_double=yes +gl_cv_func_printf_infinite=yes +gl_cv_func_printf_sizes_c99=yes +gl_cv_func_pselect_detects_ebadf=yes +gl_cv_func_ptsname_sets_errno=yes +gl_cv_func_readlink_works=yes +gl_cv_func_realpath_works=yes +gl_cv_func_remainderf_ieee=yes +gl_cv_func_remainder_ieee=yes +gl_cv_func_remainderl_ieee=yes +gl_cv_func_rename_dest_works=yes +gl_cv_func_rename_link_works=yes +gl_cv_func_rename_slash_dst_works=yes +gl_cv_func_rename_slash_src_works=yes +gl_cv_func_rmdir_works=yes +gl_cv_func_roundf_ieee=yes +gl_cv_func_round_ieee=yes +gl_cv_func_select_detects_ebadf=yes +gl_cv_func_setenv_works=yes +gl_cv_func_signbit_gcc=yes +gl_cv_func_signbit=yes +gl_cv_func_sleep_works=yes +gl_cv_func_snprintf_directive_n=yes +gl_cv_func_snprintf_retval_c99=yes +gl_cv_func_snprintf_truncation_c99=yes +gl_cv_func_stat_dir_slash=yes +gl_cv_func_stat_file_slash=yes +gl_cv_func_stpncpy=yes +gl_cv_func_strcasestr_linear=yes +gl_cv_func_strchrnul_works=yes +gl_cv_func_strerror_0_works=yes +gl_cv_func_strstr_linear=yes +gl_cv_func_strtod_works=yes +gl_cv_func_svid_putenv=yes +gl_cv_func_symlink_works=yes +gl_cv_func_tdelete_works=yes +gl_cv_func_truncf_ieee=yes +gl_cv_func_trunc_ieee=yes +gl_cv_func_truncl_ieee=yes +gl_cv_func_tzset_clobber=no +gl_cv_func_ungetc_works=yes +gl_cv_func_unlink_honors_slashes=yes +gl_cv_func_unsetenv_works=yes +gl_cv_func_usleep_works=yes +gl_cv_func_utimensat_works=yes +gl_cv_func_vsnprintf_posix=yes +gl_cv_func_vsnprintf_zerosize_c99=yes +gl_cv_func_vsprintf_posix=yes +gl_cv_func_wcwidth_works=yes +gl_cv_func_working_getdelim=yes +gl_cv_func_working_mkstemp=yes +gl_cv_func_working_mktime=yes +gl_cv_func_working_strerror=yes +ac_cv_func___fseterr=yes +gl_cv_func_getcwd_null=yes +gl_cv_struct_dirent_d_ino=yes + +# bash +bash_cv_func_sigsetjmp=present +bash_cv_getcwd_malloc=yes +bash_cv_job_control_missing=present +bash_cv_printf_a_format=yes +bash_cv_sys_named_pipes=present +bash_cv_ulimit_maxfds=yes +bash_cv_under_sys_siglist=yes +bash_cv_unusable_rtsigs=no + +# libX11 +xorg_cv_malloc0_returns_null=yes + +# mc +ac_list_mounted_fs=found + +# procps_ng +ac_cv_func_realloc_0_nonnull=yes + +# vim +ac_cv_small_wchar_t=no +ac_x_header_dirs=${PKG_PREFIX}/include +vim_cv_bcopy_handles_overlap=yes +vim_cv_getcwd_broken=no +vim_cv_memcpy_handles_overlap=no +vim_cv_memmove_handles_overlap=yes +vim_cv_stat_ignores_slash=no +vim_cv_terminfo=yes +vim_cv_toupper_broken=no +vim_cv_tty_group=tty +vim_cv_tty_mode=0666 + +# libevent +ac_pe_target=true diff --git a/etc/config.sub b/etc/config.sub new file mode 100644 index 0000000..9feb73b --- /dev/null +++ b/etc/config.sub @@ -0,0 +1,1823 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-06-20' + +# 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 +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/gdb-7.12.midipix.patch b/gdb-7.12.midipix.patch deleted file mode 100644 index feca3b1..0000000 --- a/gdb-7.12.midipix.patch +++ /dev/null @@ -1,368 +0,0 @@ -========== -gdb.config: -========== -#!/bin/sh - - CFLAGS="-g3 -O0" \ - CXXFLAGS="-g3 -O0" \ - 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 \ - --with-system-readline \ - --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-04 14:11:22.091870500 +0000 -@@ -229,6 +229,12 @@ - fi - build_gdbserver=yes - ;; -+i[34567]86-*-midipix*) -+ # Target: Intel 386 running win32 -+ gdb_target_obs="i386-tdep.o i387-tdep.o \ -+ i386-winnt-tdep.o windows-tdep.o" -+ build_gdbserver=no -+ ;; - i[34567]86-*-gnu*) - # Target: Intel 386 running the GNU Hurd - gdb_target_obs="i386-tdep.o i387-tdep.o i386gnu-tdep.o solib-svr4.o" -@@ -678,6 +684,13 @@ - windows-tdep.o" - build_gdbserver=yes - ;; -+x86_64-*-midipix) -+ # Target: Midipix -+ gdb_target_obs="amd64-tdep.o amd64-winnt-tdep.o \ -+ i386-tdep.o i387-tdep.o \ -+ windows-tdep.o i386-winnt-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 +731,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/amd64-winnt-tdep.c b/gdb/amd64-winnt-tdep.c ---- a/gdb/amd64-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 -+++ b/gdb/amd64-winnt-tdep.c 2019-06-04 16:22:12.929814200 +0000 -@@ -0,0 +1,47 @@ -+#include "defs.h" -+#include "osabi.h" -+#include "frame-unwind.h" -+#include "windows-tdep.h" -+#include "amd64-windows-tdep.c" -+ -+#define amd64_winnt_push_dummy_call amd64_windows_push_dummy_call -+#define amd64_winnt_return_value amd64_windows_return_value -+#define amd64_winnt_skip_trampoline_code amd64_windows_skip_trampoline_code -+ -+#define amd64_winnt_skip_prologue amd64_windows_skip_prologue -+#define amd64_winnt_skip_main_prologue amd64_skip_main_prologue -+ -+static void -+amd64_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -+{ -+ /* abi */ -+ amd64_init_abi (info, gdbarch); -+ windows_init_abi (info, gdbarch); -+ -+ /* out-of-band function calls */ -+ set_gdbarch_push_dummy_call (gdbarch, amd64_winnt_push_dummy_call); -+ set_gdbarch_return_value (gdbarch, amd64_winnt_return_value); -+ set_gdbarch_skip_trampoline_code (gdbarch, amd64_winnt_skip_trampoline_code); -+ -+ /* skip prologue methods */ -+ set_gdbarch_skip_prologue (gdbarch, amd64_windows_skip_prologue); -+ set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); -+ -+ /* todo: SEH unwinder */ -+ frame_unwind_append_unwinder (gdbarch, 0); -+ -+ /* todo: inferior-specific, dynamically detected size of long */ -+ set_gdbarch_long_bit (gdbarch, 64); -+} -+ -+extern initialize_file_ftype _initialize_amd64_winnt_tdep; -+ -+void -+_initialize_amd64_winnt_tdep (void) -+{ -+ gdbarch_register_osabi( -+ bfd_arch_i386, -+ bfd_mach_x86_64, -+ GDB_OSABI_WINNT, -+ amd64_winnt_init_abi); -+} -diff -ru --new-file a/gdb/i386-winnt-tdep.c b/gdb/i386-winnt-tdep.c ---- a/gdb/i386-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 -+++ b/gdb/i386-winnt-tdep.c 2019-06-04 14:43:15.890632100 +0000 -@@ -0,0 +1,37 @@ -+#include "defs.h" -+#include "osabi.h" -+#include "frame-unwind.h" -+#include "windows-tdep.h" -+ -+static void -+i386_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -+{ -+ /* abi */ -+ windows_init_abi (info, gdbarch); -+ -+ /* out-of-band function calls */ -+ set_gdbarch_push_dummy_call (gdbarch, 0); -+ set_gdbarch_return_value (gdbarch, 0); -+ -+ /* progloue/trampoline methods */ -+ set_gdbarch_skip_main_prologue (gdbarch, 0); -+ set_gdbarch_skip_trampoline_code (gdbarch, 0); -+ -+ /* auto wide charset hack */ -+ set_gdbarch_auto_wide_charset (gdbarch, 0); -+ -+ /* unwainder */ -+ frame_unwind_append_unwinder (gdbarch, 0); -+} -+ -+extern initialize_file_ftype _initialize_i386_winnt_tdep; -+ -+void -+_initialize_i386_winnt_tdep (void) -+{ -+ gdbarch_register_osabi( -+ bfd_arch_i386, -+ 0, -+ GDB_OSABI_WINNT, -+ i386_winnt_init_abi); -+} -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 diff --git a/gmp-5.1.1.midipix.patch b/gmp-5.1.1.midipix.patch deleted file mode 100644 index 9fdaa7c..0000000 --- a/gmp-5.1.1.midipix.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/configfsf.sub b/configfsf.sub -index 8df5511..e81d0e3 100644 ---- a/configfsf.sub -+++ b/configfsf.sub -@@ -794,6 +794,9 @@ case $basic_machine in - microblaze*) - basic_machine=microblaze-xilinx - ;; -+ midipix) -+ os=-midipix -+ ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 -@@ -1370,7 +1373,7 @@ case $os in - | -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* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ diff --git a/gmp-5.1.3.midipix.patch b/gmp-5.1.3.midipix.patch deleted file mode 100644 index ecee6b9..0000000 --- a/gmp-5.1.3.midipix.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ru a/configfsf.sub b/configfsf.sub ---- a/configfsf.sub 2013-09-30 06:18:28.000000000 -0400 -+++ b/configfsf.sub 2015-05-28 00:18:19.772345286 -0400 -@@ -794,6 +794,9 @@ - microblaze*) - basic_machine=microblaze-xilinx - ;; -+ midipix) -+ os=-midipix -+ ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 -@@ -1370,7 +1373,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* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ diff --git a/libelf-0.8.13.midipix.patch b/libelf-0.8.13.midipix.patch deleted file mode 100644 index c2ac31f..0000000 --- a/libelf-0.8.13.midipix.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -ru a/configure b/configure ---- a/configure 2008-05-23 04:18:03.000000000 -0400 -+++ b/configure 2015-03-10 20:32:16.332333640 -0400 -@@ -3445,6 +3445,16 @@ - LINK_SHLIB='$(LD) -G -z text -h $(SONAME)' - INSTALL_SHLIB='$(INSTALL_PROGRAM)' - ;; -+ *midipix*) -+ PICFLAGS='-fPIC -DPIC' -+ SHLIB_SFX='.so.$(VERSION)' -+ SHLINK_SFX='.so' -+ SONAME_SFX='.so.$(MAJOR)' -+ LINK_SHLIB='$(CC) -shared -Wl,-soname,$(SONAME) -mout-dsolib -moutput-def' -+ IMPLIB_NAME=libelf.`echo "so.$VERSION" | sed -E 's/[^\.]+$/lib.a/'` -+ INSTALL_SHLIB='cp $(IMPLIB_NAME) $(libdir)/libelf.lib.a; $(INSTALL_PROGRAM)' -+ DEPSHLIBS='' -+ ;; - *) - echo "configure: warning: shared libraries not supported for $host" 1>&2 - mr_enable_shared=no -@@ -3687,6 +3697,7 @@ - s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g - s%@DEPSHLIBS@%$DEPSHLIBS%g - s%@DO_SHLIB@%$DO_SHLIB%g -+s%@IMPLIB_NAME@%$IMPLIB_NAME%g - - CEOF - EOF -diff -ru a/lib/Makefile.in b/lib/Makefile.in ---- a/lib/Makefile.in 2009-11-01 08:04:19.000000000 -0500 -+++ b/lib/Makefile.in 2015-03-09 00:13:06.842232837 -0400 -@@ -49,6 +49,7 @@ - SHLINK_SFX = @SHLINK_SFX@ - SONAME_SFX = @SONAME_SFX@ - LINK_SHLIB = @LINK_SHLIB@ -+IMPLIB_NAME = @IMPLIB_NAME@ - INSTALL_SHLIB = @INSTALL_SHLIB@ - - SHLIB = libelf$(SHLIB_SFX) diff --git a/libffi-3.2.1.midipix.patch b/libffi-3.2.1.midipix.patch deleted file mode 100644 index 341f830..0000000 --- a/libffi-3.2.1.midipix.patch +++ /dev/null @@ -1,108 +0,0 @@ -diff -ru --new-file a/configure b/configure ---- a/configure 2014-11-12 06:59:57.000000000 -0500 -+++ b/configure 2016-01-25 18:26:47.000000000 -0500 -@@ -17133,7 +17133,7 @@ - i?86-*-freebsd* | i?86-*-openbsd*) - TARGET=X86_FREEBSD; TARGETDIR=x86 - ;; -- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) -+ i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* | i?86-*-midipix*) - TARGET=X86_WIN32; TARGETDIR=x86 - # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. - # We must also check with_cross_host to decide if this is a native -@@ -17161,7 +17161,7 @@ - TARGET=X86_DARWIN; TARGETDIR=x86 - ;; - -- x86_64-*-cygwin* | x86_64-*-mingw*) -+ x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-midipix*) - TARGET=X86_WIN64; TARGETDIR=x86 - # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. - # We must also check with_cross_host to decide if this is a native -diff -ru --new-file a/src/closures.c b/src/closures.c ---- a/src/closures.c 2014-11-08 07:47:24.000000000 -0500 -+++ b/src/closures.c 2016-01-25 17:57:43.000000000 -0500 -@@ -26,6 +26,25 @@ - DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#ifdef __midipix__ -+ -+#include -+ -+void * ffi_closure_alloc (size_t size, void ** code) -+{ -+ if (code) -+ return (*code = malloc(size)); -+ else -+ return 0; -+} -+ -+void ffi_closure_free (void * addr) -+{ -+ free(addr); -+} -+ -+#else -+ - #if defined __linux__ && !defined _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif -@@ -686,3 +705,4 @@ - - # endif /* ! FFI_MMAP_EXEC_WRIT */ - #endif /* FFI_CLOSURES */ -+#endif -diff -ru --new-file a/src/x86/ffi.c b/src/x86/ffi.c ---- a/src/x86/ffi.c 2014-11-08 07:47:24.000000000 -0500 -+++ b/src/x86/ffi.c 2016-01-25 17:52:14.000000000 -0500 -@@ -31,8 +31,12 @@ - #if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__) - - #ifdef _WIN64 -+#ifdef __midipix__ -+/* not needed */ -+#else - #include - #endif -+#endif - - #include - #include -diff -ru --new-file a/src/x86/win32.S b/src/x86/win32.S ---- a/src/x86/win32.S 2014-11-11 09:41:37.000000000 -0500 -+++ b/src/x86/win32.S 2016-01-25 18:36:49.000000000 -0500 -@@ -1344,6 +1344,14 @@ - .align 4 - .LEFDE5: - -+#ifdef __midipix__ -+ .section .got$ffi_call_win32,"r" -+ .global __imp_ffi_call_win32 -+__imp_ffi_call_win32: -+ .long ffi_call_win32 -+ .linkonce discard -+#endif -+ - #endif /* !_MSC_VER */ - - #if defined __ELF__ && defined __linux__ -diff -ru --new-file a/src/x86/win64.S b/src/x86/win64.S ---- a/src/x86/win64.S 2014-11-08 07:47:24.000000000 -0500 -+++ b/src/x86/win64.S 2016-01-25 17:47:17.000000000 -0500 -@@ -516,5 +516,15 @@ - pop %rbp - retq - .seh_endproc -+ -+ -+#ifdef __midipix__ -+ .section .got$ffi_call_win64,"r" -+ .global __imp_ffi_call_win64 -+__imp_ffi_call_win64: -+ .quad ffi_call_win64 -+ .linkonce discard -+#endif -+ - #endif /* !_MSC_VER */ - diff --git a/patches/binutils-2.24.51.midipix.patch b/patches/binutils-2.24.51.midipix.patch new file mode 100644 index 0000000..928e059 --- /dev/null +++ b/patches/binutils-2.24.51.midipix.patch @@ -0,0 +1,1391 @@ +diff -ru --new-file a/ld/pe-mdso.c b/ld/pe-mdso.c +--- a/ld/pe-mdso.c 2019-08-14 06:12:57.193333307 -0400 ++++ a/ld/pe-mdso.c 2019-08-17 00:59:46.886167655 -0400 +@@ -0,0 +1,241 @@ ++#include "sysdep.h" ++#include "pe-mdso.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++extern char * program_name; ++extern int xatexit(void (*)(void)); ++ ++static char pe_mdso_tmp_lib_name[] = "/tmp/mdso_XXXXXXXXXXXX"; ++static char pe_perk_tmp_def_name[] = "/tmp/perk_XXXXXXXXXXXX"; ++static struct pe_driver_ctx * pe_dctx; ++ ++struct pe_mdso_lib { ++ dev_t st_dev; ++ ino_t st_ino; ++ char ar_name[24]; ++}; ++ ++struct pe_mdso_lib * pe_mdso_lib_arr; ++struct pe_mdso_lib * pe_mdso_lib_ptr; ++struct pe_mdso_lib * pe_mdso_lib_cap; ++ ++static int pe_mdso_perk_init(void) ++{ ++ char * argv[2]; ++ ++ if (pe_dctx) ++ return 0; ++ ++ argv[0] = program_name; ++ argv[1] = 0; ++ ++ return pe_get_driver_ctx(argv,0,0,0,&pe_dctx); ++} ++ ++static void pe_mdso_cache_unlink(void) ++{ ++ struct pe_mdso_lib * pe_mdso; ++ ++ for (pe_mdso=pe_mdso_lib_arr; pe_mdsoar_name); ++} ++ ++static int pe_mdso_cache_alloc(void) ++{ ++ void * prev; ++ size_t size; ++ size_t nlib; ++ ++ if (pe_mdso_lib_cap > pe_mdso_lib_ptr) ++ return 0; ++ ++ prev = pe_mdso_lib_arr; ++ nlib = pe_mdso_lib_cap - pe_mdso_lib_arr; ++ size = nlib * sizeof(struct pe_mdso_lib); ++ ++ if (!(pe_mdso_lib_arr = calloc(nlib+2,sizeof(struct pe_mdso_lib)))) ++ return -1; ++ ++ if (!prev) ++ xatexit(pe_mdso_cache_unlink); ++ ++ memcpy(pe_mdso_lib_arr,prev,size); ++ ++ pe_mdso_lib_ptr = &pe_mdso_lib_arr[nlib]; ++ pe_mdso_lib_cap = &pe_mdso_lib_arr[nlib+2]; ++ ++ return 0; ++} ++ ++const char * pe_mdso_input_name(const char * input_name) ++{ ++ int fdin; ++ int fdout; ++ char * libname; ++ char * argv[8]; ++ ++ struct stat st; ++ struct pe_mdso_lib * pe_mdso; ++ struct pe_unit_ctx * pe_uctx; ++ struct pe_fd_ctx pe_fdctx; ++ struct mdso_driver_ctx * mdso_dctx; ++ ++ /* perk driver context */ ++ if (pe_mdso_perk_init() < 0) ++ return 0; ++ ++ /* defer when input_name cannot be opened */ ++ if ((fdin = open(input_name,O_RDONLY)) < 0) ++ return input_name; ++ ++ /* stat */ ++ if (fstat(fdin,&st) < 0) { ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ pe_output_error_vector(pe_dctx); ++ return 0; ++ } ++ ++ /* repeated input argument? */ ++ for (pe_mdso=pe_mdso_lib_arr; pe_mdsost_dev == st.st_dev) && (pe_mdso->st_ino == st.st_ino)) { ++ close(fdin); ++ return pe_mdso->ar_name; ++ } ++ } ++ ++ /* defer when perk object/image context cannot be created */ ++ if (pe_get_unit_ctx(pe_dctx,input_name,&pe_uctx) < 0) { ++ close(fdin); ++ return input_name; ++ } ++ ++ /* defer when input file is not an image */ ++ switch (pe_uctx->meta->m_subtype) { ++ case PE_SUBTYPE_DLL: ++ case PE_SUBTYPE_EXE: ++ break; ++ ++ default: ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ return input_name; ++ } ++ ++ /* image bits */ ++ switch (pe_uctx->meta->m_abi) { ++ case PE_ABI_PE32: ++ argv[1] = "-m32"; ++ break; ++ ++ case PE_ABI_PE64: ++ argv[1] = "-m64"; ++ break; ++ ++ default: ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ return 0; ++ } ++ ++ /* perk driver fd context (get) */ ++ if ((pe_get_driver_fdctx(pe_dctx,&pe_fdctx)) < 0) { ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ pe_output_error_vector(pe_dctx); ++ return 0; ++ } ++ ++ /* template init */ ++ memset (&pe_perk_tmp_def_name[10],'X',12); ++ memset (&pe_mdso_tmp_lib_name[10],'X',12); ++ ++ /* perk .def file (create) */ ++ if ((pe_fdctx.fdout = mkstemp(pe_perk_tmp_def_name)) < 0) { ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ pe_output_error_vector(pe_dctx); ++ return 0; ++ } ++ ++ /* perk driver fd context (set) */ ++ if ((pe_set_driver_fdctx(pe_dctx,&pe_fdctx)) < 0) { ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ pe_output_error_vector(pe_dctx); ++ return 0; ++ } ++ ++ /* perk .def file (populate) */ ++ if (pe_output_export_symbols(pe_dctx,pe_uctx->meta) < 0) { ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ pe_output_error_vector(pe_dctx); ++ return 0; ++ }; ++ ++ /* done with perk */ ++ close(fdin); ++ pe_free_unit_ctx(pe_uctx); ++ ++ /* libname */ ++ if ((libname = strrchr(input_name,'/'))) ++ libname++; ++ else if ((libname = strrchr(input_name,'\\'))) ++ libname++; ++ else ++ libname = (char *)input_name; ++ ++ /* cache alloc (as needed) */ ++ if (pe_mdso_cache_alloc() < 0) ++ return 0; ++ ++ /* mdso lib file (create) */ ++ if ((fdout = mkstemp(pe_mdso_tmp_lib_name)) < 0) ++ return 0; ++ ++ /* mdso driver context (argv[1] already set, see above) */ ++ argv[0] = program_name; ++ argv[2] = "--libname"; ++ argv[3] = libname; ++ argv[4] = "--implib"; ++ argv[5] = pe_mdso_tmp_lib_name; ++ argv[6] = pe_perk_tmp_def_name; ++ argv[7] = 0; ++ ++ if (mdso_get_driver_ctx(argv,0,0,0,&mdso_dctx) < 0) { ++ close(fdout); ++ return 0; ++ } ++ ++ /* mdso lib file (generate) */ ++ if (mdso_create_implib_archive(mdso_dctx) < 0) { ++ close(fdout); ++ mdso_output_error_vector(mdso_dctx); ++ mdso_free_driver_ctx(mdso_dctx); ++ return 0; ++ } ++ ++ /* cache */ ++ strcpy(pe_mdso_lib_ptr->ar_name,pe_mdso_tmp_lib_name); ++ ++ pe_mdso_lib_ptr->st_dev = st.st_dev; ++ pe_mdso_lib_ptr->st_ino = st.st_ino; ++ pe_mdso_lib_ptr++; ++ ++ /* all done */ ++ unlink(pe_perk_tmp_def_name); ++ mdso_free_driver_ctx(mdso_dctx); ++ close(fdout); ++ ++ return pe_mdso_tmp_lib_name; ++} +diff -ru --new-file a/bfd/pe-mdso.h b/bfd/pe-mdso.h +--- a/bfd/pe-mdso.h 1969-12-31 19:00:00.000000000 -0500 ++++ b/bfd/pe-mdso.h 2019-08-15 07:00:00.000000000 -0400 +@@ -0,0 +1,10 @@ ++#ifndef PEMDSO_H ++#define PEMDSO_H ++ ++#define PE_DSO_SUFFIX ".so" ++#define PE_DSOLIB_SUFFIX ".dso.a" ++#define PE_IMPLIB_SUFFIX ".lib.a" ++ ++const char * pe_mdso_input_name(const char * input_name); ++ ++#endif +diff --ru --new-file a/ld/ldfile.c b/ld/ldfile.c +--- a/ld/ldfile.c 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/ldfile.c 2019-08-17 11:38:31.062209027 -0400 +@@ -122,6 +122,16 @@ bfd_boolean + ldfile_try_open_bfd (const char *attempt, + lang_input_statement_type *entry) + { ++ ++#ifdef PE_TARGET_MDSO ++ if (!entry->flags.dynamic) { ++ (void)0; ++ } else if (!(attempt = pe_mdso_input_name(attempt))) { ++ fprintf(stderr,"%s: pe_mdso_input_name() returned an error.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++#endif ++ + entry->the_bfd = bfd_openr (attempt, entry->target); + + if (verbose) +diff -ru --new-file a/ld/configure b/ld/configure +--- a/ld/configure 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/configure 2015-03-11 20:01:08.888756786 -0400 +@@ -19773,3 +19773,31 @@ + $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + fi + ++sed -i -e 's/@pe_executable_name@/'"$PE_EXECUTABLE_NAME"'/g' Makefile ++sed -i -e 's/@pe_framework_libs@/'"$PE_FRAMEWORK_LIBS"'/g' Makefile ++sed -i -e 's/@pe_crt_section@/'"$PE_CRT_SECTION"'/g' Makefile ++sed -i -e 's/@pe_cygwin_fork_support@/'"$PE_CYGWIN_FORK_SUPPORT"'/g' Makefile ++ ++#PE custom import library support ++if [ -f peimplib.h ]; then ++ echo 'build directory is not clean (peimplib.h already exists)' ++ exit 2 ++fi ++ ++touch peimplib.h || exit 2 ++ ++case $target_os in ++ *midipix*) ++ cat >> peimplib.h << EOF ++/* PE target-specific bits, generated by ld/configure */ ++#ifndef PE_TARGET_MIDIPIX ++#define PE_TARGET_MIDIPIX ++#endif ++ ++#ifndef PE_TARGET_MDSO ++#define PE_TARGET_MDSO 1 ++#endif ++ ++#include "pe-mdso.h" ++EOF ++esac +diff --ru --new-file a/ld/sysdep.h b/ld/sysdep.h +--- a/ld/sysdep.h 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/sysdep.h 2019-08-16 03:08:47.771929753 -0400 +@@ -26,6 +26,7 @@ + #endif + + #include "config.h" ++#include "peimplib.h" + + #include + #include +diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em +--- a/ld/emultempl/pe.em 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/emultempl/pe.em 2019-08-17 11:38:31.062209027 -0400 +@@ -69,6 +69,14 @@ fragment < When linking dynamically to a dll without\n\ +- an importlib, use .dll\n\ +- in preference to lib.dll \n")); ++ an importlib, use "PE_DSO_SUFFIX"\n\ ++ in preference to lib"PE_DSO_SUFFIX" \n")); + fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ + __imp_sym for DATA references\n")); + fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); +@@ -808,6 +822,12 @@ gld${EMULATION_NAME}_handle_option (int optc) + case OPTION_IMPLIB_FILENAME: + pe_implib_filename = xstrdup (optarg); + break; ++ case OPTION_DSOLIB_FILENAME: ++ pe_dsolib_filename = xstrdup (optarg); ++ break; ++ case OPTION_DSOLIB_LOADER_PATH: ++ pe_dsolib_loader_path = xstrdup (optarg); ++ break; + case OPTION_WARN_DUPLICATE_EXPORTS: + pe_dll_warn_dup_exports = 1; + break; +@@ -1698,7 +1718,7 @@ gld_${EMULATION_NAME}_after_open (void) + extension, and use that for the remainder of the + comparisons. */ + pnt = strrchr (is3->the_bfd->filename, '.'); +- if (pnt != NULL && filename_cmp (pnt, ".dll") == 0) ++ if (pnt != NULL && filename_cmp (pnt, PE_DSO_SUFFIX) == 0) + break; + } + +@@ -1733,7 +1753,7 @@ gld_${EMULATION_NAME}_after_open (void) + then leave the filename alone. */ + pnt = strrchr (is->the_bfd->filename, '.'); + +- if (is_ms_arch && (filename_cmp (pnt, ".dll") == 0)) ++ if (is_ms_arch && (filename_cmp (pnt, PE_DSO_SUFFIX) == 0)) + { + int idata2 = 0, reloc_count=0; + asection *sec; +@@ -2063,8 +2083,14 @@ gld_${EMULATION_NAME}_finish (void) + ) + { + pe_dll_fill_sections (link_info.output_bfd, &link_info); ++ ++ /* generate legacy implib? */ + if (pe_implib_filename) + pe_dll_generate_implib (pe_def_file, pe_implib_filename, &link_info); ++ ++ /* generate mdso implib? */ ++ if (pe_dsolib_filename) ++ pe_dll_generate_dsolib (pe_def_file, 0, pe_dsolib_filename, pe_dsolib_loader_path, 32); + } + #if defined(TARGET_IS_shpe) + /* ARM doesn't need relocs. */ +@@ -2298,16 +2324,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive + } + libname_fmt [] = + { ++ /* optionally support ldso-specific import libraries */ ++ #ifdef PE_TARGET_MDSO ++ { "lib%s"PE_DSOLIB_SUFFIX, FALSE }, ++ #endif + /* Preferred explicit import library for dll's. */ +- { "lib%s.dll.a", FALSE }, ++ { "lib%s"PE_IMPLIB_SUFFIX, FALSE }, + /* Alternate explicit import library for dll's. */ +- { "%s.dll.a", FALSE }, ++ { "%s"PE_IMPLIB_SUFFIX, FALSE }, ++#ifdef PE_TARGET_MDSO ++ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ ++ { "lib%s"PE_DSO_SUFFIX, FALSE }, ++#endif + /* "libfoo.a" could be either an import lib or a static lib. + For backwards compatibility, libfoo.a needs to precede + libfoo.dll and foo.dll in the search. */ + { "lib%s.a", FALSE }, + /* The 'native' spelling of an import lib name is "foo.lib". */ + { "%s.lib", FALSE }, ++#ifndef PE_TARGET_MDSO + #ifdef DLL_SUPPORT + /* Try "foo.dll" (preferred dll name, if specified). */ + { "%s%s.dll", TRUE }, +@@ -2316,6 +2351,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.dll", FALSE }, + /* Finally try 'native' dll name "foo.dll". */ + { "%s.dll", FALSE }, ++#endif + /* Note: If adding more formats to this table, make sure to check to + see if their length is longer than libname_fmt[0].format, and if + so, update the call to xmalloc() below. */ +diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em +--- a/ld/emultempl/pep.em 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/emultempl/pep.em 2019-08-17 11:38:31.062209027 -0400 +@@ -67,6 +67,14 @@ fragment < When linking dynamically to a dll without\n\ +- an importlib, use .dll\n\ +- in preference to lib.dll \n")); ++ an importlib, use "PE_DSO_SUFFIX"\n\ ++ in preference to lib"PE_DSO_SUFFIX" \n")); + fprintf (file, _(" --enable-auto-import Do sophisticated linking of _sym to\n\ + __imp_sym for DATA references\n")); + fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); +@@ -760,6 +774,12 @@ gld${EMULATION_NAME}_handle_option (int optc) + case OPTION_IMPLIB_FILENAME: + pep_implib_filename = xstrdup (optarg); + break; ++ case OPTION_DSOLIB_FILENAME: ++ pep_dsolib_filename = xstrdup (optarg); ++ break; ++ case OPTION_DSOLIB_LOADER_PATH: ++ pep_dsolib_loader_path = xstrdup (optarg); ++ break; + case OPTION_WARN_DUPLICATE_EXPORTS: + pep_dll_warn_dup_exports = 1; + break; +@@ -1635,7 +1655,7 @@ gld_${EMULATION_NAME}_after_open (void) + extension, and use that for the remainder of the + comparisons. */ + pnt = strrchr (is3->the_bfd->filename, '.'); +- if (pnt != NULL && filename_cmp (pnt, ".dll") == 0) ++ if (pnt != NULL && filename_cmp (pnt, PE_DSO_SUFFIX) == 0) + break; + } + +@@ -1670,7 +1690,7 @@ gld_${EMULATION_NAME}_after_open (void) + then leave the filename alone. */ + pnt = strrchr (is->the_bfd->filename, '.'); + +- if (is_ms_arch && (filename_cmp (pnt, ".dll") == 0)) ++ if (is_ms_arch && (filename_cmp (pnt, PE_DSO_SUFFIX) == 0)) + { + int idata2 = 0, reloc_count=0; + asection *sec; +@@ -1834,8 +1854,14 @@ gld_${EMULATION_NAME}_finish (void) + || (!link_info.relocatable && pep_def_file->num_exports != 0)) + { + pep_dll_fill_sections (link_info.output_bfd, &link_info); ++ ++ /* generate legacy implib? */ + if (pep_implib_filename) + pep_dll_generate_implib (pep_def_file, pep_implib_filename, &link_info); ++ ++ /* generate mdso implib? */ ++ if (pep_dsolib_filename) ++ pep_dll_generate_dsolib (pep_def_file, 0, pep_dsolib_filename, pep_dsolib_loader_path, 64); + } + + if (pep_out_def_filename) +@@ -2062,16 +2088,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive + } + libname_fmt [] = + { ++ /* optionally support ldso-specific import libraries */ ++#ifdef PE_TARGET_MDSO ++ { "lib%s"PE_DSOLIB_SUFFIX, FALSE }, ++#endif + /* Preferred explicit import library for dll's. */ +- { "lib%s.dll.a", FALSE }, ++ { "lib%s"PE_IMPLIB_SUFFIX, FALSE }, + /* Alternate explicit import library for dll's. */ +- { "%s.dll.a", FALSE }, ++ { "%s"PE_IMPLIB_SUFFIX, FALSE }, ++#ifdef PE_TARGET_MDSO ++ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ ++ { "lib%s"PE_DSO_SUFFIX, FALSE }, ++#endif + /* "libfoo.a" could be either an import lib or a static lib. + For backwards compatibility, libfoo.a needs to precede + libfoo.dll and foo.dll in the search. */ + { "lib%s.a", FALSE }, + /* The 'native' spelling of an import lib name is "foo.lib". */ + { "%s.lib", FALSE }, ++#ifndef PE_TARGET_MDSO + #ifdef DLL_SUPPORT + /* Try "foo.dll" (preferred dll name, if specified). */ + { "%s%s.dll", TRUE }, +@@ -2080,6 +2115,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.dll", FALSE }, + /* Finally try 'native' dll name "foo.dll". */ + { "%s.dll", FALSE }, ++#endif + /* Note: If adding more formats to this table, make sure to check to + see if their length is longer than libname_fmt[0].format, and if + so, update the call to xmalloc() below. */ +diff -ru --new-file a/ld/configure.tgt b/ld/configure.tgt +--- a/ld/configure.tgt 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/configure.tgt 2019-08-15 06:52:04.192983142 -0400 +@@ -319,6 +319,12 @@ + test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; + i[3-7]86-*-mingw32*) targ_emul=i386pe ; + targ_extra_ofiles="deffilep.o pe-dll.o" ;; ++i[3-7]86-*-midipix*) targ_emul=i386pe ; ++ targ_extra_ofiles="deffilep.o pe-dll.o pe-mdso.o" ; ++ PE_FRAMEWORK_LIBS="-lperk -lmdso" ; ++ PE_EXECUTABLE_NAME=a.out ; ++ PE_CRT_SECTION=no ; ++ PE_CYGWIN_FORK_SUPPORT=no ;; + x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ; + targ_extra_emuls=i386pe ; + targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; +@@ -329,7 +335,14 @@ + x86_64-*-mingw*) targ_emul=i386pep ; + targ_extra_emuls=i386pe + targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; +-i[3-7]86-*-interix*) targ_emul=i386pe_posix; ++x86_64-*-midipix*) targ_emul=i386pep ; ++ targ_extra_emuls=i386pe ; ++ targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o pe-mdso.o" ; ++ PE_FRAMEWORK_LIBS="-lperk -lmdso" ; ++ PE_EXECUTABLE_NAME=a.out ; ++ PE_CRT_SECTION=no ; ++ PE_CYGWIN_FORK_SUPPORT=no ;; ++i[3-7]86-*-interix*) targ_emul=i386pe_posix ; + targ_extra_ofiles="deffilep.o pe-dll.o" ;; + i[3-7]86-*-beospe*) targ_emul=i386beos ;; + i[3-7]86-*-beos*) targ_emul=elf_i386_be ;; +@@ -825,6 +838,10 @@ + *-*-linux*) + ;; + ++*-*-midipix*) ++ NATIVE_LIB_DIRS= ++ ;; ++ + *-*-netbsd*) + ;; + +diff -ru --new-file a/ld/Makefile.in b/ld/Makefile.in +--- a/ld/Makefile.in 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/Makefile.in 2019-08-15 05:53:23.807970635 -0400 +@@ -54,6 +54,10 @@ + host_triplet = @host@ + target_triplet = @target@ + bin_PROGRAMS = ld-new$(EXEEXT) ++PE_EXECUTABLE_NAME = @pe_executable_name@ ++PE_FRAMEWORK_LIBS = @pe_framework_libs@ ++PE_CRT_SECTION = @pe_crt_section@ ++PE_CYGWIN_FORK_SUPPORT = @pe_cygwin_fork_support@ + + # Automake 1.9 will only build info files in the objdir if they are + # mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +@@ -831,7 +835,7 @@ + POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES) + + # These all start with e so 'make clean' can find them. +-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ ++GENSCRIPTS = EXECUTABLE_NAME='${PE_EXECUTABLE_NAME}' PE_FRAMEWORK_LIBS='${PE_FRAMEWORK_LIBS}' PE_CRT_SECTION='${PE_CRT_SECTION}' PE_CYGWIN_FORK_SUPPORT='${PE_CYGWIN_FORK_SUPPORT}' LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@ + GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed + ELF_DEPS = $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/scripttempl/DWARF.sc + ELF_GEN_DEPS = $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/emultempl/genelf.em $(srcdir)/scripttempl/DWARF.sc +@@ -1032,7 +1036,7 @@ + else :; fi + ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) + @rm -f ld-new$(EXEEXT) +- $(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) ++ $(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) $(PE_FRAMEWORK_LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) +@@ -3411,16 +3415,16 @@ + ld-partial.@OBJEXT@: ld-new$(EXEEXT) + ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES) + ld1$(EXEEXT): ld-partial.@OBJEXT@ +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) + + ld1-full$(EXEEXT): ld-new +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) + + ld2$(EXEEXT): ld1$(EXEEXT) +- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) + + ld3$(EXEEXT): ld2$(EXEEXT) +- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) $(PE_FRAMEWORK_LIBS) + + bootstrap: ld3$(EXEEXT) + cmp ld2$(EXEEXT) ld3$(EXEEXT) +diff -ru --new-file a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc +--- a/ld/scripttempl/pep.sc 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/scripttempl/pep.sc 2015-03-11 20:10:05.324773952 -0400 +@@ -92,12 +92,17 @@ + ${RELOCATING+ *(.gcc_except_table)} + } + ++EOF ++if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF + /* The Cygwin32 library uses a section to avoid copying certain data + on fork. This used to be named ".data$nocopy". The linker used + to include this between __data_start__ and __data_end__, but that + breaks building the cygwin32 dll. Instead, we name the section + ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ + ++EOF ++fi ++cat << EOF + .data ${RELOCATING+BLOCK(__section_alignment__)} : + { + ${RELOCATING+__data_start__ = . ;} +@@ -106,7 +111,12 @@ + ${R_DATA} + *(.jcr) + ${RELOCATING+__data_end__ = . ;} ++EOF ++if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF + ${RELOCATING+*(.data_cygwin_nocopy)} ++EOF ++fi ++cat << EOF + } + + .rdata ${RELOCATING+BLOCK(__section_alignment__)} : +@@ -170,6 +180,8 @@ + ${RELOCATING+__IAT_end__ = .;} + ${R_IDATA67} + } ++EOF ++if [ x"$PE_CRT_SECTION" != xno ]; then cat << EOF + .CRT ${RELOCATING+BLOCK(__section_alignment__)} : + { + ${RELOCATING+___crt_xc_start__ = . ;} +@@ -188,6 +200,9 @@ + ${R_CRT_XT} + ${RELOCATING+___crt_xt_end__ = . ;} + } ++EOF ++fi ++cat << EOF + + /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be + at the end of the .tls section. This is important because _tls_start MUST +diff -ru --new-file a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc +--- a/ld/scripttempl/pe.sc 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/scripttempl/pe.sc 2015-03-11 20:10:10.036774102 -0400 +@@ -92,12 +92,17 @@ + ${RELOCATING+ *(.gcc_except_table)} + } + ++EOF ++if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF + /* The Cygwin32 library uses a section to avoid copying certain data + on fork. This used to be named ".data$nocopy". The linker used + to include this between __data_start__ and __data_end__, but that + breaks building the cygwin32 dll. Instead, we name the section + ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ + ++EOF ++fi ++cat << EOF + .data ${RELOCATING+BLOCK(__section_alignment__)} : + { + ${RELOCATING+__data_start__ = . ;} +@@ -106,7 +111,12 @@ + ${R_DATA} + *(.jcr) + ${RELOCATING+__data_end__ = . ;} ++EOF ++if [ x"$PE_CYGWIN_FORK_SUPPORT" != xno ]; then cat << EOF + ${RELOCATING+*(.data_cygwin_nocopy)} ++EOF ++fi ++cat << EOF + } + + .rdata ${RELOCATING+BLOCK(__section_alignment__)} : +@@ -165,6 +175,8 @@ + ${RELOCATING+__IAT_end__ = .;} + ${R_IDATA67} + } ++EOF ++if [ x"$PE_CRT_SECTION" != xno ]; then cat << EOF + .CRT ${RELOCATING+BLOCK(__section_alignment__)} : + { + ${RELOCATING+___crt_xc_start__ = . ;} +@@ -183,6 +195,9 @@ + ${R_CRT_XT} + ${RELOCATING+___crt_xt_end__ = . ;} + } ++EOF ++fi ++cat << EOF + + /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be + at the end of section. This is important because _tls_start MUST +diff -ru --new-file a/binutils/winduni.c b/binutils/winduni.c +--- a/binutils/winduni.c 2014-07-03 01:37:23.000000000 -0400 ++++ b/binutils/winduni.c 2015-02-14 11:18:32.987163288 -0500 +@@ -57,7 +57,7 @@ + /* Codepages mapped. */ + static local_iconv_map codepages[] = + { +- { 0, "MS-ANSI" }, ++ { 0, "cp1252" }, + { 1, "WINDOWS-1252" }, + { 437, "MS-ANSI" }, + { 737, "MS-GREEK" }, +diff -ru a/ld/pe-dll.c b/ld/pe-dll.c +--- a/ld/pe-dll.c 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/pe-dll.c 2019-06-30 22:22:22.643202346 -0400 +@@ -27,6 +27,7 @@ + #include "safe-ctype.h" + + #include ++#include + + #include "ld.h" + #include "ldexp.h" +@@ -40,6 +41,7 @@ + #include "coff/internal.h" + #include "../bfd/libcoff.h" + #include "deffile.h" ++#include "peimplib.h" + + #ifdef pe_use_x86_64 + +@@ -234,7 +236,11 @@ + { STRING_COMMA_LEN ("impure_ptr") }, + { STRING_COMMA_LEN ("_impure_ptr") }, + { STRING_COMMA_LEN ("_fmode") }, ++ #ifdef PE_TARGET_MIDIPIX ++ /* (default) excluded symbols are defined by the caller (specs, etc.) */ ++ #else + { STRING_COMMA_LEN ("environ") }, ++ #endif + { NULL, 0 } + }; + +@@ -644,10 +650,13 @@ + { + int i, j; + struct bfd_link_hash_entry *blhe; ++ struct bfd_link_hash_entry *blhew; + bfd *b; + struct bfd_section *s; + def_file_export *e = 0; + bfd_boolean resort_needed; ++ char *weaksym; ++ char *objsym; + + if (!pe_def_file) + pe_def_file = def_file_empty (); +@@ -737,6 +746,16 @@ + if (is_import (sn)) + continue; + ++ if (!strncmp (sn, ".weak.", 6) && strchr (sn + 6, '.')) ++ { ++ objsym = strdup (sn); ++ weaksym = strdup (sn + 6); ++ *(strchr (weaksym, '.')) = '\0'; ++ sn = weaksym; ++ } ++ else ++ weaksym = 0; ++ + name = xmalloc (strlen ("__imp_") + strlen (sn) + 1); + sprintf (name, "%s%s", "__imp_", sn); + +@@ -745,7 +764,9 @@ + free (name); + + if (blhe && blhe->type == bfd_link_hash_defined) +- continue; ++ if (strncmp (blhe->u.def.section->name, ".got$", 5)) ++ if (strncmp (blhe->u.def.section->name, ".dsosyms$", 9)) ++ continue; + } + + if (pe_details->underscored && *sn == '_') +@@ -756,12 +777,30 @@ + int is_dup = 0; + def_file_export *p; + +- p = def_file_add_export (pe_def_file, sn, 0, -1, +- NULL, &is_dup); +- /* Fill data flag properly, from dlltool.c. */ +- if (!is_dup) +- p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); +- } ++ if (weaksym) { ++ blhew = bfd_link_hash_lookup (info->hash, weaksym, ++ FALSE, FALSE, FALSE); ++ } ++ ++ if (!weaksym || blhew) { ++ p = def_file_add_export (pe_def_file, sn, 0, -1, ++ NULL, &is_dup); ++ ++ /* Fill data flag properly, from dlltool.c. */ ++ if (!is_dup) ++ p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); ++ ++ if (weaksym) { ++ if (blhew->type != bfd_link_hash_defined) { ++ free (p->internal_name); ++ p->internal_name = objsym; ++ } ++ } ++ ++ if (weaksym) ++ free (weaksym); ++ } ++ } + } + } + } +@@ -910,6 +949,7 @@ + + if (blhe + && (blhe->type == bfd_link_hash_defined ++ || (blhe->type == bfd_link_hash_defweak) + || (blhe->type == bfd_link_hash_common))) + { + count_exported++; +@@ -919,7 +959,7 @@ + /* Only fill in the sections. The actual offsets are computed + in fill_exported_offsets() after common symbols are laid + out. */ +- if (blhe->type == bfd_link_hash_defined) ++ if ((blhe->type == bfd_link_hash_defined) || (blhe->type == bfd_link_hash_defweak)) + exported_symbol_sections[i] = blhe->u.def.section; + else + exported_symbol_sections[i] = blhe->u.c.p->section; +@@ -2688,6 +2728,160 @@ + } + + ++ ++ ++void ++pe_dll_generate_dsolib( ++ def_file * def, ++ const char ** expsyms, ++ const char * dsolib_file_name, ++ const char * loader_path, ++ unsigned char bits) ++{ ++ char * mdso_exe_path; ++ char * slash; ++ char * mark; ++ FILE * fout; ++ char * argv[10]; ++ int fd[2]; ++ int pid; ++ int rpid; ++ int ecode; ++ int i; ++ ++ /* sigh; even though pe_dll_generate_implib() might fail, */ ++ /* ld's _finish() code path assumes no errors could occur */ ++ /* and accordingly does not perform any checks upon return. */ ++ /* handle errors here and invoke xexit() as needed. */ ++ ++ /* bits */ ++ if ((bits != 32) && (bits != 64)) { ++ fprintf(stderr,"%s: internal error (bits == %d.\n",program_name,bits); ++ xexit(EXIT_FAILURE); ++ } ++ ++ /* mdso_exe_path buffer alloc */ ++ if (!(mdso_exe_path = calloc(1,strlen(program_name) + strlen("mdso") + 1))) { ++ fprintf(stderr,"%s: cannot allocate mdso_exe_path buffer.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ /* mdso_exe_path init */ ++ strcpy(mdso_exe_path,program_name); ++ ++ if ((slash = strrchr(mdso_exe_path,'/'))) ++ slash++; ++ else ++ slash = mdso_exe_path; ++ ++ if ((mark = strrchr(slash,'-'))) ++ mark++; ++ else ++ mark = slash; ++ ++ sprintf(mark,"%s","mdso"); ++ ++ /* pipe */ ++ if (pipe(fd)) { ++ fprintf(stderr,"%s: cannot create a pipe.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ /* fout init */ ++ if (!(fout = fdopen(fd[1],"a"))) { ++ fprintf(stderr,"%s: pipe fdopen failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ /* fork */ ++ if ((pid = fork()) < 0) { ++ fprintf(stderr,"%s: fork failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ /* child: execvp */ ++ if (pid == 0) { ++ argv[0] = mdso_exe_path; ++ argv[1] = (bits == 64) ? "-m64" : "-m32"; ++ argv[2] = "--implib"; ++ argv[3] = (char *)dsolib_file_name; ++ argv[4] = "--libname"; ++ argv[5] = (def->name) ? def->name : (char *)dll_name; ++ ++ if (loader_path) { ++ argv[6] = "--libpath"; ++ argv[7] = (char *)loader_path; ++ argv[8] = "-"; ++ argv[9] = 0; ++ } else { ++ argv[6] = "-"; ++ argv[7] = 0; ++ } ++ ++ fclose(fout); ++ close(fd[1]); ++ close(0); ++ ++ if (dup(fd[0]) == 0) ++ execvp(mdso_exe_path,argv); ++ ++ exit(EXIT_FAILURE); ++ } ++ ++ /* be good */ ++ free(mdso_exe_path); ++ ++ /* parent: expsyms --> pipe */ ++ if (expsyms) { ++ for (; *expsyms; ) { ++ if (fprintf(fout,"%s\n",*expsyms++) < 0) { ++ fprintf(stderr,"%s: pipe write operation failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ } ++ } else { ++ for (i=0; i < def->num_exports; i++) { ++ if (!(pe_def_file->exports[i].flag_private)) { ++ if (fprintf(fout,"%s\n",def->exports[i].name) < 0) { ++ fprintf(stderr,"%s: pipe write operation failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ } ++ } ++ } ++ ++ if (fflush(fout) < 0) { ++ fprintf(stderr,"%s: pipe fflush operation failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ fclose(fout); ++ close(fd[0]); ++ ++ /* obtain child exit status */ ++ if ((rpid = waitpid(pid,&ecode,0)) < 0) { ++ fprintf(stderr,"%s: waitpid operation failed.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ if (rpid != pid) { ++ fprintf(stderr,"%s: waitpid returned an unexpected pid.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ if (!(WIFEXITED(ecode))) { ++ fprintf(stderr,"%s: waitpid reported abnormal child process termination.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++ ++ if (WEXITSTATUS(ecode)) { ++ fprintf(stderr,"%s: the child process returned an error.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++} ++ ++ ++ + void + pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_info *info) + { +diff -ru a/ld/pe-dll.h b/ld/pe-dll.h +--- a/ld/pe-dll.h 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/pe-dll.h 2017-10-14 20:01:45.817295022 -0400 +@@ -49,6 +49,8 @@ + (const char *); + extern void pe_dll_generate_implib + (def_file *, const char *, struct bfd_link_info *); ++extern void pe_dll_generate_dsolib ++ (def_file *, const char **, const char *, const char *, unsigned char); + extern void pe_process_import_defs + (bfd *, struct bfd_link_info *); + extern bfd_boolean pe_implied_import_dll +diff -ru a/ld/pep-dll.c b/ld/pep-dll.c +--- a/ld/pep-dll.c 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/pep-dll.c 2017-10-14 10:14:35.490521636 -0400 +@@ -54,6 +54,7 @@ + #define pe_dll_fill_sections pep_dll_fill_sections + #define pe_exe_fill_sections pep_exe_fill_sections + #define pe_dll_generate_implib pep_dll_generate_implib ++#define pe_dll_generate_dsolib pep_dll_generate_dsolib + #define pe_dll_add_excludes pep_dll_add_excludes + #define pe_walk_relocs_of_symbol pep_walk_relocs_of_symbol + #define pe_bfd_is_dll pep_bfd_is_dll +diff -ru a/ld/pep-dll.h b/ld/pep-dll.h +--- a/ld/pep-dll.h 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/pep-dll.h 2017-10-14 19:17:26.885792850 -0400 +@@ -46,6 +46,7 @@ + extern void pep_dll_add_excludes (const char *, const exclude_type); + extern void pep_dll_generate_def_file (const char *); + extern void pep_dll_generate_implib (def_file *, const char *, struct bfd_link_info *); ++extern void pep_dll_generate_dsolib (def_file *, const char **, const char *, const char *, unsigned char); + extern void pep_process_import_defs (bfd *, struct bfd_link_info *); + extern bfd_boolean pep_implied_import_dll (const char *); + extern void pep_dll_build_sections (bfd *, struct bfd_link_info *); +diff -ru --new-file a/bfd/config.bfd b/bfd/config.bfd +--- a/bfd/config.bfd 2014-07-03 01:37:20.000000000 -0400 ++++ b/bfd/config.bfd 2015-02-14 11:27:08.199179775 -0500 +@@ -679,7 +679,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" + want64=true +@@ -731,7 +731,7 @@ + targ_defvec=i386_elf32_vec + targ_selvecs=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" + targ_underscore=yes +diff -ru --new-file a/binutils/configure b/binutils/configure +--- a/binutils/configure 2014-07-03 01:37:22.000000000 -0400 ++++ b/binutils/configure 2015-09-13 21:35:09.738957435 -0400 +@@ -14015,7 +14015,7 @@ + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; +- x86_64-*-mingw* | x86_64-*-cygwin*) ++ x86_64-*-mingw* | x86_64-*-midipix* | x86_64-*-cygwin*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" +@@ -14025,7 +14025,7 @@ + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' + ;; +- i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) ++ i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-midipix* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" +diff -ru --new-file a/configure b/configure +--- a/configure 2014-07-03 01:37:23.000000000 -0400 ++++ b/configure 2015-03-11 17:07:15.820422926 -0400 +@@ -3428,6 +3428,9 @@ + x86_64-*-mingw*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; ++ *-midipix*) ++ noconfigdirs="$noconfigdirs ${libgcj}" ++ ;; + mmix-*-*) + noconfigdirs="$noconfigdirs target-libffi target-boehm-gc" + ;; +@@ -3549,6 +3552,9 @@ + *-*-mingw*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ *-*-midipix*) ++ noconfigdirs="$noconfigdirs target-newlib target-libgloss" ++ ;; + *-*-netbsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; +@@ -6257,7 +6263,7 @@ + + target_elf=no + case $target in +- *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ ++ *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-midipix* | *-aout* | *-*coff* | \ + *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \ + alpha*-dec-osf* | *-interix* | hppa[12]*-*-hpux*) + target_elf=no +diff -ru --new-file a/gas/configure.tgt b/gas/configure.tgt +--- a/gas/configure.tgt 2014-07-03 01:37:25.000000000 -0400 ++++ b/gas/configure.tgt 2015-02-14 11:27:08.223179776 -0500 +@@ -262,7 +262,7 @@ + i*) fmt=coff em=pe ;; + esac ;; + i386-*-interix*) fmt=coff em=interix ;; +- i386-*-mingw*) ++ i386-*-mingw* | i386-*-midipix*) + case ${cpu} in + x86_64*) fmt=coff em=pep ;; + i*) fmt=coff em=pe ;; +diff -ru a/bfd/cofflink.c b/bfd/cofflink.c +--- a/bfd/cofflink.c 2014-07-03 01:37:20.000000000 -0400 ++++ b/bfd/cofflink.c 2015-06-13 20:22:46.000389638 -0400 +@@ -202,6 +202,7 @@ + bfd_size_type symesz; + bfd_byte *esym; + bfd_byte *esym_end; ++ char *weaksym; + + *pneeded = FALSE; + +@@ -236,6 +237,16 @@ + && CONST_STRNEQ (name, "__imp_")) + h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); + ++ if (!h && !strncmp (name, ".weak.", 6) && strchr (name + 6, '.')) ++ { ++ weaksym = strdup (name + 6); ++ *(strchr (weaksym, '.')) = '\0'; ++ h = bfd_link_hash_lookup (info->hash, weaksym, FALSE, FALSE, TRUE); ++ name = weaksym; ++ } ++ else ++ weaksym = 0; ++ + /* We are only interested in symbols that are currently + undefined. If a symbol is currently known to be common, + COFF linkers do not bring in an object file which defines +@@ -249,6 +260,9 @@ + *pneeded = TRUE; + return TRUE; + } ++ ++ if (weaksym) ++ free (weaksym); + } + + esym += (sym.n_numaux + 1) * symesz; +@@ -320,6 +334,7 @@ + bfd_byte *esym; + bfd_byte *esym_end; + bfd_size_type amt; ++ char *weaksym; + + symcount = obj_raw_syment_count (abfd); + +@@ -476,6 +491,20 @@ + addit = FALSE; + } + ++ if (!strncmp (name, ".weak.", 6) && strchr (name + 6, '.')) ++ { ++ if (! (bfd_coff_link_add_one_symbol ++ (info, abfd, name, flags, section, value, ++ (const char *) NULL, copy, FALSE, ++ (struct bfd_link_hash_entry **) sym_hash))) ++ goto error_return; ++ ++ weaksym = strdup (name + 6); ++ *(strchr(weaksym, '.')) = 0; ++ name = weaksym; ++ flags |= BSF_WEAK; ++ } ++ + if (addit) + { + if (! (bfd_coff_link_add_one_symbol +diff -ru a/bfd/linker.c b/bfd/linker.c +--- a/bfd/linker.c 2014-07-03 01:37:21.000000000 -0400 ++++ b/bfd/linker.c 2015-06-06 17:51:24.148275212 -0400 +@@ -1050,6 +1050,7 @@ + struct archive_hash_table arsym_hash; + unsigned int indx; + struct bfd_link_hash_entry **pundef; ++ char *weaksym; + + if (! bfd_has_map (abfd)) + { +@@ -1073,6 +1074,13 @@ + struct archive_hash_entry *arh; + struct archive_list *l, **pp; + ++ if (!strncmp (arsym->name, ".weak.", 6) && strchr (arsym->name + 6, '.')) ++ { ++ weaksym = strdup (arsym->name + 6); ++ *(strchr (weaksym, '.')) = '\0'; ++ arsym->name = weaksym; ++ } ++ + arh = archive_hash_lookup (&arsym_hash, arsym->name, TRUE, FALSE); + if (arh == NULL) + goto error_return; +diff -ru a/gas/config/tc-i386.c b/gas/config/tc-i386.c +--- a/gas/config/tc-i386.c 2014-07-03 01:37:25.000000000 -0400 ++++ b/gas/config/tc-i386.c 2015-06-12 22:40:37.100250091 -0400 +@@ -9148,25 +9148,6 @@ + value += md_pcrel_from (fixP); + #endif + } +-#if defined (OBJ_COFF) && defined (TE_PE) +- if (fixP->fx_addsy != NULL +- && S_IS_WEAK (fixP->fx_addsy) +- /* PR 16858: Do not modify weak function references. */ +- && ! fixP->fx_pcrel) +- { +-#if !defined (TE_PEP) +- /* For x86 PE weak function symbols are neither PC-relative +- nor do they set S_IS_FUNCTION. So the only reliable way +- to detect them is to check the flags of their containing +- section. */ +- if (S_GET_SEGMENT (fixP->fx_addsy) != NULL +- && S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_CODE) +- ; +- else +-#endif +- value -= S_GET_VALUE (fixP->fx_addsy); +- } +-#endif + + /* Fix a few things - the dynamic linker expects certain values here, + and we must not disappoint it. */ +@@ -9237,8 +9218,11 @@ + fixP->fx_done = 0; + /* Remember value for tc_gen_reloc. */ + fixP->fx_addnumber = value; +- /* Clear out the frag for now. */ +- value = 0; ++ /* for data symbols, cancel the effect of the relocation */ ++ if (!((S_GET_SEGMENT (fixP->fx_addsy)->flags) & SEC_CODE)) ++ value = -S_GET_VALUE (fixP->fx_addsy); ++ else ++ value = 0; + } + #endif + else if (use_rela_relocations) + +--- a/binutils/rename.c 2014-07-03 01:37:22.000000000 -0400 ++++ b/binutils/rename.c 2015-11-25 23:13:38.086948592 -0500 +@@ -167,7 +167,10 @@ + && s.st_nlink == 1) + ) + { +- ret = rename (from, to); ++ if ((ret = rename (from, to))) ++ if (!(ret = simple_copy (from, to))) ++ unlink (from); ++ + if (ret == 0) + { + if (exists) diff --git a/patches/gdb-7.12.midipix.patch b/patches/gdb-7.12.midipix.patch new file mode 100644 index 0000000..feca3b1 --- /dev/null +++ b/patches/gdb-7.12.midipix.patch @@ -0,0 +1,368 @@ +========== +gdb.config: +========== +#!/bin/sh + + CFLAGS="-g3 -O0" \ + CXXFLAGS="-g3 -O0" \ + 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 \ + --with-system-readline \ + --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-04 14:11:22.091870500 +0000 +@@ -229,6 +229,12 @@ + fi + build_gdbserver=yes + ;; ++i[34567]86-*-midipix*) ++ # Target: Intel 386 running win32 ++ gdb_target_obs="i386-tdep.o i387-tdep.o \ ++ i386-winnt-tdep.o windows-tdep.o" ++ build_gdbserver=no ++ ;; + i[34567]86-*-gnu*) + # Target: Intel 386 running the GNU Hurd + gdb_target_obs="i386-tdep.o i387-tdep.o i386gnu-tdep.o solib-svr4.o" +@@ -678,6 +684,13 @@ + windows-tdep.o" + build_gdbserver=yes + ;; ++x86_64-*-midipix) ++ # Target: Midipix ++ gdb_target_obs="amd64-tdep.o amd64-winnt-tdep.o \ ++ i386-tdep.o i387-tdep.o \ ++ windows-tdep.o i386-winnt-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 +731,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/amd64-winnt-tdep.c b/gdb/amd64-winnt-tdep.c +--- a/gdb/amd64-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 ++++ b/gdb/amd64-winnt-tdep.c 2019-06-04 16:22:12.929814200 +0000 +@@ -0,0 +1,47 @@ ++#include "defs.h" ++#include "osabi.h" ++#include "frame-unwind.h" ++#include "windows-tdep.h" ++#include "amd64-windows-tdep.c" ++ ++#define amd64_winnt_push_dummy_call amd64_windows_push_dummy_call ++#define amd64_winnt_return_value amd64_windows_return_value ++#define amd64_winnt_skip_trampoline_code amd64_windows_skip_trampoline_code ++ ++#define amd64_winnt_skip_prologue amd64_windows_skip_prologue ++#define amd64_winnt_skip_main_prologue amd64_skip_main_prologue ++ ++static void ++amd64_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) ++{ ++ /* abi */ ++ amd64_init_abi (info, gdbarch); ++ windows_init_abi (info, gdbarch); ++ ++ /* out-of-band function calls */ ++ set_gdbarch_push_dummy_call (gdbarch, amd64_winnt_push_dummy_call); ++ set_gdbarch_return_value (gdbarch, amd64_winnt_return_value); ++ set_gdbarch_skip_trampoline_code (gdbarch, amd64_winnt_skip_trampoline_code); ++ ++ /* skip prologue methods */ ++ set_gdbarch_skip_prologue (gdbarch, amd64_windows_skip_prologue); ++ set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); ++ ++ /* todo: SEH unwinder */ ++ frame_unwind_append_unwinder (gdbarch, 0); ++ ++ /* todo: inferior-specific, dynamically detected size of long */ ++ set_gdbarch_long_bit (gdbarch, 64); ++} ++ ++extern initialize_file_ftype _initialize_amd64_winnt_tdep; ++ ++void ++_initialize_amd64_winnt_tdep (void) ++{ ++ gdbarch_register_osabi( ++ bfd_arch_i386, ++ bfd_mach_x86_64, ++ GDB_OSABI_WINNT, ++ amd64_winnt_init_abi); ++} +diff -ru --new-file a/gdb/i386-winnt-tdep.c b/gdb/i386-winnt-tdep.c +--- a/gdb/i386-winnt-tdep.c 1970-01-01 00:00:00.000000000 +0000 ++++ b/gdb/i386-winnt-tdep.c 2019-06-04 14:43:15.890632100 +0000 +@@ -0,0 +1,37 @@ ++#include "defs.h" ++#include "osabi.h" ++#include "frame-unwind.h" ++#include "windows-tdep.h" ++ ++static void ++i386_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) ++{ ++ /* abi */ ++ windows_init_abi (info, gdbarch); ++ ++ /* out-of-band function calls */ ++ set_gdbarch_push_dummy_call (gdbarch, 0); ++ set_gdbarch_return_value (gdbarch, 0); ++ ++ /* progloue/trampoline methods */ ++ set_gdbarch_skip_main_prologue (gdbarch, 0); ++ set_gdbarch_skip_trampoline_code (gdbarch, 0); ++ ++ /* auto wide charset hack */ ++ set_gdbarch_auto_wide_charset (gdbarch, 0); ++ ++ /* unwainder */ ++ frame_unwind_append_unwinder (gdbarch, 0); ++} ++ ++extern initialize_file_ftype _initialize_i386_winnt_tdep; ++ ++void ++_initialize_i386_winnt_tdep (void) ++{ ++ gdbarch_register_osabi( ++ bfd_arch_i386, ++ 0, ++ GDB_OSABI_WINNT, ++ i386_winnt_init_abi); ++} +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 diff --git a/patches/gmp-5.1.1.midipix.patch b/patches/gmp-5.1.1.midipix.patch new file mode 100644 index 0000000..9fdaa7c --- /dev/null +++ b/patches/gmp-5.1.1.midipix.patch @@ -0,0 +1,23 @@ +diff --git a/configfsf.sub b/configfsf.sub +index 8df5511..e81d0e3 100644 +--- a/configfsf.sub ++++ b/configfsf.sub +@@ -794,6 +794,9 @@ case $basic_machine in + microblaze*) + basic_machine=microblaze-xilinx + ;; ++ midipix) ++ os=-midipix ++ ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 +@@ -1370,7 +1373,7 @@ case $os in + | -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* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ diff --git a/patches/gmp-5.1.3.midipix.patch b/patches/gmp-5.1.3.midipix.patch new file mode 100644 index 0000000..ecee6b9 --- /dev/null +++ b/patches/gmp-5.1.3.midipix.patch @@ -0,0 +1,22 @@ +diff -ru a/configfsf.sub b/configfsf.sub +--- a/configfsf.sub 2013-09-30 06:18:28.000000000 -0400 ++++ b/configfsf.sub 2015-05-28 00:18:19.772345286 -0400 +@@ -794,6 +794,9 @@ + microblaze*) + basic_machine=microblaze-xilinx + ;; ++ midipix) ++ os=-midipix ++ ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 +@@ -1370,7 +1373,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* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ diff --git a/patches/libelf-0.8.13.midipix.patch b/patches/libelf-0.8.13.midipix.patch new file mode 100644 index 0000000..c2ac31f --- /dev/null +++ b/patches/libelf-0.8.13.midipix.patch @@ -0,0 +1,39 @@ +diff -ru a/configure b/configure +--- a/configure 2008-05-23 04:18:03.000000000 -0400 ++++ b/configure 2015-03-10 20:32:16.332333640 -0400 +@@ -3445,6 +3445,16 @@ + LINK_SHLIB='$(LD) -G -z text -h $(SONAME)' + INSTALL_SHLIB='$(INSTALL_PROGRAM)' + ;; ++ *midipix*) ++ PICFLAGS='-fPIC -DPIC' ++ SHLIB_SFX='.so.$(VERSION)' ++ SHLINK_SFX='.so' ++ SONAME_SFX='.so.$(MAJOR)' ++ LINK_SHLIB='$(CC) -shared -Wl,-soname,$(SONAME) -mout-dsolib -moutput-def' ++ IMPLIB_NAME=libelf.`echo "so.$VERSION" | sed -E 's/[^\.]+$/lib.a/'` ++ INSTALL_SHLIB='cp $(IMPLIB_NAME) $(libdir)/libelf.lib.a; $(INSTALL_PROGRAM)' ++ DEPSHLIBS='' ++ ;; + *) + echo "configure: warning: shared libraries not supported for $host" 1>&2 + mr_enable_shared=no +@@ -3687,6 +3697,7 @@ + s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g + s%@DEPSHLIBS@%$DEPSHLIBS%g + s%@DO_SHLIB@%$DO_SHLIB%g ++s%@IMPLIB_NAME@%$IMPLIB_NAME%g + + CEOF + EOF +diff -ru a/lib/Makefile.in b/lib/Makefile.in +--- a/lib/Makefile.in 2009-11-01 08:04:19.000000000 -0500 ++++ b/lib/Makefile.in 2015-03-09 00:13:06.842232837 -0400 +@@ -49,6 +49,7 @@ + SHLINK_SFX = @SHLINK_SFX@ + SONAME_SFX = @SONAME_SFX@ + LINK_SHLIB = @LINK_SHLIB@ ++IMPLIB_NAME = @IMPLIB_NAME@ + INSTALL_SHLIB = @INSTALL_SHLIB@ + + SHLIB = libelf$(SHLIB_SFX) diff --git a/patches/libffi-3.2.1.midipix.patch b/patches/libffi-3.2.1.midipix.patch new file mode 100644 index 0000000..341f830 --- /dev/null +++ b/patches/libffi-3.2.1.midipix.patch @@ -0,0 +1,108 @@ +diff -ru --new-file a/configure b/configure +--- a/configure 2014-11-12 06:59:57.000000000 -0500 ++++ b/configure 2016-01-25 18:26:47.000000000 -0500 +@@ -17133,7 +17133,7 @@ + i?86-*-freebsd* | i?86-*-openbsd*) + TARGET=X86_FREEBSD; TARGETDIR=x86 + ;; +- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) ++ i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* | i?86-*-midipix*) + TARGET=X86_WIN32; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +@@ -17161,7 +17161,7 @@ + TARGET=X86_DARWIN; TARGETDIR=x86 + ;; + +- x86_64-*-cygwin* | x86_64-*-mingw*) ++ x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-midipix*) + TARGET=X86_WIN64; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +diff -ru --new-file a/src/closures.c b/src/closures.c +--- a/src/closures.c 2014-11-08 07:47:24.000000000 -0500 ++++ b/src/closures.c 2016-01-25 17:57:43.000000000 -0500 +@@ -26,6 +26,25 @@ + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#ifdef __midipix__ ++ ++#include ++ ++void * ffi_closure_alloc (size_t size, void ** code) ++{ ++ if (code) ++ return (*code = malloc(size)); ++ else ++ return 0; ++} ++ ++void ffi_closure_free (void * addr) ++{ ++ free(addr); ++} ++ ++#else ++ + #if defined __linux__ && !defined _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif +@@ -686,3 +705,4 @@ + + # endif /* ! FFI_MMAP_EXEC_WRIT */ + #endif /* FFI_CLOSURES */ ++#endif +diff -ru --new-file a/src/x86/ffi.c b/src/x86/ffi.c +--- a/src/x86/ffi.c 2014-11-08 07:47:24.000000000 -0500 ++++ b/src/x86/ffi.c 2016-01-25 17:52:14.000000000 -0500 +@@ -31,8 +31,12 @@ + #if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__) + + #ifdef _WIN64 ++#ifdef __midipix__ ++/* not needed */ ++#else + #include + #endif ++#endif + + #include + #include +diff -ru --new-file a/src/x86/win32.S b/src/x86/win32.S +--- a/src/x86/win32.S 2014-11-11 09:41:37.000000000 -0500 ++++ b/src/x86/win32.S 2016-01-25 18:36:49.000000000 -0500 +@@ -1344,6 +1344,14 @@ + .align 4 + .LEFDE5: + ++#ifdef __midipix__ ++ .section .got$ffi_call_win32,"r" ++ .global __imp_ffi_call_win32 ++__imp_ffi_call_win32: ++ .long ffi_call_win32 ++ .linkonce discard ++#endif ++ + #endif /* !_MSC_VER */ + + #if defined __ELF__ && defined __linux__ +diff -ru --new-file a/src/x86/win64.S b/src/x86/win64.S +--- a/src/x86/win64.S 2014-11-08 07:47:24.000000000 -0500 ++++ b/src/x86/win64.S 2016-01-25 17:47:17.000000000 -0500 +@@ -516,5 +516,15 @@ + pop %rbp + retq + .seh_endproc ++ ++ ++#ifdef __midipix__ ++ .section .got$ffi_call_win64,"r" ++ .global __imp_ffi_call_win64 ++__imp_ffi_call_win64: ++ .quad ffi_call_win64 ++ .linkonce discard ++#endif ++ + #endif /* !_MSC_VER */ + -- cgit v1.2.3