diff options
author | Janez Žemva | 2022-05-02 10:45:02 +0200 |
---|---|---|
committer | Janez Žemva | 2022-05-02 10:45:02 +0200 |
commit | 9b0b22afef06d7c5977732a42c775f50caf72ead (patch) | |
tree | 4c03a486ca4950ad2fb5c15bbb7b5a724a204a26 | |
parent | 87fd8f15f734064781b6e0ebf2759c956112a759 (diff) | |
download | aur-9b0b22afef06d7c5977732a42c775f50caf72ead.tar.gz |
some fixes
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 147 | ||||
-rw-r--r-- | gcc-djgpp.diff | 384 | ||||
-rw-r--r-- | mkmake.bash | 83 | ||||
-rw-r--r-- | watt32.pc | 4 |
5 files changed, 296 insertions, 339 deletions
@@ -1,6 +1,6 @@ pkgbase = dosbox-gcc pkgdesc = djgpp cross-compiler for the dosbox environment - pkgver = 9.2.0 + pkgver = 11.3.0 pkgrel = 1 url = http://gcc.gnu.org arch = i686 @@ -15,18 +15,14 @@ pkgbase = dosbox-gcc depends = libmpc depends = dosbox-binutils optdepends = dosbox-djcrx: headers and utilities + noextract = gcc-11.3.0.tar.xz noextract = djcrx205.zip - noextract = watt32s-2.2-dev.10.zip options = !strip options = staticlibs options = !emptydirs - source = https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz + source = https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.xz source = ftp://www.delorie.com/pub/djgpp/current/v2/djcrx205.zip - source = http://isl.gforge.inria.fr/isl-0.18.tar.xz - source = https://zlib.net/zlib-1.2.11.tar.gz - source = http://www.watt-32.net/watt32s-2.2-dev.10.zip - source = mkmake.bash - source = watt32.pc + source = https://libisl.sourceforge.io/isl-0.24.tar.xz source = gcc-djgpp.diff source = lto.patch sha256sums = SKIP @@ -34,10 +30,5 @@ pkgbase = dosbox-gcc sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP - sha256sums = SKIP - sha256sums = c03dbd61274e1ce14f84366abf348d75779bbd6e0bc32b9f4fd74f1ce54a5ef0 pkgname = dosbox-gcc - @@ -3,13 +3,10 @@ # Contributor: janezz55 pkgname=dosbox-gcc -pkgver=9.2.0 +pkgver=11.3.0 _target="i586-pc-msdosdjgpp" -_islver=0.18 +_islver=0.24 _djver=2.05 -_pthver=3.14 -_zlver=1.2.11 -_wattver="2.2-dev.10" pkgrel=1 pkgdesc="djgpp cross-compiler for the dosbox environment" arch=('i686' 'x86_64') @@ -22,70 +19,19 @@ optdepends=('dosbox-djcrx: headers and utilities') options=('!strip' 'staticlibs' '!emptydirs') source=("https://ftp.gnu.org/gnu/gcc/gcc-${pkgver}/gcc-$pkgver.tar.xz" "ftp://www.delorie.com/pub/djgpp/current/v2/djcrx${_djver//./}.zip" - "http://isl.gforge.inria.fr/isl-${_islver}.tar.xz" - "https://zlib.net/zlib-${_zlver}.tar.gz" - "http://www.watt-32.net/watt32s-${_wattver}.zip" - "mkmake.bash" - "watt32.pc" - "gcc-djgpp.diff" + "https://libisl.sourceforge.io/isl-${_islver}.tar.xz" + "gcc-djgpp.diff" "lto.patch") sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'c03dbd61274e1ce14f84366abf348d75779bbd6e0bc32b9f4fd74f1ce54a5ef0') -noextract=("djcrx${_djver//./}.zip" - "watt32s-${_wattver}.zip") + 'SKIP') +noextract=("gcc-$pkgver.tar.xz" + "djcrx${_djver//./}.zip") prepare() { - # extract bootstrap wattcp - mkdir -p watt - cd watt - unzip -qo "../watt32s-${_wattver}.zip" - - # apply felix's patches - sed -i -e ' - s,#include "/dev/env/DJDIR/include/\(.*\)",#include_next <\1>, - ' inc/sys/cdefs.h - - cd src - ln -fs chksum0.s chksum0.S - ln -fs cpumodel.s cpumodel.S - - mkdir -p djgpp - - # use standard zlib - sed -i -e 's,"zlib/zlib\.h",<zlib.h>,' pcdbug.c - sed -i -e '/define Z_PREFIX/ d' config.h - - sed -i -e ' - s,\tar,\t$(AR), - s,\.\./util/nasm32,\t$(NASM), - s,\.\./util/bin2c,\t$(BIN2C), - s,-O2,-Ofast, - ' makefile.all zlib/makefile.all - sed -i -e " - /CFLAGS/ s,=,= -fno-strict-aliasing -fgnu89-inline -march=i586 -I${srcdir}/zlib-${_zlver}, - " makefile.all zlib/makefile.all - bash "$srcdir/mkmake.bash" DJGPP RELEASE <makefile.all >djgpp.mak - - cd ../util - sed -n -e ' - $ { - i #include "errnos0.i" - x - w errnos0.c - q - }; - /_ERRNO(/ H - /<io\.h>/ d - /\(VendorName\|VendorVersion\|process\|prologue\|epilogue\) (void)\r$/,/^\}\r$/ ! { p; b }; - H - ' errnos.c > errnos1.c + tar Jxf gcc-$pkgver.tar.xz # gcc hacks cd $srcdir/gcc-$pkgver @@ -110,7 +56,12 @@ prepare() { } build() { - OLD_PATH=$PATH + export ac_cv_func_shl_load=no + export ac_cv_lib_dld_shl_load=no + export ac_cv_func_dlopen=no + export ac_cv_lib_dl_dlopen=no + export ac_cv_lib_svld_dlopen=no + export ac_cv_lib_dld_dld_link=no cd gcc-build-$_target ../gcc-$pkgver/configure \ @@ -120,67 +71,30 @@ build() { --target="$_target" \ --disable-ld \ --disable-nls \ + --disable-install-libiberty \ --disable-libssp \ --disable-libquadmath \ --disable-libquadmath-support \ --disable-libgomp \ - --disable-install-libiberty \ - --enable-decimal-float \ + --disable-libsanitizer \ + --disable-decimal-float \ --enable-gold \ --enable-languages=c,c++ \ --enable-shared \ --enable-static \ + --with-isl \ --with-system-zlib \ --with-arch=i586 \ --with-cpu=i586 \ - --enable-threads \ - --enable-libstdcxx-threads \ + --disable-threads \ + --disable-libstdcxx-pch \ + --disable-libstdcxx-threads \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ - --enable-libstdcxx-time \ + --disable-libstdcxx-time \ --disable-multilib --enable-checking=release make all-gcc - export PATH=$srcdir/gcc-build-$_target/gcc:$PATH - - # build zlib - echo ...building zlib - cd $srcdir/zlib-${_zlver} - CC=$srcdir/gcc-build-$_target/gcc/xgcc \ - CHOST=${_target} \ - CFLAGS="-march=i586 -Ofast -DHAVE_VSNPRINTF -I$srcdir/gcc-build-${_target}/lib/gcc/$_target/$pkgver/include -pipe" \ - ../zlib-${_zlver}/configure --const --prefix=/usr/$_target --static - sed -i 's/-DNO_STRERROR -DNO_vsnprintf//' Makefile - make libz.a - - # build wattcp - echo ...building wattcp - cd $srcdir/watt/util - $srcdir/gcc-build-$_target/gcc/xgcc -P -E errnos0.c \ - -include $srcdir/gcc-build-${_target}/lib/gcc/$_target/$pkgver/include/errno.h \ - -include $srcdir/gcc-build-${_target}/lib/gcc/$_target/$pkgver/include/sys/version.h \ - | sed -e '/^extern/ d' > errnos0.i - - # TCC would also do - export PATH=$OLD_PATH - gcc errnos1.c -o errnos1 - ./errnos1 -e > "../inc/sys/djgpp.err" - ./errnos1 -s > "../src/djgpp/syserr.c" - export PATH=$srcdir/gcc-build-$_target/gcc:$PATH - - cd $srcdir/watt/src - make -f djgpp.mak \ - CC=$srcdir/gcc-build-$_target/gcc/xgcc -I$srcdir/gcc-build-${_target}/lib/gcc/$_target/$pkgver/include \ - AS=$_target-as \ - AR=$_target-ar \ - NASM=/usr/bin/nasm \ - BIN2C='hexdump -ve "1/1 \"0x%02X\,\" \"\n\""' \ - DJDIR=/usr/$_target ZLIB_OBJS= - - # start building gcc again, with pthreads - echo ...back to building gcc - export PATH=$OLD_PATH - cd $srcdir/gcc-build-$_target make all } @@ -188,7 +102,6 @@ build() { package_dosbox-gcc() { echo ...installing make -C gcc-build-$_target DESTDIR="$pkgdir/" install - make -C zlib-${_zlver} DESTDIR="$pkgdir/" install # strip manually, djgpp libs spew errors otherwise strip -s "$pkgdir"/usr/bin/$_target-* @@ -202,20 +115,4 @@ package_dosbox-gcc() { rm -rf "$pkgdir"/usr/share/{man,info,locale} rm -rf "$pkgdir"/usr/lib/gcc/$_target/$pkgver/include-fixed rm -f "$pkgdir"/usr/lib/libcc1.* - - # install wattcp - cd "$srcdir/watt/inc" - - install -dm0755 "$pkgdir/usr/$_target/include/watt32" - install -m0644 *.h "$pkgdir/usr/$_target/include/watt32" - for _d in netinet6 protocol netinet net rpc rpcsvc sys arpa; do - install -dm0755 "$pkgdir/usr/$_target/include/watt32/$_d" - install -m0644 "$_d"/*.h "$pkgdir/usr/$_target/include/watt32/$_d" - done - install -dm0755 "$pkgdir/usr/$_target/include/sys" - install -m0644 sys/djgpp.err "$pkgdir/usr/$_target/include/sys/djgpp.err" - - cd "$srcdir/watt/lib" - install -Dm0644 libwatt.a "$pkgdir/usr/$_target/lib/libwatt.a" - install -Dm0644 $srcdir/watt32.pc "$pkgdir/usr/$_target/lib/pkgconfig/watt32.pc" } diff --git a/gcc-djgpp.diff b/gcc-djgpp.diff index d2d8d835dbb0..0ea548e84341 100644 --- a/gcc-djgpp.diff +++ b/gcc-djgpp.diff @@ -1,8 +1,88 @@ +diff --git a/Makefile.in b/Makefile.in +index 047be0255e2..0ba4dbaa0a2 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1378,7 +1378,6 @@ dvi-host: maybe-dvi-itcl + dvi-host: maybe-dvi-ld + dvi-host: maybe-dvi-libbacktrace + dvi-host: maybe-dvi-libcpp +-dvi-host: maybe-dvi-libcody + dvi-host: maybe-dvi-libdecnumber + dvi-host: maybe-dvi-libgui + dvi-host: maybe-dvi-libiberty +@@ -1469,7 +1468,6 @@ pdf-host: maybe-pdf-itcl + pdf-host: maybe-pdf-ld + pdf-host: maybe-pdf-libbacktrace + pdf-host: maybe-pdf-libcpp +-pdf-host: maybe-pdf-libcody + pdf-host: maybe-pdf-libdecnumber + pdf-host: maybe-pdf-libgui + pdf-host: maybe-pdf-libiberty +@@ -1560,7 +1558,6 @@ html-host: maybe-html-itcl + html-host: maybe-html-ld + html-host: maybe-html-libbacktrace + html-host: maybe-html-libcpp +-html-host: maybe-html-libcody + html-host: maybe-html-libdecnumber + html-host: maybe-html-libgui + html-host: maybe-html-libiberty +@@ -1651,7 +1648,6 @@ TAGS-host: maybe-TAGS-itcl + TAGS-host: maybe-TAGS-ld + TAGS-host: maybe-TAGS-libbacktrace + TAGS-host: maybe-TAGS-libcpp +-TAGS-host: maybe-TAGS-libcody + TAGS-host: maybe-TAGS-libdecnumber + TAGS-host: maybe-TAGS-libgui + TAGS-host: maybe-TAGS-libiberty +@@ -1742,7 +1738,6 @@ install-info-host: maybe-install-info-itcl + install-info-host: maybe-install-info-ld + install-info-host: maybe-install-info-libbacktrace + install-info-host: maybe-install-info-libcpp +-install-info-host: maybe-install-info-libcody + install-info-host: maybe-install-info-libdecnumber + install-info-host: maybe-install-info-libgui + install-info-host: maybe-install-info-libiberty +@@ -1833,7 +1828,6 @@ install-pdf-host: maybe-install-pdf-itcl + install-pdf-host: maybe-install-pdf-ld + install-pdf-host: maybe-install-pdf-libbacktrace + install-pdf-host: maybe-install-pdf-libcpp +-install-pdf-host: maybe-install-pdf-libcody + install-pdf-host: maybe-install-pdf-libdecnumber + install-pdf-host: maybe-install-pdf-libgui + install-pdf-host: maybe-install-pdf-libiberty +@@ -1924,7 +1918,6 @@ install-html-host: maybe-install-html-itcl + install-html-host: maybe-install-html-ld + install-html-host: maybe-install-html-libbacktrace + install-html-host: maybe-install-html-libcpp +-install-html-host: maybe-install-html-libcody + install-html-host: maybe-install-html-libdecnumber + install-html-host: maybe-install-html-libgui + install-html-host: maybe-install-html-libiberty +diff --git a/configure.ac b/configure.ac +index 088e735c5db..6e5dbf631c0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1465,12 +1465,12 @@ esac + # C++11 compiler can still start the bootstrap. Otherwise, if building GCC, + # require C++11 (or higher). + if test "$enable_bootstrap:$GXX" = "yes:yes"; then +- CXX="$CXX -std=c++11" ++ AX_CXX_COMPILE_STDCXX(11, [ext]) + elif test "$have_compiler" = yes; then +- AX_CXX_COMPILE_STDCXX(11) ++ AX_CXX_COMPILE_STDCXX(11, [ext]) + + if test "${build}" != "${host}"; then +- AX_CXX_COMPILE_STDCXX(11, [], [], [_FOR_BUILD]) ++ AX_CXX_COMPILE_STDCXX(11, [ext], [], [_FOR_BUILD]) + fi + fi + diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c -index 4a75b590911..651affd8eca 100644 +index 0a90c92402c..d1d0fc7b1fe 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c -@@ -249,6 +249,12 @@ char __gnat_dir_separator = DIR_SEPARATOR; +@@ -297,6 +297,12 @@ char __gnat_dir_separator = DIR_SEPARATOR; char __gnat_path_separator = PATH_SEPARATOR; @@ -15,7 +95,7 @@ index 4a75b590911..651affd8eca 100644 /* The GNAT_LIBRARY_TEMPLATE contains a list of expressions that define the base filenames that libraries specified with -lsomelib options may have. This is used by GNATMAKE to check whether an executable -@@ -555,7 +561,11 @@ __gnat_try_lock (char *dir, char *file) +@@ -596,7 +602,11 @@ __gnat_try_lock (char *dir, char *file) int __gnat_get_maximum_file_name_length (void) { @@ -28,10 +108,10 @@ index 4a75b590911..651affd8eca 100644 /* Return nonzero if file names are case sensitive. */ diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in -index de23b1410f2..aae7158b881 100644 +index d88c354c9a4..88b81133168 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in -@@ -1061,7 +1061,7 @@ ada/generated/gnatvsn.ads: ada/gnatvsn.ads BASE-VER ada/GNAT_DATE +@@ -1080,7 +1080,7 @@ ada/generated/gnatvsn.ads: ada/gnatvsn.ads BASE-VER ada/GNAT_DATE s=`cat $(srcdir)/BASE-VER | sed -e "s/\([0-9]*\)\.\([0-9]*\)\..*/-\1\2/g"`; \ d=`if test -f $(srcdir)/ada/GNAT_DATE; then \ cat $(srcdir)/ada/GNAT_DATE; else date +%Y%m%d; fi`; \ @@ -41,10 +121,10 @@ index de23b1410f2..aae7158b881 100644 ada/gnatvsn.o : ada/gnatvsn.adb ada/generated/gnatvsn.ads $(CC) -c $(ALL_ADAFLAGS) -Iada/generated -I../ada/generated $(ADA_INCLUDES) $< $(ADA_OUTPUT_OPTION) diff --git a/gcc/ada/libgnarl/s-taprop__dummy.adb b/gcc/ada/libgnarl/s-taprop__dummy.adb -index bd6387d821c..0cb49e3f553 100644 +index 7e9093a58fc..84b80d3fd61 100644 --- a/gcc/ada/libgnarl/s-taprop__dummy.adb +++ b/gcc/ada/libgnarl/s-taprop__dummy.adb -@@ -41,7 +41,7 @@ pragma Polling (Off); +@@ -37,7 +37,7 @@ package body System.Task_Primitives.Operations is use System.Tasking; @@ -54,10 +134,10 @@ index bd6387d821c..0cb49e3f553 100644 pragma Warnings (Off); -- Turn off warnings since so many unreferenced parameters diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb -index 7efddf710c6..680d6020e60 100644 +index 93522bc13eb..f61e7965fdf 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb -@@ -71,7 +71,7 @@ package body System.OS_Lib is +@@ -76,7 +76,7 @@ package body System.OS_Lib is -- The following are used by Create_Temp_File @@ -66,7 +146,7 @@ index 7efddf710c6..680d6020e60 100644 -- Used to initialize Current_Temp_File_Name and Temp_File_Name_Last_Digit Current_Temp_File_Name : String := First_Temp_File_Name; -@@ -2257,9 +2257,10 @@ package body System.OS_Lib is +@@ -2318,9 +2318,10 @@ package body System.OS_Lib is -- * Check the drive letter -- * Remove all double-quotes @@ -80,10 +160,10 @@ index 7efddf710c6..680d6020e60 100644 if Path_Buffer (Index) = '/' then Path_Buffer (Index) := Directory_Separator; diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads -index 8b21aa7de70..58b81351ff4 100644 +index f786cca8143..756766d4e71 100644 --- a/gcc/ada/libgnat/s-os_lib.ads +++ b/gcc/ada/libgnat/s-os_lib.ads -@@ -1082,9 +1082,12 @@ package System.OS_Lib is +@@ -1091,9 +1091,12 @@ package System.OS_Lib is Path_Separator : constant Character; -- The character to separate paths in an environment variable value @@ -96,11 +176,24 @@ index 8b21aa7de70..58b81351ff4 100644 pragma Import (C, Current_Time, "__gnat_current_time"); pragma Import (C, Current_Process_Id, "__gnat_current_process_id"); +diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c +index 582c35ef7db..647ca3f88f4 100644 +--- a/gcc/ada/s-oscons-tmplt.c ++++ b/gcc/ada/s-oscons-tmplt.c +@@ -121,7 +121,7 @@ pragma Style_Checks ("M32766"); + **/ + + # include <vxWorks.h> +-#elif !defined(__MINGW32__) ++#elif !defined(__MINGW32__) && !defined(__DJGPP__) + #include <poll.h> + #endif + diff --git a/gcc/collect2.c b/gcc/collect2.c -index eb84f84639b..ba7291f293b 100644 +index bd371430ab7..e925d83b004 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c -@@ -1235,21 +1235,30 @@ main (int argc, char **argv) +@@ -1189,18 +1189,27 @@ main (int argc, char **argv) *ld1++ = *ld2++ = ld_file_name; /* Make temp file names. */ @@ -115,18 +208,13 @@ index eb84f84639b..ba7291f293b 100644 + if (save_temps) { - c_file = (char *) xmalloc (strlen (output_file) -- + sizeof (".cdtor.c") + 1); -+ + sizeof (CDTOR_C_NAME) + 1); - strcpy (c_file, output_file); -- strcat (c_file, ".cdtor.c"); -+ strcat (c_file, CDTOR_C_NAME); - o_file = (char *) xmalloc (strlen (output_file) -- + sizeof (".cdtor.o") + 1); -+ + sizeof (CDTOR_O_NAME) + 1); - strcpy (o_file, output_file); -- strcat (o_file, ".cdtor.o"); -+ strcat (o_file, CDTOR_O_NAME); +- c_file = concat (output_file, ".cdtor.c", NULL); +- o_file = concat (output_file, ".cdtor.o", NULL); ++ c_file = concat (output_file, CDTOR_C_NAME, NULL); ++ o_file = concat (output_file, CDTOR_O_NAME, NULL); + #ifdef COLLECT_EXPORT_LIST + export_file = concat (output_file, ".x", NULL); + #endif } else { @@ -134,11 +222,24 @@ index eb84f84639b..ba7291f293b 100644 - o_file = make_temp_file (".cdtor.o"); + c_file = make_temp_file (CDTOR_C_NAME); + o_file = make_temp_file (CDTOR_O_NAME); - } #ifdef COLLECT_EXPORT_LIST - export_file = make_temp_file (".x"); + export_file = make_temp_file (".x"); + #endif +diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c +index 4d9548aed8d..dca15602642 100644 +--- a/gcc/config/i386/djgpp.c ++++ b/gcc/config/i386/djgpp.c +@@ -36,6 +36,8 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, + *f++ = 'w'; + if (flags & SECTION_CODE) + *f++ = 'x'; ++ if (flags & SECTION_BSS) ++ *f++ = 'b'; + + /* LTO sections need 1-byte alignment to avoid confusing the + zlib decompression algorithm with trailing zero pad bytes. */ diff --git a/gcc/config/i386/xm-djgpp.h b/gcc/config/i386/xm-djgpp.h -index 8cb8bc6939c..6e152a69bfc 100644 +index f53b348ad4b..fc17fc89f88 100644 --- a/gcc/config/i386/xm-djgpp.h +++ b/gcc/config/i386/xm-djgpp.h @@ -30,6 +30,8 @@ along with GCC; see the file COPYING3. If not see @@ -162,8 +263,21 @@ index 8cb8bc6939c..6e152a69bfc 100644 #undef MAX_OFILE_ALIGNMENT #define MAX_OFILE_ALIGNMENT 128 +diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc +index b9e02168d55..0fb15fd0c7b 100644 +--- a/gcc/cp/mapper-client.cc ++++ b/gcc/cp/mapper-client.cc +@@ -19,7 +19,7 @@ along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + + #include "config.h" +-#if defined (__unix__) ++#if defined (__unix__) && !defined(__DJGPP__) + // Solaris11's socket header used bcopy, which we poison. cody.hh + // will include it later under the above check + #include <sys/socket.h> diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c -index 5bb1ccac6be..161da5caed3 100644 +index 71bdfdaa1f0..31bd5b1733f 100644 --- a/gcc/gcov-tool.c +++ b/gcc/gcov-tool.c @@ -56,11 +56,18 @@ static bool verbose; @@ -197,8 +311,25 @@ index 5bb1ccac6be..161da5caed3 100644 #else return -1; #endif +diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c +index 357bda13f97..db375610751 100644 +--- a/gcc/ggc-common.c ++++ b/gcc/ggc-common.c +@@ -31,6 +31,12 @@ along with GCC; see the file COPYING3. If not see + #include "plugin.h" + #include "options.h" + ++#ifdef __DJGPP__ ++extern "C" { ++#include <libc/malldbg.h> ++} ++#endif ++ + /* When set, ggc_collect will do collection. */ + bool ggc_force_collect; + diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h -index 4767d7b9dfb..15e83f703a4 100644 +index a0cbd7fb0d8..cf71ac8b695 100644 --- a/gcc/ginclude/float.h +++ b/gcc/ginclude/float.h @@ -25,6 +25,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -213,7 +344,7 @@ index 4767d7b9dfb..15e83f703a4 100644 #define _FLOAT_H___ diff --git a/include/libiberty.h b/include/libiberty.h -index 57476135026..276cc7a4981 100644 +index f4c0fe11d6f..e1a28b83cce 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -108,6 +108,7 @@ extern int countargv (char * const *); @@ -224,11 +355,28 @@ index 57476135026..276cc7a4981 100644 || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME) extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); #else +diff --git a/libcody/cody.hh b/libcody/cody.hh +index 789ce9e70b7..8794e4dd8e6 100644 +--- a/libcody/cody.hh ++++ b/libcody/cody.hh +@@ -20,6 +20,12 @@ + #endif + #endif + ++// Do not use networking for DJGPP even if it defines __unix__ ++#ifdef __DJGPP__ ++#undef CODY_NETWORKING ++#define CODY_NETWORKING 0 ++#endif ++ + // C++ + #include <memory> + #include <string> diff --git a/libcpp/files.c b/libcpp/files.c -index b0ac22be6ba..0ad0403c050 100644 +index 6e20fc5887f..44fd90f83af 100644 --- a/libcpp/files.c +++ b/libcpp/files.c -@@ -740,6 +740,10 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file, location_t loc) +@@ -742,6 +742,10 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file, location_t loc) cpp_error_at (pfile, CPP_DL_WARNING, loc, "%s is shorter than expected", file->path); @@ -240,7 +388,7 @@ index b0ac22be6ba..0ad0403c050 100644 CPP_OPTION (pfile, input_charset), buf, size + 16, total, diff --git a/libcpp/lex.c b/libcpp/lex.c -index eedfcbb3146..fab1e12c9d2 100644 +index 06bcc31c87e..ae28ac4ff4b 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -502,6 +502,13 @@ init_vectorized_lexer (void) @@ -266,44 +414,6 @@ index eedfcbb3146..fab1e12c9d2 100644 search_line_fast = impl; } -diff --git a/libcpp/macro.c b/libcpp/macro.c -index 30d3686451c..57d4de1e993 100644 ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -516,17 +516,22 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node, - && pfile->cb.get_source_date_epoch != NULL) - pfile->source_date_epoch = pfile->cb.get_source_date_epoch (pfile); - -- if (pfile->source_date_epoch >= (time_t) 0) -- tb = gmtime (&pfile->source_date_epoch); -- else -- { -- /* (time_t) -1 is a legitimate value for "number of seconds -- since the Epoch", so we have to do a little dance to -- distinguish that from a genuine error. */ -- errno = 0; -- tt = time (NULL); -- if (tt != (time_t)-1 || errno == 0) -- tb = localtime (&tt); -+ switch (pfile->source_date_epoch) -+ { -+ default: -+ tb = gmtime (&pfile->source_date_epoch); -+ break; -+ -+ case (time_t) -1: -+ case (time_t) -2: -+ /* (time_t) -1 is a legitimate value for "number of seconds -+ since the Epoch", so we have to do a little dance to -+ distinguish that from a genuine error. */ -+ errno = 0; -+ tt = time (NULL); -+ if (tt != (time_t)-1 || errno == 0) -+ tb = localtime (&tt); -+ break; - } - - if (tb) diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index 78f245bda07..1ae18b248a7 100644 --- a/libffi/src/x86/sysv.S @@ -318,10 +428,10 @@ index 78f245bda07..1ae18b248a7 100644 #elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) .section .eh_frame,EH_FRAME_FLAGS,@unwind diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c -index ae0dd017204..08b04d292a2 100644 +index bc7416d99bf..3a47764bfa5 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c -@@ -391,7 +391,11 @@ read_gcda_file (const char *filename) +@@ -389,7 +389,11 @@ read_gcda_file (const char *filename) static int ftw_read_file (const char *filename, @@ -333,8 +443,24 @@ index ae0dd017204..08b04d292a2 100644 int type) { int filename_len; +diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h +index 7b0d367ec52..a8be4f0be22 100644 +--- a/libgcc/libgcov.h ++++ b/libgcc/libgcov.h +@@ -45,6 +45,11 @@ + #include "libgcc_tm.h" + #include "gcov.h" + ++#ifdef __DJGPP__ ++#include <stdint.h> ++#undef HAVE_SYS_MMAN_H ++#endif // __DJGPP__ ++ + #if HAVE_SYS_MMAN_H + #include <sys/mman.h> + #endif diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c -index 9bfe52439f3..d116e89adde 100644 +index 8b5140a05a3..6e7a2afb032 100644 --- a/libgfortran/intrinsics/chmod.c +++ b/libgfortran/intrinsics/chmod.c @@ -442,7 +442,7 @@ clause_done: @@ -365,29 +491,20 @@ index 9bfe52439f3..d116e89adde 100644 file_mode |= S_ISVTX; else if (!is_dir) diff --git a/libgfortran/intrinsics/execute_command_line.c b/libgfortran/intrinsics/execute_command_line.c -index 1a471632172..5956fbfd7bd 100644 +index 5d41667df9e..439738b6bf1 100644 --- a/libgfortran/intrinsics/execute_command_line.c +++ b/libgfortran/intrinsics/execute_command_line.c -@@ -65,7 +65,7 @@ set_cmdstat (int *cmdstat, int value) - } +@@ -98,7 +98,7 @@ execute_command_line (const char *command, bool wait, int *exitstat, + set_cmdstat (cmdstat, EXEC_NOERROR); --#if defined(HAVE_WAITPID) && defined(HAVE_SIGACTION) -+#if defined(HAVE_WAITPID) && defined(HAVE_SIGACTION) && !defined(__DJGPP__) - static void - sigchld_handler (int signum __attribute__((unused))) - { -@@ -85,7 +85,7 @@ execute_command_line (const char *command, bool wait, int *exitstat, - /* Flush all I/O units before executing the command. */ - flush_all_units(); - --#if defined(HAVE_POSIX_SPAWN) || defined(HAVE_FORK) -+#if (defined(HAVE_POSIX_SPAWN) || defined(HAVE_FORK)) && !defined(__DJGPP__) - if (!wait) - { - /* Asynchronous execution. */ +-#if defined(HAVE_SIGACTION) && defined(HAVE_WAITPID) ++#if defined(HAVE_SIGACTION) && defined(HAVE_WAITPID) && !defined(__DJGPP__) + static bool sig_init_saved; + bool sig_init = __atomic_load_n (&sig_init_saved, __ATOMIC_RELAXED); + if (!sig_init) diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c -index 42792976c4b..3418a4af1e9 100644 +index b127cf7a32d..f293cff6ae0 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -221,6 +221,9 @@ typedef struct @@ -429,7 +546,7 @@ index 42792976c4b..3418a4af1e9 100644 return NULL; diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c -index ec0b0ee7494..1ed86db2a09 100644 +index ef932ff022e..401800baa3d 100644 --- a/libiberty/make-relative-prefix.c +++ b/libiberty/make-relative-prefix.c @@ -65,6 +65,7 @@ relative prefix can be found, return @code{NULL}. @@ -440,7 +557,7 @@ index ec0b0ee7494..1ed86db2a09 100644 #ifndef R_OK #define R_OK 4 -@@ -337,7 +338,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, +@@ -340,7 +341,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, { for (i = 0; i < bin_num; i++) { @@ -449,7 +566,7 @@ index ec0b0ee7494..1ed86db2a09 100644 break; } -@@ -353,7 +354,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, +@@ -356,7 +357,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, n = (prefix_num < bin_num) ? prefix_num : bin_num; for (common = 0; common < n; common++) { @@ -459,7 +576,7 @@ index ec0b0ee7494..1ed86db2a09 100644 } diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c -index 2c66e35cc1f..f058c39dc3d 100644 +index 7465cec5ea6..f60a441eb6a 100644 --- a/libiberty/make-temp-file.c +++ b/libiberty/make-temp-file.c @@ -47,6 +47,7 @@ Boston, MA 02110-1301, USA. */ @@ -481,7 +598,7 @@ index 2c66e35cc1f..f058c39dc3d 100644 memoized_tmpdir = tmpdir; #else /* defined(_WIN32) && !defined(__CYGWIN__) */ diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c -index 3d49f339631..75f2ca4e2f4 100644 +index a421177f0c2..c166621b931 100644 --- a/libiberty/simple-object-elf.c +++ b/libiberty/simple-object-elf.c @@ -1293,7 +1293,9 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, @@ -517,8 +634,30 @@ index 32ebcec928c..96498b7c408 100644 #define L_(x) L##x #else #define L_(x) x +diff --git a/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc +index 8a63099c941..f3d4d7c7239 100644 +--- a/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc ++++ b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc +@@ -45,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), +- _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), ++ _M_toupper(__dj_ctype_toupper+1), _M_tolower(__dj_ctype_tolower+1), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); +@@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), +- _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), ++ _M_toupper(__dj_ctype_toupper+1), _M_tolower(__dj_ctype_tolower+1), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h -index 7b8810d62f1..9795a81aa70 100644 +index e538d38d9de..434de1601e4 100644 --- a/libstdc++-v3/config/os/djgpp/error_constants.h +++ b/libstdc++-v3/config/os/djgpp/error_constants.h @@ -33,6 +33,15 @@ @@ -537,17 +676,14 @@ index 7b8810d62f1..9795a81aa70 100644 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -@@ -118,9 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - // not_connected = ENOTCONN, - not_enough_memory = ENOMEM, - --#ifdef _GLIBCXX_HAVE_ENOTSUP +@@ -122,16 +131,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION not_supported = ENOTSUP, --#endif + #endif - #ifdef _GLIBCXX_HAVE_ECANCELED +-#ifdef ECANCELED ++#ifdef _GLIBCXX_HAVE_ECANCELED operation_canceled = ECANCELED, -@@ -128,7 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + #endif // operation_in_progress = EINPROGRESS, operation_not_permitted = EPERM, @@ -555,9 +691,13 @@ index 7b8810d62f1..9795a81aa70 100644 + operation_not_supported = EOPNOTSUPP, // operation_would_block = EWOULDBLOCK, - #ifdef _GLIBCXX_HAVE_EOWNERDEAD +-#ifdef EOWNERDEAD ++#ifdef _GLIBCXX_HAVE_EOWNERDEAD + owner_dead = EOWNERDEAD, + #endif + diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h -index 64089b432eb..f6b287d8d55 100644 +index 2df2bba3dcd..3a732171390 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -53,6 +53,11 @@ @@ -572,7 +712,7 @@ index 64089b432eb..f6b287d8d55 100644 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -@@ -493,6 +498,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 +@@ -523,6 +528,8 @@ namespace __detail { #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS return __ch == L'/' || __ch == preferred_separator; @@ -581,7 +721,7 @@ index 64089b432eb..f6b287d8d55 100644 #else return __ch == '/'; #endif -@@ -874,6 +881,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 +@@ -971,6 +978,9 @@ namespace __detail #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS std::replace(_M_pathname.begin(), _M_pathname.end(), L'/', preferred_separator); @@ -591,7 +731,7 @@ index 64089b432eb..f6b287d8d55 100644 #endif return *this; } -@@ -1075,7 +1085,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 +@@ -1194,7 +1204,7 @@ namespace __detail inline bool path::is_absolute() const { @@ -600,8 +740,24 @@ index 64089b432eb..f6b287d8d55 100644 return has_root_name() && has_root_directory(); #else return has_root_directory(); +diff --git a/libstdc++-v3/src/c++11/shared_ptr.cc b/libstdc++-v3/src/c++11/shared_ptr.cc +index 4678fbeffe2..18a68a16025 100644 +--- a/libstdc++-v3/src/c++11/shared_ptr.cc ++++ b/libstdc++-v3/src/c++11/shared_ptr.cc +@@ -35,7 +35,11 @@ namespace __gnu_internal _GLIBCXX_VISIBILITY(hidden) + get_mutex(unsigned char i) + { + // increase alignment to put each lock on a separate cache line ++#ifdef __DJGPP__ ++ struct M : __gnu_cxx::__mutex { }; ++#else + struct alignas(64) M : __gnu_cxx::__mutex { }; ++#endif + static M m[mask + 1]; + return m[i]; + } diff --git a/libstdc++-v3/src/filesystem/path.cc b/libstdc++-v3/src/filesystem/path.cc -index edf7c67c01b..af343bcee28 100644 +index a935573740f..9cd2e9898b2 100644 --- a/libstdc++-v3/src/filesystem/path.cc +++ b/libstdc++-v3/src/filesystem/path.cc @@ -408,8 +408,13 @@ path::_M_split_cmpts() diff --git a/mkmake.bash b/mkmake.bash deleted file mode 100644 index 526878edb29f..000000000000 --- a/mkmake.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -stack=(t) - -ctest() { - [[ "${stack[0]}" = "$1" ]] - return "$?" -} - -cpush() { - stack=("$1" "${stack[@]}") -} - -cpop() { - stack=("${stack[@]:1}") -} - -cswap() { - stack[0]="$1" -} - -ceval() { - local test="$1" - shift - - local item - for item in "$@"; do - if [[ -n "${!item}" ]]; then - ! [[ "$test" = *ndef ]] - return "$?" - fi - done - - [[ "$test" = *ndef ]] - return "$?" -} - -for item in "$@"; do - eval "$item=1" -done - -while IFS=$'\r' read -r line; do - case "$line" in - @ifdef*|@ifndef*) - if ctest t; then - if ceval $line; then - cpush t - else - cpush w - fi - else - cpush e - fi - ;; - @elifdef*|@elifndef*) - if ctest w; then - if ceval $line; then - cswap t - else - cswap w - fi - else - cswap e - fi - ;; - @else*) - if ctest w; then - cswap t - else - cswap e - fi - ;; - @endif*) - cpop - ;; - *) - if ctest t; then - echo "$line" - fi - ;; - esac -done - -exit 0 diff --git a/watt32.pc b/watt32.pc deleted file mode 100644 index 9d077adf6410..000000000000 --- a/watt32.pc +++ /dev/null @@ -1,4 +0,0 @@ -Name: Watt-32 -Version: 2.2-dev.10 -Cflags: -I/usr/i686-pc-msdosdjgpp/include/watt32 -Libs: -lwatt -lz |