From 08163f0587b4807e32a9fc0e4a887c8d45a641d1 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 28 Jun 2013 15:44:38 -0500 Subject: cygwin-gcc 4.7.3 --- classpath-0.98-awt.patch | 76 - config-rpath.patch | 11 - cygwin-gcc.spec | 572 +++---- gcc45-ada.diff | 3512 ----------------------------------------- gcc45-cross-ecjx.patch | 42 - gcc45-cross-exe-suffix.diff | 4 +- gcc45-ehdebug.diff | 157 -- gcc45-gc-win32-threads.diff | 20 - gcc45-libffi.diff | 63 - gcc45-libstdc.diff | 791 ---------- gcc45-misc-core.diff | 54 - gcc45-mnocygwin.diff | 120 -- gcc45-peflags.diff | 12 - gcc45-sig-unwind.diff | 90 -- gcc47-ada.patch | 3269 ++++++++++++++++++++++++++++++++++++++ gcc47-boehm-gc-cygwin.patch | 57 + gcc47-cross-ecjx.patch | 52 + gcc47-cross-jardir.patch | 22 + gcc47-execstack.patch | 50 + gcc47-java-jni.patch | 56 + gcc47-libffi-noinst.patch | 53 + gcc47-libstdc.patch | 671 ++++++++ gcc47-misc-core.patch | 27 + gcc47-specs.patch | 87 + gcc48-lto-plugin-soname.patch | 50 + sources | 2 +- 26 files changed, 4684 insertions(+), 5236 deletions(-) delete mode 100644 classpath-0.98-awt.patch delete mode 100644 config-rpath.patch delete mode 100644 gcc45-ada.diff delete mode 100644 gcc45-cross-ecjx.patch delete mode 100644 gcc45-ehdebug.diff delete mode 100644 gcc45-gc-win32-threads.diff delete mode 100644 gcc45-libffi.diff delete mode 100644 gcc45-libstdc.diff delete mode 100644 gcc45-misc-core.diff delete mode 100644 gcc45-mnocygwin.diff delete mode 100644 gcc45-peflags.diff delete mode 100644 gcc45-sig-unwind.diff create mode 100644 gcc47-ada.patch create mode 100644 gcc47-boehm-gc-cygwin.patch create mode 100644 gcc47-cross-ecjx.patch create mode 100644 gcc47-cross-jardir.patch create mode 100644 gcc47-execstack.patch create mode 100644 gcc47-java-jni.patch create mode 100644 gcc47-libffi-noinst.patch create mode 100644 gcc47-libstdc.patch create mode 100644 gcc47-misc-core.patch create mode 100644 gcc47-specs.patch create mode 100644 gcc48-lto-plugin-soname.patch diff --git a/classpath-0.98-awt.patch b/classpath-0.98-awt.patch deleted file mode 100644 index cd11702..0000000 --- a/classpath-0.98-awt.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- origsrc/gcc-4.5.0/libjava/classpath//examples/gnu/classpath/examples/awt/HintingDemo.java 2007-05-08 07:41:25.000000000 -0500 -+++ src/gcc-4.5.0/libjava/classpath//examples/gnu/classpath/examples/awt/HintingDemo.java 2009-12-06 01:58:25.091013300 -0600 -@@ -211,7 +211,7 @@ public class HintingDemo extends JFrame - - HintingDemo() - { -- File file = new File("/usr/share/fonts/truetype/freefont/FreeSans.ttf"); -+ File file = new File("/usr/share/fonts/TTF/Vera.ttf"); - loadFont(file); - setLayout(new BorderLayout()); - chooser = new Chooser(); ---- origsrc/gcc-4.5.0/libjava/classpath//gnu/java/awt/peer/ClasspathDesktopPeer.java 2007-03-02 15:01:39.000000000 -0600 -+++ src/gcc-4.5.0/libjava/classpath//gnu/java/awt/peer/ClasspathDesktopPeer.java 2009-12-06 01:58:25.106613400 -0600 -@@ -58,7 +58,7 @@ public class ClasspathDesktopPeer - implements DesktopPeer - { - /** This is the fallback browser, if no desktop was detected. */ -- protected static final String _DEFAULT_BROWSER = "firefox"; -+ protected static final String _DEFAULT_BROWSER = "xdg-open"; - - /** gnu.java.awt.peer.Desktop.html.command */ - protected static final String _BROWSE = "html"; ---- origsrc/gcc-4.5.0/libjava/classpath//gnu/java/awt/peer/ClasspathFontPeer.java 2007-06-25 06:25:51.000000000 -0500 -+++ src/gcc-4.5.0/libjava/classpath//gnu/java/awt/peer/ClasspathFontPeer.java 2009-12-06 02:11:16.137745300 -0600 -@@ -158,6 +158,8 @@ public abstract class ClasspathFontPeer - - protected static boolean isLogicalFontName(String name) - { -+ return false; -+/* - String uname = name.toUpperCase (); - return (uname.equals ("SANSSERIF") || - uname.equals ("SERIF") || -@@ -165,6 +167,7 @@ public abstract class ClasspathFontPeer - uname.equals ("DIALOG") || - uname.equals ("DIALOGINPUT") || - uname.equals ("DEFAULT")); -+*/ - } - - protected static String logicalFontNameToFaceName (String name) ---- origsrc/gcc-4.5.0/libjava/classpath//resource/gnu/java/awt/font/fonts.properties 2007-09-20 09:01:05.000000000 -0500 -+++ src/gcc-4.5.0/libjava/classpath//resource/gnu/java/awt/font/fonts.properties 2009-12-06 01:58:25.122213400 -0600 -@@ -36,20 +36,20 @@ - # exception statement from your version. - - # List of available fonts. --FreeMono/p=/usr/share/fonts/truetype/freefont/FreeMono.ttf --FreeMono/b=/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf --FreeMono/bi=/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf --FreeMono/i=/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf -+FreeMono/p=/usr/share/fonts/TTF/VeraMono.ttf -+FreeMono/b=/usr/share/fonts/TTF/VeraMoBd.ttf -+FreeMono/bi=/usr/share/fonts/TTF/VeraMoBI.ttf -+FreeMono/i=/usr/share/fonts/TTF/VeraMoIt.ttf - --FreeSans/p=/usr/share/fonts/truetype/freefont/FreeSans.ttf --FreeSans/b=/usr/share/fonts/truetype/freefont/FreeSansBold.ttf --FreeSans/bi=/usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf --FreeSans/i=/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf -+FreeSans/p=/usr/share/fonts/TTF/Vera.ttf -+FreeSans/b=/usr/share/fonts/TTF/VeraBd.ttf -+FreeSans/bi=/usr/share/fonts/TTF/VeraBI.ttf -+FreeSans/i=/usr/share/fonts/TTF/VeraIt.ttf - --FreeSerif/p=/usr/share/fonts/truetype/freefont/FreeSerif.ttf --FreeSerif/b=/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf --FreeSerif/bi=/usr/share/fonts/truetype/freefont/FreeSerifBoldOblique.ttf --FreeSerif/i=/usr/share/fonts/truetype/freefont/FreeSerifOblique.ttf -+FreeSerif/p=/usr/share/fonts/TTF/VeraSe.ttf -+FreeSerif/b=/usr/share/fonts/TTF/VeraSeBd.ttf -+FreeSerif/bi=/usr/share/fonts/TTF/VeraSeBd.ttf -+FreeSerif/i=/usr/share/fonts/TTF/VeraSe.ttf - - # List of aliases. - Dialog/a=FreeSans diff --git a/config-rpath.patch b/config-rpath.patch deleted file mode 100644 index 0f05fa0..0000000 --- a/config-rpath.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/config.rpath 2008-03-13 14:27:44.000000000 -0500 -+++ b/config.rpath 2010-07-11 23:30:45.209832800 -0500 -@@ -441,7 +441,7 @@ case "$host_os" in - bsdi4*) - ;; - cygwin* | mingw* | pw32*) -- shrext=.dll -+ shrext=.dll.a - ;; - darwin* | rhapsody*) - shrext=.dylib diff --git a/cygwin-gcc.spec b/cygwin-gcc.spec index 768ccff..41f00e3 100644 --- a/cygwin-gcc.spec +++ b/cygwin-gcc.spec @@ -1,15 +1,15 @@ %global gcc_major 4 -%global gcc_minor 5 +%global gcc_minor 7 %global gcc_micro 3 %global gcc_branch %{gcc_major}.%{gcc_minor} %global gcc_version %{gcc_major}.%{gcc_minor}.%{gcc_micro} # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 4 +%global gcc_release 1 %global build_ada 0 # building cross-gnat requires matching X.Y version of native gnat -%if 0%{?fedora} == 14 +%if 0%{?fedora} >= 17 && 0%{?fedora} < 19 %ifarch %{ix86} x86_64 ia64 ppc ppc64 alpha %global build_ada 1 %endif @@ -29,15 +29,15 @@ URL: http://gcc.gnu.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: texinfo -BuildRequires: cygwin-filesystem -BuildRequires: cygwin-binutils -BuildRequires: cygwin -BuildRequires: cygwin-w32api-headers -BuildRequires: cygwin-w32api-libs +BuildRequires: cygwin32-filesystem +BuildRequires: cygwin32-binutils +BuildRequires: cygwin32 +BuildRequires: cygwin32-w32api-headers +BuildRequires: cygwin32-w32api-runtime BuildRequires: gmp-devel BuildRequires: mpfr-devel BuildRequires: libmpc-devel -BuildRequires: ppl-devel >= 0.10 +BuildRequires: ppl-devel >= 0.11 BuildRequires: cloog-ppl-devel >= 0.15 BuildRequires: zlib-devel BuildRequires: flex @@ -45,180 +45,189 @@ BuildRequires: flex BuildRequires: gcc-gnat %endif %if %{build_java} -BuildRequires: cygwin-libiconv -BuildRequires: cygwin-zlib +BuildRequires: cygwin32-libiconv +BuildRequires: cygwin32-zlib BuildRequires: gcc-c++ BuildRequires: gcc-java %endif -# NB: Explicit cygwin-filesystem dependency is REQUIRED here. -Requires: cygwin-filesystem -Requires: cygwin-binutils -Requires: cygwin -Requires: cygwin-w32api-libs -Requires: cygwin-cpp +Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2 +Patch1: gcc47-ada.patch +Patch3: gcc47-libffi-noinst.patch +Patch4: gcc47-libstdc.patch +Patch7: gcc47-cross-jardir.patch +Patch8: gcc45-cross-libstdc.patch +Patch9: gcc47-cross-ecjx.patch +Patch10: gcc45-java-FIONREAD.diff +Patch13: gcc45-cross-exe-suffix.diff +Patch14: gcc47-boehm-gc-cygwin.patch +Patch15: gcc47-execstack.patch +Patch16: gcc47-java-jni.patch +Patch17: gcc47-specs.patch +Patch19: gcc48-lto-plugin-soname.patch + +%description +Cygwin cross-compiler (GCC) suite. + + +%package -n cygwin32-gcc +Summary: Cygwin cross-compiler for C +Group: Development/Languages +# NB: Explicit cygwin32-filesystem dependency is REQUIRED here. +Requires: cygwin32-filesystem +Requires: cygwin32-binutils +Requires: cygwin32 +Requires: cygwin32-w32api-runtime +Requires: cygwin32-cpp # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: +Provides: cygwin32(cyggcc_s-1.dll) +Provides: cygwin32(cyggomp-1.dll) +Provides: cygwin32(cygquadmath-0.dll) +Provides: cygwin32(cygssp-0.dll) +# for backwards compatibility (libquadmath is new to 4.7) Provides: cygwin(cyggcc_s-1.dll) Provides: cygwin(cyggomp-1.dll) Provides: cygwin(cygssp-0.dll) -%if %{build_java} -Provides: cygwin(cygffi-4.dll) -%endif - -Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2 -Patch0: config-rpath.patch -Patch1: gcc45-ada.diff -Patch2: gcc45-ehdebug.diff -Patch3: gcc45-libffi.diff -Patch4: gcc45-libstdc.diff -Patch5: gcc45-misc-core.diff -Patch6: gcc45-mnocygwin.diff -Patch7: gcc45-sig-unwind.diff -Patch8: gcc45-cross-libstdc.patch -Patch9: gcc45-cross-ecjx.patch -Patch10: gcc45-java-FIONREAD.diff -Patch11: classpath-0.98-awt.patch -Patch12: gcc45-peflags.diff -Patch13: gcc45-cross-exe-suffix.diff -Patch14: gcc45-gc-win32-threads.diff +Provides: %{name} = %{version}-%{release} +Obsoletes: %{name} < 4.7 -%description -Cygwin cross-compiler (GCC) for C. +%description -n cygwin32-gcc +Cygwin i686 cross-compiler (GCC) for C. -%package -n cygwin-cpp -Summary: Cygwin cross-C Preprocessor -Group: Development/Languages +%package -n cygwin32-cpp +Summary: Cygwin cross-C Preprocessor +Group: Development/Languages +Provides: cygwin-cpp = %{version}-%{release} +Obsoletes: cygwin-cpp < 4.7 -%description -n cygwin-cpp +%description -n cygwin32-cpp Cygwin cross-C Preprocessor -%package c++ +%package -n cygwin32-gcc-c++ Summary: Cygwin cross-compiler for C++ Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Requires: cygwin32-gcc = %{version}-%{release} # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: -Provides: cygwin(cygstdc++-6.dll) +Provides: cygwin32(cygstdc++-6.dll) +# for backwards compatibility +Provides: cygwin(cygstdc++-6.dll) +Provides: %{name}-c++ = %{version}-%{release} +Obsoletes: %{name}-c++ < 4.7 -%description c++ +%description -n cygwin32-gcc-c++ Cygwin cross-compiler for C++. -%package objc +%package -n cygwin32-gcc-objc Summary: Cygwin cross-compiler support for Objective C Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Requires: cygwin32-gcc = %{version}-%{release} # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: -Provides: cygwin(cygobjc-2.dll) +Provides: cygwin32(cygobjc-4.dll) +# for backwards compatibility (libobjc ABI version changed in 4.7) +Provides: %{name}-objc = %{version}-%{release} +Obsoletes: %{name}-objc < 4.7 -%description objc +%description -n cygwin32-gcc-objc Cygwin cross-compiler support for Objective C. -%package objc++ +%package -n cygwin32-gcc-objc++ Summary: Cygwin cross-compiler support for Objective C++ Group: Development/Languages -Requires: %{name}-c++ = %{version}-%{release} -Requires: %{name}-objc = %{version}-%{release} +Requires: cygwin32-gcc-c++ = %{version}-%{release} +Requires: cygwin32-gcc-objc = %{version}-%{release} +Provides: %{name}-objc++ = %{version}-%{release} +Obsoletes: %{name}-objc++ < 4.7 -%description objc++ +%description -n cygwin32-gcc-objc++ Cygwin cross-compiler support for Objective C++. -%package gfortran +%package -n cygwin32-gcc-gfortran Summary: Cygwin cross-compiler for FORTRAN Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Requires: cygwin32-gcc = %{version}-%{release} # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: -Provides: cygwin(cyggfortran-3.dll) +Provides: cygwin32(cyggfortran-3.dll) +# for backwards compatibilty +Provides: cygwin(cyggfortran-3.dll) +Provides: %{name}-gfortran = %{version}-%{release} +Obsoletes: %{name}-gfortran < 4.7 -%description gfortran +%description -n cygwin32-gcc-gfortran Cygwin cross-compiler for FORTRAN. -%package gnat +%package -n cygwin32-gcc-gnat Summary: Cygwin cross-compiler for Ada Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Requires: cygwin32-gcc = %{version}-%{release} # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: # (shared libgnat doesn't work quite right, nor does it cross-build -#Provides: cygwin(cyggnat-4.5.dll) -#Provides: cygwin(cyggnarl-4.5.dll) +#Provides: cygwin32(cyggnat-4.7.dll) +#Provides: cygwin32(cyggnarl-4.7.dll) +# for backwards compatibility +Provides: %{name}-gnat = %{version}-%{release} +Obsoletes: %{name}-gnat < 4.7 -%description gnat +%description -n cygwin32-gcc-gnat Cygwin cross-compiler for Ada. -%package java +%package -n cygwin32-gcc-java Summary: Cygwin cross-compiler for Java Group: Development/Languages -Requires: %{name} = %{version}-%{release} +Requires: cygwin32-gcc = %{version}-%{release} Requires: ecj -Requires: cygwin-libiconv -Requires: cygwin-zlib +Requires: cygwin32-libiconv +Requires: cygwin32-zlib # We don't run the automatic dependency scripts which would # normally detect and provide the following DLL: -Provides: cygwin(cyggcj-11.dll) -Provides: cygwin(cyggcj-noncore-11.dll) -Provides: cygwin(cyggcj-tools-11.dll) -Provides: cygwin(cyggij-11.dll) -Provides: cygwin(cygjvm.dll) - -%description java +Provides: cygwin32(cyggcj-13.dll) +Provides: cygwin32(cyggcj-noncore-13.dll) +Provides: cygwin32(cyggcj-tools-13.dll) +Provides: cygwin32(cyggij-13.dll) +Provides: cygwin32(cygjvm.dll) +Provides: %{name}-java = %{version}-%{release} +Obsoletes: %{name}-java < 4.7 + +%description -n cygwin32-gcc-java Cygwin cross-compiler for Java. %prep %setup -q -n gcc-%{gcc_version} -%patch0 -p1 -b .config-rpath~ -%patch2 -p2 -b .ehdebug~ -%patch4 -p2 -b .libstdc~ -%patch5 -p2 -b .misc-core~ -%patch6 -p2 -b .mnocygwin~ -%patch7 -p0 -b .sig-unwind~ -%patch8 -p1 -b .cross-libstdc~ -%if %{build_ada} -%patch1 -p2 -b .ada~ -%endif -%if %{build_java} -%patch3 -p2 -b .libffi~ -%patch9 -p2 -b .cross-ecjx~ -%patch10 -p2 -b .java-fionread~ -%patch11 -p2 -b .awt~ -%endif -%patch12 -p2 -b .peflags~ -%patch13 -p1 -b .exe-suffix~ -%patch14 -p1 -b .gc-win32-threads +%patch1 -p2 +%patch3 -p2 +%patch4 -p2 +%patch7 -p2 +%patch8 -p1 +%patch9 -p1 +%patch10 -p2 +%patch13 -p1 +%patch14 -p2 +%patch15 -p2 +%patch16 -p2 +%patch17 -p2 +%patch19 -p2 echo %{gcc_version} > gcc/BASE-VER echo 'Fedora Cygwin %{gcc_version}-%{gcc_release}' > gcc/DEV-PHASE -# Install python files into arch-specific datadir -sed \ - -e "s|^\(pythondir = \).*|\1%{_datadir}/gcc/%{_cygwin_target}/%{gcc_version}/python|" \ - -i libstdc++-v3/python/Makefile.{am,in} - -%if %{build_java} -# 1) Install libgcj jar into arch-specific datadir -# 2) gcc-java does not ship $host-gcj, and $_host != `gcc -dumpmachine` -# (e.g. i?86-pc-linux-gnu vs. i686-redhat-linux) -sed \ - -e '/^GCJ_FOR_ECJX =/ s|\@.*\@|gcj|' \ - -e "s|^\(jardir = \).*|\1%{_datadir}/gcc/%{_cygwin_target}/%{version}/java|" \ - -i libjava/Makefile.{am,in} -%endif %build -mkdir -p build -pushd build +mkdir -p build_cyg32 +pushd build_cyg32 %if %{build_ada} enablelada=,ada @@ -237,21 +246,24 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \ --infodir=%{_infodir} \ --datadir=%{_datadir} \ --build=%_build --host=%_host \ - --target=%{_cygwin_target} \ + --target=%{cygwin32_target} \ --with-arch=i686 --with-tune=generic \ --with-gnu-as --with-gnu-ld --verbose \ --disable-multilib \ --with-system-zlib \ + --enable-shared --enable-shared-libgcc --enable-static \ --disable-nls --without-included-gettext \ --disable-win32-registry \ --enable-threads=posix \ --enable-version-specific-runtime-libs \ - --with-sysroot=%{_cygwin_sysroot} \ + --with-sysroot=%{cygwin32_sysroot} \ --enable-shared --enable-shared-libgcc --disable-__cxa_atexit \ --with-dwarf2 --disable-sjlj-exceptions \ --enable-languages="c,c++,objc,obj-c++${enableljava},fortran${enablelada},lto" \ --enable-graphite --enable-lto --disable-symvers \ - --enable-libgomp --enable-libssp \ + --enable-libgomp --disable-libitm --enable-libssp \ + --enable-libquadmath --enable-libquadmath-support \ + --with-python-dir=/share/gcc-%{gcc_version}/%{cygwin32_target}/python \ %if %{build_ada} --enable-libada \ %endif @@ -260,6 +272,7 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \ --enable-libgcj-sublibs --disable-jni --disable-java-awt \ --enable-default-preferences-peer=file \ --with-ecj-jar=%{_datadir}/java/ecj.jar \ + --without-libiconv-prefix \ %endif --with-bugurl=http://cygwinports.org @@ -271,7 +284,7 @@ popd %install rm -rf $RPM_BUILD_ROOT -pushd build +pushd build_cyg32 make DESTDIR=$RPM_BUILD_ROOT install # These files conflict with existing installed files. @@ -282,55 +295,50 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man7/* rm -fr $RPM_BUILD_ROOT%{_libdir}/gcj-%{version}-* rm -fr $RPM_BUILD_ROOT%{_libdir}/logging.properties rm -fr $RPM_BUILD_ROOT%{_libdir}/security/ -rm -f $RPM_BUILD_ROOT%{_datadir}/python/* +rm -f $RPM_BUILD_ROOT%{_datadir}/gcc-%{gcc_version}/%{cygwin32_target}/python/*.py +#rm -f $RPM_BUILD_ROOT%{_datadir}/gcc-%{gcc_version}/%{cygwin64_target}/python/*.py %endif -# This file is provided by cygwin-binutils-devel -rm -f $RPM_BUILD_ROOT%{_prefix}/%{_cygwin_target}/lib/libiberty.a +# This file is provided by cygwin32-libbfd +rm -f $RPM_BUILD_ROOT%{_prefix}/%{cygwin32_target}/lib/libiberty.a # These scripts are not intended for cross-compiling scenarios %if %{build_java} -rm -f $RPM_BUILD_ROOT%{_bindir}/%{_cygwin_target}-aot-compile -rm -f $RPM_BUILD_ROOT%{_bindir}/%{_cygwin_target}-jcf-dump -rm -f $RPM_BUILD_ROOT%{_bindir}/%{_cygwin_target}-rebuild-gcj-db -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-aot-compile* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-g[^+cfn]* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-gc-analyze* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-gcj-dbtool* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-gcjh* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-gnative2ascii* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-j* -rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{_cygwin_target}-rebuild-gcj-db* -rm -f $RPM_BUILD_ROOT%{_mandir}/man3/%{_cygwin_target}-ffi* +rm -f $RPM_BUILD_ROOT%{_bindir}/%{cygwin32_target}-aot-compile +rm -f $RPM_BUILD_ROOT%{_bindir}/%{cygwin32_target}-jcf-dump +rm -f $RPM_BUILD_ROOT%{_bindir}/%{cygwin32_target}-rebuild-gcj-db +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-aot-compile* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-g[^+cfn]* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-gc-analyze* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-gcj-dbtool* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-gcjh* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-gnative2ascii* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-j* +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/%{cygwin32_target}-rebuild-gcj-db* %endif mkdir -p $RPM_BUILD_ROOT/lib -ln -sf ..%{_prefix}/bin/%{_cygwin_target}-cpp \ - $RPM_BUILD_ROOT/lib/%{_cygwin_target}-cpp +ln -sf ..%{_prefix}/bin/%{cygwin32_target}-cpp \ + $RPM_BUILD_ROOT/lib/%{cygwin32_target}-cpp # libtool installs DLL files of runtime libraries into $(libdir)/../bin, -# but we need them in _cygwin_bindir. -mkdir -p $RPM_BUILD_ROOT%{_cygwin_bindir} -mv $RPM_BUILD_ROOT%{_bindir}/*.dll $RPM_BUILD_ROOT%{_cygwin_bindir} +# but we need them in cygwin32_bindir. +mkdir -p $RPM_BUILD_ROOT%{cygwin32_bindir} +mv $RPM_BUILD_ROOT%{_libdir}/gcc/%{cygwin32_target}/*.dll \ + $RPM_BUILD_ROOT%{_libdir}/gcc/%{cygwin32_target}/%{gcc_version}/*.dll \ + $RPM_BUILD_ROOT%{cygwin32_bindir} %if %{build_java} -# move libffi -mv $RPM_BUILD_ROOT%{_prefix}/%{_cygwin_target}/bin/*.dll \ - $RPM_BUILD_ROOT%{_cygwin_bindir} # Move libgcj pkg-config files into sysroot -mkdir -p $RPM_BUILD_ROOT%{_cygwin_libdir}/pkgconfig +mkdir -p $RPM_BUILD_ROOT%{cygwin32_libdir}/pkgconfig mv $RPM_BUILD_ROOT%{_libdir}/pkgconfig/* \ - $RPM_BUILD_ROOT%{_cygwin_libdir}/pkgconfig + $RPM_BUILD_ROOT%{cygwin32_libdir}/pkgconfig %endif # Don't want the *.la files. find $RPM_BUILD_ROOT -name '*.la' -delete -# As of gcc 4.5.0, the plugin/ directory gets created on an i686 host -# but not on x86_64. Excluding it from the package for now. -rm -rf $RPM_BUILD_ROOT%{_libdir}/gcc/%{_cygwin_target}/%{version}/plugin/ - popd @@ -338,169 +346,165 @@ popd rm -rf $RPM_BUILD_ROOT -%files -%defattr(-,root,root,-) -%{_bindir}/%{_cygwin_target}-gcc -%{_bindir}/%{_cygwin_target}-gcc-%{version} -%{_bindir}/%{_cygwin_target}-gccbug -%{_bindir}/%{_cygwin_target}-gcov -%if %{build_java} -%{_prefix}/%{_cygwin_target}/lib/libffi.a -%{_prefix}/%{_cygwin_target}/lib/libffi.dll.a -%endif -%dir %{_libdir}/gcc/%{_cygwin_target} -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version} -%{_libdir}/gcc/%{_cygwin_target}/%{version}/crtbegin.o -%{_libdir}/gcc/%{_cygwin_target}/%{version}/crtend.o -%{_libdir}/gcc/%{_cygwin_target}/%{version}/crtfastmath.o -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcc.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcc_eh.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcc_s.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcov.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgomp.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgomp.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgomp.spec -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libssp.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libssp_nonshared.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libssp.dll.a -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/include -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/include-fixed -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/include/ssp -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include-fixed/README -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include-fixed/*.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/[^j]*.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/ssp/*.h -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/install-tools -%{_libdir}/gcc/%{_cygwin_target}/%{version}/install-tools/* -%dir %{_libexecdir}/gcc/%{_cygwin_target}/%{version}/install-tools -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/install-tools/* -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/lto1 -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/lto-wrapper -%dir %{_datadir}/gcc -%dir %{_datadir}/gcc/%{_cygwin_target} -%dir %{_datadir}/gcc/%{_cygwin_target}/%{version} -%if %{build_java} -%{_cygwin_bindir}/cygffi-4.dll -%endif -%{_cygwin_bindir}/cyggcc_s-1.dll -%{_cygwin_bindir}/cyggomp-1.dll -%{_cygwin_bindir}/cygssp-0.dll -%{_mandir}/man1/%{_cygwin_target}-gcc.1* -%{_mandir}/man1/%{_cygwin_target}-gcov.1* +%files -n cygwin32-gcc +%{_bindir}/%{cygwin32_target}-gcc +%{_bindir}/%{cygwin32_target}-gcc-%{version} +%{_bindir}/%{cygwin32_target}-gcc-ar +%{_bindir}/%{cygwin32_target}-gcc-nm +%{_bindir}/%{cygwin32_target}-gcc-ranlib +%{_bindir}/%{cygwin32_target}-gcov +%dir %{_libdir}/gcc/%{cygwin32_target} +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version} +%{_libdir}/gcc/%{cygwin32_target}/%{version}/crtbegin.o +%{_libdir}/gcc/%{cygwin32_target}/%{version}/crtend.o +%{_libdir}/gcc/%{cygwin32_target}/%{version}/crtfastmath.o +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcc.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcc_eh.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcc_s.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcov.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgomp.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgomp.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgomp.spec +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libquadmath.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libquadmath.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libssp.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libssp_nonshared.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libssp.dll.a +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version}/include +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version}/include/ssp +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/[^j]*.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/ssp/*.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include-fixed/ +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version}/install-tools +%{_libdir}/gcc/%{cygwin32_target}/%{version}/install-tools/* +%dir %{_libexecdir}/gcc/%{cygwin32_target}/%{version}/install-tools +%{_libdir}/gcc/%{cygwin32_target}/%{version}/plugin/ +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/install-tools/* +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/liblto_plugin.so +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/lto1 +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/lto-wrapper +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/plugin/ +%dir %{_datadir}/gcc-%{gcc_version} +%dir %{_datadir}/gcc-%{gcc_version}/%{cygwin32_target} +%{cygwin32_bindir}/cyggcc_s-1.dll +%{cygwin32_bindir}/cyggomp-1.dll +%{cygwin32_bindir}/cygquadmath-0.dll +%{cygwin32_bindir}/cygssp-0.dll +%{_mandir}/man1/%{cygwin32_target}-gcc.1* +%{_mandir}/man1/%{cygwin32_target}-gcov.1* %doc gcc/README* gcc/COPYING* -%files -n cygwin-cpp +%files -n cygwin32-cpp +/lib/%{cygwin32_target}-cpp +%{_bindir}/%{cygwin32_target}-cpp +%{_mandir}/man1/%{cygwin32_target}-cpp.1* +%dir %{_libdir}/gcc/%{cygwin32_target} +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version} +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/cc1 + + +%files -n cygwin32-gcc-c++ +%{_bindir}/%{cygwin32_target}-g++ +%{_bindir}/%{cygwin32_target}-c++ +%{_mandir}/man1/%{cygwin32_target}-g++.1* +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/[^gjos]* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/os* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/s[^u]* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libstdc++.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libstdc++.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libstdc++.dll.a-gdb.py +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libsupc++.a +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/cc1plus +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/collect2 +%dir %{_datadir}/gcc-%{gcc_version}/%{cygwin32_target}/python +%{_datadir}/gcc-%{gcc_version}/%{cygwin32_target}/python/libstdcxx/ +%{cygwin32_bindir}/cygstdc++-6.dll + + +%files -n cygwin32-gcc-objc %defattr(-,root,root,-) -/lib/%{_cygwin_target}-cpp -%{_bindir}/%{_cygwin_target}-cpp -%{_mandir}/man1/%{_cygwin_target}-cpp.1* -%dir %{_libdir}/gcc/%{_cygwin_target} -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version} -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/cc1 +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/objc/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libobjc.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libobjc.dll.a +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/cc1obj +%{cygwin32_bindir}/cygobjc-4.dll -%files c++ -%defattr(-,root,root,-) -%{_bindir}/%{_cygwin_target}-g++ -%{_bindir}/%{_cygwin_target}-c++ -%{_mandir}/man1/%{_cygwin_target}-g++.1* -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/[^gjos]* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/os* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/s[^u]* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libstdc++.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libstdc++.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libstdc++.dll.a-gdb.py -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libsupc++.a -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/cc1plus -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/collect2 -%dir %{_datadir}/gcc/%{_cygwin_target}/%{version}/python -%{_datadir}/gcc/%{_cygwin_target}/%{version}/python/libstdcxx/ -%{_cygwin_bindir}/cygstdc++-6.dll - - -%files objc +%files -n cygwin32-gcc-objc++ %defattr(-,root,root,-) -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/objc/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libobjc.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libobjc.dll.a -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/cc1obj -%{_cygwin_bindir}/cygobjc-2.dll +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/cc1objplus -%files objc++ +%files -n cygwin32-gcc-gfortran %defattr(-,root,root,-) -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/cc1objplus - - -%files gfortran -%defattr(-,root,root,-) -%{_bindir}/%{_cygwin_target}-gfortran -%{_mandir}/man1/%{_cygwin_target}-gfortran.1* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgfortran.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgfortran.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgfortranbegin.a -%dir %{_libdir}/gcc/%{_cygwin_target}/%{version}/finclude -%{_libdir}/gcc/%{_cygwin_target}/%{version}/finclude/omp_lib.f90 -%{_libdir}/gcc/%{_cygwin_target}/%{version}/finclude/omp_lib.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/finclude/omp_lib.mod -%{_libdir}/gcc/%{_cygwin_target}/%{version}/finclude/omp_lib_kinds.mod -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/f951 -%{_cygwin_bindir}/cyggfortran-3.dll +%{_bindir}/%{cygwin32_target}-gfortran +%{_mandir}/man1/%{cygwin32_target}-gfortran.1* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libcaf_single.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgfortran.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgfortran.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgfortran.spec +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgfortranbegin.a +%dir %{_libdir}/gcc/%{cygwin32_target}/%{version}/finclude +%{_libdir}/gcc/%{cygwin32_target}/%{version}/finclude/omp_lib.f90 +%{_libdir}/gcc/%{cygwin32_target}/%{version}/finclude/omp_lib.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/finclude/omp_lib.mod +%{_libdir}/gcc/%{cygwin32_target}/%{version}/finclude/omp_lib_kinds.mod +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/f951 +%{cygwin32_bindir}/cyggfortran-3.dll %if %{build_ada} -%files gnat -%defattr(-,root,root,-) -%{_bindir}/%{_cygwin_target}-gnat* -#%%{_mandir}/man1/%%{_cygwin_target}-gnat*.1* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/adainclude/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/adalib/ -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/gnat1 -#%%{_cygwin_bindir}/cyggnarl-4.5.dll -#%%{_cygwin_bindir}/cyggnat-4.5.dll +%files -n cygwin32-gcc-gnat +%{_bindir}/%{cygwin32_target}-gnat* +#%%{_mandir}/man1/%%{cygwin32_target}-gnat*.1* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/adainclude/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/adalib/ +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/gnat1 +#%%{cygwin32_bindir}/cyggnarl-4.7.dll +#%%{cygwin32_bindir}/cyggnat-4.7.dll %endif %if %{build_java} -%files java +%files -n cygwin32-gcc-java %defattr(-,root,root,-) -%{_bindir}/%{_cygwin_target}-gcj -%{_mandir}/man1/%{_cygwin_target}-gcj.1* -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/gcj/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/gnu/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/java/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/javax/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/org/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/c++/sun/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/gcj/ -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/jawt*.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/jni*.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/include/jvmpi.h -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj-noncore.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj-noncore.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj.spec -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj-tools.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgcj-tools.dll.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgij.a -%{_libdir}/gcc/%{_cygwin_target}/%{version}/libgij.dll.a -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/ecj1 -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/jc1 -%{_libexecdir}/gcc/%{_cygwin_target}/%{version}/jvgenmain -%{_cygwin_bindir}/cyggcj-11.dll -%{_cygwin_bindir}/cyggcj-noncore-11.dll -%{_cygwin_bindir}/cyggcj-tools-11.dll -%{_cygwin_bindir}/cyggij-11.dll -%{_cygwin_bindir}/cygjvm.dll -%{_cygwin_libdir}/pkgconfig/libgcj-4.5.pc -%{_datadir}/gcc/%{_cygwin_target}/%{version}/java +%{_bindir}/%{cygwin32_target}-gcj +%{_mandir}/man1/%{cygwin32_target}-gcj.1* +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/gcj/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/gnu/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/java/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/javax/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/org/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/c++/sun/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/gcj/ +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/jawt*.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/jni*.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/include/jvmpi.h +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcj.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcj-noncore.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcj.spec +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgcj-tools.dll.a +%{_libdir}/gcc/%{cygwin32_target}/%{version}/libgij.dll.a +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/ecj1 +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/jc1 +%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/jvgenmain +%{cygwin32_bindir}/cyggcj-13.dll +%{cygwin32_bindir}/cyggcj-noncore-13.dll +%{cygwin32_bindir}/cyggcj-tools-13.dll +%{cygwin32_bindir}/cyggij-13.dll +%{cygwin32_bindir}/cygjvm.dll +%{cygwin32_libdir}/pkgconfig/libgcj-4.7.pc +%{_datadir}/gcc-%{gcc_version}/%{cygwin32_target}/java %endif %changelog +* Thu Jun 27 2013 Yaakov Selkowitz - 4.7.3-1 +- Version bump. +- Update for new Cygwin packaging scheme. + * Sun Aug 14 2011 Yaakov Selkowitz - 4.5.3-4 - Add .exe to unsuffixed output executables, as with the native compiler. diff --git a/gcc45-ada.diff b/gcc45-ada.diff deleted file mode 100644 index a048130..0000000 --- a/gcc45-ada.diff +++ /dev/null @@ -1,3512 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/gcc/ada/a-intnam-cygwin.ads src/gcc-4.5.0/gcc/ada/a-intnam-cygwin.ads ---- origsrc/gcc-4.5.0/gcc/ada/a-intnam-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/a-intnam-cygwin.ads 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,168 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -+-- -- -+-- A D A . I N T E R R U P T S . N A M E S -- -+-- -- -+-- S p e c -- -+-- -- -+-- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- -+-- -- -+-- GNARL is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNARL; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNARL was developed by the GNARL team at Florida State University. -- -+-- Extensive contributions were provided by Ada Core Technologies, Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This is a Cygwin version of this package but really it's a copy of the -+-- Linux version, so the below comments are probably irrelevant: -+ -+-- The following signals are reserved by the run time (FSU threads): -+ -+-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT, -+-- SIGALRM, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL -+ -+-- The following signals are reserved by the run time (LinuxThreads): -+ -+-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT, -+-- SIGUSR1, SIGUSR2, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL -+ -+-- The pragma Unreserve_All_Interrupts affects the following signal(s): -+ -+-- SIGINT: made available for Ada handler -+ -+-- This target-dependent package spec contains names of interrupts -+-- supported by the local system. -+ -+with System.OS_Interface; -+-- used for names of interrupts -+ -+package Ada.Interrupts.Names is -+ -+ -- Beware that the mapping of names to signals may be many-to-one. There -+ -- may be aliases. Also, for all signal names that are not supported on the -+ -- current system the value of the corresponding constant will be zero. -+ -+ SIGHUP : constant Interrupt_ID := -+ System.OS_Interface.SIGHUP; -- hangup -+ -+ SIGINT : constant Interrupt_ID := -+ System.OS_Interface.SIGINT; -- interrupt (rubout) -+ -+ SIGQUIT : constant Interrupt_ID := -+ System.OS_Interface.SIGQUIT; -- quit (ASCD FS) -+ -+ SIGILL : constant Interrupt_ID := -+ System.OS_Interface.SIGILL; -- illegal instruction (not reset) -+ -+ SIGTRAP : constant Interrupt_ID := -+ System.OS_Interface.SIGTRAP; -- trace trap (not reset) -+ -+ SIGIOT : constant Interrupt_ID := -+ System.OS_Interface.SIGIOT; -- IOT instruction -+ -+ SIGABRT : constant Interrupt_ID := -- used by abort, -+ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future -+ -+ SIGFPE : constant Interrupt_ID := -+ System.OS_Interface.SIGFPE; -- floating point exception -+ -+ SIGKILL : constant Interrupt_ID := -+ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) -+ -+ SIGBUS : constant Interrupt_ID := -+ System.OS_Interface.SIGBUS; -- bus error -+ -+ SIGSEGV : constant Interrupt_ID := -+ System.OS_Interface.SIGSEGV; -- segmentation violation -+ -+ SIGPIPE : constant Interrupt_ID := -- write on a pipe with -+ System.OS_Interface.SIGPIPE; -- no one to read it -+ -+ SIGALRM : constant Interrupt_ID := -+ System.OS_Interface.SIGALRM; -- alarm clock -+ -+ SIGTERM : constant Interrupt_ID := -+ System.OS_Interface.SIGTERM; -- software termination signal from kill -+ -+ SIGUSR1 : constant Interrupt_ID := -+ System.OS_Interface.SIGUSR1; -- user defined signal 1 -+ -+ SIGUSR2 : constant Interrupt_ID := -+ System.OS_Interface.SIGUSR2; -- user defined signal 2 -+ -+ SIGCLD : constant Interrupt_ID := -+ System.OS_Interface.SIGCLD; -- child status change -+ -+ SIGCHLD : constant Interrupt_ID := -+ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD -+ -+ SIGWINCH : constant Interrupt_ID := -+ System.OS_Interface.SIGWINCH; -- window size change -+ -+ SIGURG : constant Interrupt_ID := -+ System.OS_Interface.SIGURG; -- urgent condition on IO channel -+ -+ SIGPOLL : constant Interrupt_ID := -+ System.OS_Interface.SIGPOLL; -- pollable event occurred -+ -+ SIGIO : constant Interrupt_ID := -- input/output possible, -+ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) -+ -+ SIGSTOP : constant Interrupt_ID := -+ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) -+ -+ SIGTSTP : constant Interrupt_ID := -+ System.OS_Interface.SIGTSTP; -- user stop requested from tty -+ -+ SIGCONT : constant Interrupt_ID := -+ System.OS_Interface.SIGCONT; -- stopped process has been continued -+ -+ SIGTTIN : constant Interrupt_ID := -+ System.OS_Interface.SIGTTIN; -- background tty read attempted -+ -+ SIGTTOU : constant Interrupt_ID := -+ System.OS_Interface.SIGTTOU; -- background tty write attempted -+ -+ SIGVTALRM : constant Interrupt_ID := -+ System.OS_Interface.SIGVTALRM; -- virtual timer expired -+ -+ SIGPROF : constant Interrupt_ID := -+ System.OS_Interface.SIGPROF; -- profiling timer expired -+ -+ SIGXCPU : constant Interrupt_ID := -+ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded -+ -+ SIGXFSZ : constant Interrupt_ID := -+ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded -+ -+ SIGUNUSED : constant Interrupt_ID := -+ System.OS_Interface.SIGUNUSED; -- unused signal -+ -+ SIGSTKFLT : constant Interrupt_ID := -+ System.OS_Interface.SIGSTKFLT; -- stack fault on coprocessor -+ -+ SIGLOST : constant Interrupt_ID := -+ System.OS_Interface.SIGLOST; -- Linux alias for SIGIO -+ -+ SIGPWR : constant Interrupt_ID := -+ System.OS_Interface.SIGPWR; -- Power failure -+ -+end Ada.Interrupts.Names; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/g-soccon-cygwin.ads src/gcc-4.5.0/gcc/ada/g-soccon-cygwin.ads ---- origsrc/gcc-4.5.0/gcc/ada/g-soccon-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/g-soccon-cygwin.ads 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,196 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT COMPILER COMPONENTS -- -+-- -- -+-- G N A T . S O C K E T S . C O N S T A N T S -- -+-- -- -+-- S p e c -- -+-- -- -+-- Copyright (C) 2000-2007, Free Software Foundation, Inc. -- -+-- -- -+-- GNAT is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNAT; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNAT was originally developed by the GNAT team at New York University. -- -+-- Extensive contributions were provided by Ada Core Technologies Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This package provides target dependent definitions of constant for use -+-- by the GNAT.Sockets package (g-socket.ads). This package should not be -+-- directly with'ed by an applications program. -+ -+-- This is the version for Cygwin -+-- This file is generated automatically, do not modify it by hand! Instead, -+-- make changes to gen-soccon.c and re-run it on each target. -+ -+package GNAT.Sockets.Constants is -+ -+ -------------- -+ -- Families -- -+ -------------- -+ -+ AF_INET : constant := 2; -- IPv4 address family -+ AF_INET6 : constant := 23; -- IPv6 address family -+ -+ ----------- -+ -- Modes -- -+ ----------- -+ -+ SOCK_STREAM : constant := 1; -- Stream socket -+ SOCK_DGRAM : constant := 2; -- Datagram socket -+ -+ ------------------- -+ -- Socket errors -- -+ ------------------- -+ -+ EACCES : constant := 13; -- Permission denied -+ EADDRINUSE : constant := 112; -- Address already in use -+ EADDRNOTAVAIL : constant := 125; -- Cannot assign address -+ EAFNOSUPPORT : constant := 106; -- Addr family not supported -+ EALREADY : constant := 120; -- Operation in progress -+ EBADF : constant := 9; -- Bad file descriptor -+ ECONNABORTED : constant := 113; -- Connection aborted -+ ECONNREFUSED : constant := 111; -- Connection refused -+ ECONNRESET : constant := 104; -- Connection reset by peer -+ EDESTADDRREQ : constant := 121; -- Destination addr required -+ EFAULT : constant := 14; -- Bad address -+ EHOSTDOWN : constant := 117; -- Host is down -+ EHOSTUNREACH : constant := 118; -- No route to host -+ EINPROGRESS : constant := 119; -- Operation now in progress -+ EINTR : constant := 4; -- Interrupted system call -+ EINVAL : constant := 22; -- Invalid argument -+ EIO : constant := 5; -- Input output error -+ EISCONN : constant := 127; -- Socket already connected -+ ELOOP : constant := 92; -- Too many symbolic lynks -+ EMFILE : constant := 24; -- Too many open files -+ EMSGSIZE : constant := 122; -- Message too long -+ ENAMETOOLONG : constant := 91; -- Name too long -+ ENETDOWN : constant := 115; -- Network is down -+ ENETRESET : constant := 126; -- Disconn. on network reset -+ ENETUNREACH : constant := 114; -- Network is unreachable -+ ENOBUFS : constant := 105; -- No buffer space available -+ ENOPROTOOPT : constant := 109; -- Protocol not available -+ ENOTCONN : constant := 128; -- Socket not connected -+ ENOTSOCK : constant := 108; -- Operation on non socket -+ EOPNOTSUPP : constant := 95; -- Operation not supported -+ EPFNOSUPPORT : constant := 96; -- Unknown protocol family -+ EPROTONOSUPPORT : constant := 123; -- Unknown protocol -+ EPROTOTYPE : constant := 107; -- Unknown protocol type -+ ESHUTDOWN : constant := 110; -- Cannot send once shutdown -+ ESOCKTNOSUPPORT : constant := 124; -- Socket type not supported -+ ETIMEDOUT : constant := 116; -- Connection timed out -+ ETOOMANYREFS : constant := 129; -- Too many references -+ EWOULDBLOCK : constant := 11; -- Operation would block -+ -+ ----------------- -+ -- Host errors -- -+ ----------------- -+ -+ HOST_NOT_FOUND : constant := 1; -- Unknown host -+ TRY_AGAIN : constant := 2; -- Host name lookup failure -+ NO_DATA : constant := 4; -- No data record for name -+ NO_RECOVERY : constant := 3; -- Non recoverable errors -+ -+ ------------------- -+ -- Control flags -- -+ ------------------- -+ -+ FIONBIO : constant := -2147195266; -- Set/clear non-blocking io -+ FIONREAD : constant := 1074030207; -- How many bytes to read -+ -+ -------------------- -+ -- Shutdown modes -- -+ -------------------- -+ -+ SHUT_RD : constant := 0; -- No more recv -+ SHUT_WR : constant := 1; -- No more send -+ SHUT_RDWR : constant := 2; -- No more recv/send -+ -+ --------------------- -+ -- Protocol levels -- -+ --------------------- -+ -+ SOL_SOCKET : constant := 65535; -- Options for socket level -+ IPPROTO_IP : constant := 0; -- Dummy protocol for IP -+ IPPROTO_UDP : constant := 17; -- UDP -+ IPPROTO_TCP : constant := 6; -- TCP -+ -+ ------------------- -+ -- Request flags -- -+ ------------------- -+ -+ MSG_OOB : constant := 1; -- Process out-of-band data -+ MSG_PEEK : constant := 2; -- Peek at incoming data -+ MSG_EOR : constant := -1; -- Send end of record -+ MSG_WAITALL : constant := 8; -- Wait for full reception -+ MSG_NOSIGNAL : constant := 32; -- No SIGPIPE on send -+ MSG_Forced_Flags : constant := 0; -+ -- Flags set on all send(2) calls -+ -+ -------------------- -+ -- Socket options -- -+ -------------------- -+ -+ TCP_NODELAY : constant := 1; -- Do not coalesce packets -+ SO_REUSEADDR : constant := 4; -- Bind reuse local address -+ SO_REUSEPORT : constant := -1; -- Bind reuse port number -+ SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs -+ SO_LINGER : constant := 128; -- Defer close to flush data -+ SO_BROADCAST : constant := 32; -- Can send broadcast msgs -+ SO_SNDBUF : constant := 4097; -- Set/get send buffer size -+ SO_RCVBUF : constant := 4098; -- Set/get recv buffer size -+ SO_SNDTIMEO : constant := 4101; -- Emission timeout -+ SO_RCVTIMEO : constant := 4102; -- Reception timeout -+ SO_ERROR : constant := 4103; -- Get/clear error status -+ IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface -+ IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL -+ IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback -+ IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group -+ IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group -+ IP_PKTINFO : constant := 19; -- Get datagram info -+ -+ ------------------- -+ -- System limits -- -+ ------------------- -+ -+ IOV_MAX : constant := 1024; -- Maximum writev iovcnt -+ -+ ---------------------- -+ -- Type definitions -- -+ ---------------------- -+ -+ -- Sizes (in bytes) of the components of struct timeval -+ -+ SIZEOF_tv_sec : constant := 4; -- tv_sec -+ SIZEOF_tv_usec : constant := 4; -- tv_usec -+ -+ ---------------------------------------- -+ -- Properties of supported interfaces -- -+ ---------------------------------------- -+ -+ Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops -+ -+ ---------------------- -+ -- Additional flags -- -+ ---------------------- -+ -+ Thread_Blocking_IO : constant Boolean := True; -+ -- Set False for contexts where socket i/o are process blocking -+ -+end GNAT.Sockets.Constants; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/gcc-interface/Makefile.in src/gcc-4.5.0/gcc/ada/gcc-interface/Makefile.in ---- origsrc/gcc-4.5.0/gcc/ada/gcc-interface/Makefile.in 2010-04-22 12:15:21.859375000 +0100 -+++ src/gcc-4.5.0/gcc/ada/gcc-interface/Makefile.in 2010-04-22 12:20:07.875000000 +0100 -@@ -186,6 +186,13 @@ TARGET_ADA_SRCS = - # Type of tools build we are doing; default is not compiling tools. - TOOLSCASE = - -+# Which install goal to use. -+INSTALL_GNATLIB_MAIN = install-gnatlib -+INSTALL_GNATLIB_WIN32 = unused-install-gnatlib -+ -+# Set shared lib prefix (lib on all systems but cygwin, which uses cyg) -+LIBGNAT_SHARED_LIB_PREFIX=lib -+ - # Multilib handling - MULTISUBDIR = - RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) -@@ -1594,7 +1601,15 @@ ifeq ($(strip $(filter-out avr none powe - indepsw.adb -+ To := new Argument_List'(1 => new String'(Map_Switch & Argument)); -+ end case; -+ end Convert; -+ -+ ------------------ -+ -- Is_Supported -- -+ ------------------ -+ -+ function Is_Supported (Switch : Switch_Kind) return Boolean is -+ begin -+ case Switch is -+ when Map_File => -+ return True; -+ end case; -+ end Is_Supported; -+ -+end Indepsw; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/initialize.c src/gcc-4.5.0/gcc/ada/initialize.c ---- origsrc/gcc-4.5.0/gcc/ada/initialize.c 2010-04-22 12:15:21.921875000 +0100 -+++ src/gcc-4.5.0/gcc/ada/initialize.c 2010-04-19 06:08:12.000000000 +0100 -@@ -348,6 +348,40 @@ __gnat_initialize (void *eh ATTRIBUTE_UN - __main (); - } - -+#elif defined (__CYGWIN__) -+ -+/***************************************/ -+/* __gnat_initialize (Cygwin Version) */ -+/***************************************/ -+ -+extern void __main (void); -+ -+void -+__gnat_initialize (void *eh ATTRIBUTE_UNUSED) -+{ -+#ifdef IN_RTS -+ /* We must call __main to run the static ctors, or DW2 EH, amongst -+ other things, will fail. */ -+ __main (); -+#endif -+ /* Initialize floating-point coprocessor. This call is needed because -+ the MS libraries default to 64-bit precision instead of 80-bit -+ precision, and we require the full precision for proper operation, -+ given that we have set Max_Digits etc with this in mind */ -+ __gnat_init_float (); -+ -+ /* Note that we do not activate this for the compiler itself to avoid a -+ bootstrap path problem. Older version of gnatbind will generate a call -+ to __gnat_initialize() without argument. Therefore we cannot use eh in -+ this case. It will be possible to remove the following #ifdef at some -+ point. */ -+#ifdef IN_RTS -+ /* Install the Structured Exception handler. */ -+ if (eh) -+ __gnat_install_SEH_handler (eh); -+#endif -+} -+ - #else - - /* For all other versions of GNAT, the initialize routine and handler -diff -pruN origsrc/gcc-4.5.0/gcc/ada/mlib-tgt-cygwin.adb src/gcc-4.5.0/gcc/ada/mlib-tgt-cygwin.adb ---- origsrc/gcc-4.5.0/gcc/ada/mlib-tgt-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/mlib-tgt-cygwin.adb 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,160 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT COMPILER COMPONENTS -- -+-- -- -+-- M L I B . T G T . S P E C I F I C -- -+-- (Cygwin Version) -- -+-- -- -+-- B o d y -- -+-- -- -+-- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- -+-- -- -+-- GNAT is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 3, or (at your option) any later ver- -- -+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNAT; see file COPYING3. If not, go to -- -+-- http://www.gnu.org/licenses for a complete copy of the license. -- -+-- -- -+-- GNAT was originally developed by the GNAT team at New York University. -- -+-- Extensive contributions were provided by Ada Core Technologies Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This is the Windows version of the body. Works only with GCC versions -+-- supporting the "-shared" option. -+ -+with Opt; -+with Output; use Output; -+ -+with MLib.Fil; -+with MLib.Utl; -+ -+package body MLib.Tgt.Specific is -+ -+ package Files renames MLib.Fil; -+ package Tools renames MLib.Utl; -+ -+ -- Non default subprograms -+ -+ procedure Build_Dynamic_Library -+ (Ofiles : Argument_List; -+ Options : Argument_List; -+ Interfaces : Argument_List; -+ Lib_Filename : String; -+ Lib_Dir : String; -+ Symbol_Data : Symbol_Record; -+ Driver_Name : Name_Id := No_Name; -+ Lib_Version : String := ""; -+ Auto_Init : Boolean := False); -+ -+ function DLL_Ext return String; -+ -+ function DLL_Prefix return String; -+ -+ function Is_Archive_Ext (Ext : String) return Boolean; -+ -+ function Library_Major_Minor_Id_Supported return Boolean; -+ -+ function PIC_Option return String; -+ -+ No_Argument_List : constant String_List := (1 .. 0 => null); -+ -- Used as value of parameter Options or Options2 in calls to Gcc -+ -+ --------------------------- -+ -- Build_Dynamic_Library -- -+ --------------------------- -+ -+ procedure Build_Dynamic_Library -+ (Ofiles : Argument_List; -+ Options : Argument_List; -+ Interfaces : Argument_List; -+ Lib_Filename : String; -+ Lib_Dir : String; -+ Symbol_Data : Symbol_Record; -+ Driver_Name : Name_Id := No_Name; -+ Lib_Version : String := ""; -+ Auto_Init : Boolean := False) -+ is -+ pragma Unreferenced (Symbol_Data); -+ pragma Unreferenced (Interfaces); -+ pragma Unreferenced (Lib_Version); -+ pragma Unreferenced (Auto_Init); -+ -+ Lib_File : constant String := -+ Lib_Dir & Directory_Separator & -+ DLL_Prefix & Files.Append_To (Lib_Filename, DLL_Ext); -+ -+ -- Start of processing for Build_Dynamic_Library -+ -+ begin -+ if Opt.Verbose_Mode then -+ Write_Str ("building relocatable shared library "); -+ Write_Line (Lib_File); -+ end if; -+ -+ Tools.Gcc -+ (Output_File => Lib_File, -+ Objects => Ofiles, -+ Options => No_Argument_List, -+ Options_2 => Options, -+ Driver_Name => Driver_Name); -+ end Build_Dynamic_Library; -+ -+ ------------- -+ -- DLL_Ext -- -+ ------------- -+ -+ function DLL_Ext return String is -+ begin -+ return "dll"; -+ end DLL_Ext; -+ -+ ---------------- -+ -- DLL_Prefix -- -+ ---------------- -+ -+ function DLL_Prefix return String is -+ begin -+ return "cyg"; -+ end DLL_Prefix; -+ -+ -------------------- -+ -- Is_Archive_Ext -- -+ -------------------- -+ -+ function Is_Archive_Ext (Ext : String) return Boolean is -+ begin -+ return Ext = ".a" or else Ext = ".dll"; -+ end Is_Archive_Ext; -+ -+ -------------------------------------- -+ -- Library_Major_Minor_Id_Supported -- -+ -------------------------------------- -+ -+ function Library_Major_Minor_Id_Supported return Boolean is -+ begin -+ return False; -+ end Library_Major_Minor_Id_Supported; -+ -+ ---------------- -+ -- PIC_Option -- -+ ---------------- -+ -+ function PIC_Option return String is -+ begin -+ return ""; -+ end PIC_Option; -+ -+begin -+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access; -+ DLL_Ext_Ptr := DLL_Ext'Access; -+ DLL_Prefix_Ptr := DLL_Prefix'Access; -+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access; -+ PIC_Option_Ptr := PIC_Option'Access; -+ Library_Major_Minor_Id_Supported_Ptr := -+ Library_Major_Minor_Id_Supported'Access; -+end MLib.Tgt.Specific; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/s-gloloc-cygwin.adb src/gcc-4.5.0/gcc/ada/s-gloloc-cygwin.adb ---- origsrc/gcc-4.5.0/gcc/ada/s-gloloc-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/s-gloloc-cygwin.adb 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,113 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT COMPILER COMPONENTS -- -+-- -- -+-- S Y S T E M . G L O B A L _ L O C K S -- -+-- -- -+-- B o d y -- -+-- -- -+-- Copyright (C) 1999-2007, AdaCore -- -+-- -- -+-- GNAT is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNAT; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNAT was originally developed by the GNAT team at New York University. -- -+-- Extensive contributions were provided by Ada Core Technologies Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This implementation is specific to NT -+ -+with System.Task_Lock; -+ -+with Interfaces.C.Strings; -+with System.OS_Interface; -+ -+package body System.Global_Locks is -+ -+ package TSL renames System.Task_Lock; -+ package OSI renames System.OS_Interface; -+ package ICS renames Interfaces.C.Strings; -+ -+ subtype Lock_File_Entry is OSI.HANDLE; -+ -+ Last_Lock : Lock_Type := Null_Lock; -+ Lock_Table : array (Lock_Type range 1 .. 15) of Lock_File_Entry; -+ -+ ----------------- -+ -- Create_Lock -- -+ ----------------- -+ -+ procedure Create_Lock -+ (Lock : out Lock_Type; -+ Name : String) -+ is -+ L : Lock_Type; -+ -+ begin -+ TSL.Lock; -+ Last_Lock := Last_Lock + 1; -+ L := Last_Lock; -+ TSL.Unlock; -+ -+ if L > Lock_Table'Last then -+ raise Lock_Error; -+ end if; -+ -+ Lock_Table (L) := -+ OSI.CreateMutex (null, OSI.BOOL (False), ICS.New_String (Name)); -+ Lock := L; -+ end Create_Lock; -+ -+ ------------------ -+ -- Acquire_Lock -- -+ ------------------ -+ -+ procedure Acquire_Lock -+ (Lock : in out Lock_Type) -+ is -+ use type OSI.DWORD; -+ -+ Res : OSI.DWORD; -+ begin -+ Res := OSI.WaitForSingleObject (Lock_Table (Lock), OSI.Wait_Infinite); -+ -+ if Res = OSI.WAIT_FAILED then -+ raise Lock_Error; -+ end if; -+ end Acquire_Lock; -+ -+ ------------------ -+ -- Release_Lock -- -+ ------------------ -+ -+ procedure Release_Lock -+ (Lock : in out Lock_Type) -+ is -+ use type OSI.BOOL; -+ -+ Res : OSI.BOOL; -+ begin -+ Res := OSI.ReleaseMutex (Lock_Table (Lock)); -+ -+ if Res = OSI.False then -+ raise Lock_Error; -+ end if; -+ end Release_Lock; -+ -+end System.Global_Locks; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/s-osinte-cygwin.ads src/gcc-4.5.0/gcc/ada/s-osinte-cygwin.ads ---- origsrc/gcc-4.5.0/gcc/ada/s-osinte-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/s-osinte-cygwin.ads 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,952 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -+-- -- -+-- S Y S T E M . O S _ I N T E R F A C E -- -+-- -- -+-- S p e c -- -+-- -- -+-- Copyright (C) 1991-1994, Florida State University -- -+-- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- -+-- -- -+-- GNARL is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNARL; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNARL was developed by the GNARL team at Florida State University. -- -+-- Extensive contributions were provided by Ada Core Technologies, Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This is a GNU/Linux (GNU/LinuxThreads) version of this package -+ -+-- This package encapsulates all direct interfaces to OS services -+-- that are needed by children of System. -+ -+-- PLEASE DO NOT add any with-clauses to this package or remove the pragma -+-- Preelaborate. This package is designed to be a bottom-level (leaf) package. -+ -+with Interfaces.C; -+with Interfaces.C.Strings; -+with Ada.Unchecked_Conversion; -+ -+package System.OS_Interface is -+ pragma Preelaborate; -+ -+ subtype int is Interfaces.C.int; -+ subtype char is Interfaces.C.char; -+ subtype short is Interfaces.C.short; -+ subtype long is Interfaces.C.long; -+ subtype unsigned is Interfaces.C.unsigned; -+ subtype unsigned_short is Interfaces.C.unsigned_short; -+ subtype unsigned_long is Interfaces.C.unsigned_long; -+ subtype unsigned_char is Interfaces.C.unsigned_char; -+ subtype plain_char is Interfaces.C.plain_char; -+ subtype size_t is Interfaces.C.size_t; -+ -+ ----------- -+ -- Errno -- -+ ----------- -+ -+ function errno return int; -+ pragma Import (C, errno, "__get_errno"); -+ -+ EAGAIN : constant := 11; -+ EINTR : constant := 4; -+ EINVAL : constant := 22; -+ ENOMEM : constant := 12; -+ EPERM : constant := 1; -+ ETIMEDOUT : constant := 110; -+ -+ ------------- -+ -- Signals -- -+ ------------- -+ -+ Max_Interrupt : constant := 63; -+ type Signal is new int range 0 .. Max_Interrupt; -+ for Signal'Size use int'Size; -+ -+ SIGHUP : constant := 1; -- hangup -+ SIGINT : constant := 2; -- interrupt (rubout) -+ SIGQUIT : constant := 3; -- quit (ASCD FS) -+ SIGILL : constant := 4; -- illegal instruction (not reset) -+ SIGTRAP : constant := 5; -- trace trap (not reset) -+ SIGIOT : constant := 6; -- IOT instruction -+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future -+ SIGFPE : constant := 8; -- floating point exception -+ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) -+ SIGBUS : constant := 7; -- bus error -+ SIGSEGV : constant := 11; -- segmentation violation -+ SIGPIPE : constant := 13; -- write on a pipe with no one to read it -+ SIGALRM : constant := 14; -- alarm clock -+ SIGTERM : constant := 15; -- software termination signal from kill -+ SIGUSR1 : constant := 10; -- user defined signal 1 -+ SIGUSR2 : constant := 12; -- user defined signal 2 -+ SIGCLD : constant := 17; -- alias for SIGCHLD -+ SIGCHLD : constant := 17; -- child status change -+ SIGPWR : constant := 30; -- power-fail restart -+ SIGWINCH : constant := 28; -- window size change -+ SIGURG : constant := 23; -- urgent condition on IO channel -+ SIGPOLL : constant := 29; -- pollable event occurred -+ SIGIO : constant := 29; -- I/O now possible (4.2 BSD) -+ SIGLOST : constant := 29; -- File lock lost -+ SIGSTOP : constant := 19; -- stop (cannot be caught or ignored) -+ SIGTSTP : constant := 20; -- user stop requested from tty -+ SIGCONT : constant := 18; -- stopped process has been continued -+ SIGTTIN : constant := 21; -- background tty read attempted -+ SIGTTOU : constant := 22; -- background tty write attempted -+ SIGVTALRM : constant := 26; -- virtual timer expired -+ SIGPROF : constant := 27; -- profiling timer expired -+ SIGXCPU : constant := 24; -- CPU time limit exceeded -+ SIGXFSZ : constant := 25; -- filesize limit exceeded -+ SIGUNUSED : constant := 31; -- unused signal (GNU/Linux) -+ SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux) -+ SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal -+ SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal -+ SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal -+ -+ SIGADAABORT : constant := SIGABRT; -+ -- Change this if you want to use another signal for task abort. -+ -- SIGTERM might be a good one. -+ -+ type Signal_Set is array (Natural range <>) of Signal; -+ -+ Unmasked : constant Signal_Set := ( -+ SIGTRAP, -+ -- To enable debugging on multithreaded applications, mark SIGTRAP to -+ -- be kept unmasked. -+ -+ SIGBUS, -+ -+ SIGTTIN, SIGTTOU, SIGTSTP, -+ -- Keep these three signals unmasked so that background processes -+ -- and IO behaves as normal "C" applications -+ -+ SIGPROF, -+ -- To avoid confusing the profiler -+ -+ SIGKILL, SIGSTOP, -+ -- These two signals actually cannot be masked; -+ -- POSIX simply won't allow it. -+ -+ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG); -+ -- These three signals are used by GNU/LinuxThreads starting from -+ -- glibc 2.1 (future 2.2). -+ -+ Reserved : constant Signal_Set := -+ -- I am not sure why the following two signals are reserved. -+ -- I guess they are not supported by this version of GNU/Linux. -+ (SIGVTALRM, SIGUNUSED); -+ -+ type sigset_t is private; -+ -+ function sigaddset (set : access sigset_t; sig : Signal) return int; -+ pragma Import (C, sigaddset, "sigaddset"); -+ -+ function sigdelset (set : access sigset_t; sig : Signal) return int; -+ pragma Import (C, sigdelset, "sigdelset"); -+ -+ function sigfillset (set : access sigset_t) return int; -+ pragma Import (C, sigfillset, "sigfillset"); -+ -+ function sigismember (set : access sigset_t; sig : Signal) return int; -+ pragma Import (C, sigismember, "sigismember"); -+ -+ function sigemptyset (set : access sigset_t) return int; -+ pragma Import (C, sigemptyset, "sigemptyset"); -+ -+ type union_type_3 is new String (1 .. 116); -+ type siginfo_t is record -+ si_signo : int; -+ si_code : int; -+ si_errno : int; -+ X_data : union_type_3; -+ end record; -+ pragma Convention (C, siginfo_t); -+ -+ type struct_sigaction is record -+ sa_handler : System.Address; -+ sa_mask : sigset_t; -+ sa_flags : unsigned_long; -+ sa_restorer : System.Address; -+ end record; -+ pragma Convention (C, struct_sigaction); -+ type struct_sigaction_ptr is access all struct_sigaction; -+ -+ type Machine_State is record -+ eip : unsigned_long; -+ ebx : unsigned_long; -+ esp : unsigned_long; -+ ebp : unsigned_long; -+ esi : unsigned_long; -+ edi : unsigned_long; -+ end record; -+ type Machine_State_Ptr is access all Machine_State; -+ -+ SA_SIGINFO : constant := 16#04#; -+ -+ SIG_BLOCK : constant := 0; -+ SIG_UNBLOCK : constant := 1; -+ SIG_SETMASK : constant := 2; -+ -+ SIG_DFL : constant := 0; -+ SIG_IGN : constant := 1; -+ -+ function sigaction -+ (sig : Signal; -+ act : struct_sigaction_ptr; -+ oact : struct_sigaction_ptr) return int; -+ pragma Import (C, sigaction, "sigaction"); -+ -+ ---------- -+ -- Time -- -+ ---------- -+ -+ type timespec is private; -+ -+ function To_Duration (TS : timespec) return Duration; -+ pragma Inline (To_Duration); -+ -+ function To_Timespec (D : Duration) return timespec; -+ pragma Inline (To_Timespec); -+ -+ type struct_timeval is private; -+ -+ function To_Duration (TV : struct_timeval) return Duration; -+ pragma Inline (To_Duration); -+ -+ function To_Timeval (D : Duration) return struct_timeval; -+ pragma Inline (To_Timeval); -+ -+ function gettimeofday -+ (tv : access struct_timeval; -+ tz : System.Address := System.Null_Address) return int; -+ pragma Import (C, gettimeofday, "gettimeofday"); -+ -+ function sysconf (name : int) return long; -+ pragma Import (C, sysconf); -+ -+ SC_CLK_TCK : constant := 2; -+ SC_NPROCESSORS_ONLN : constant := 84; -+ -+ ------------------------- -+ -- Priority Scheduling -- -+ ------------------------- -+ -+ SCHED_OTHER : constant := 0; -+ SCHED_FIFO : constant := 1; -+ SCHED_RR : constant := 2; -+ -+ function To_Target_Priority -+ (Prio : System.Any_Priority) return Interfaces.C.int; -+ -- Maps System.Any_Priority to a POSIX priority -+ -+ ------------- -+ -- Process -- -+ ------------- -+ -+ type pid_t is private; -+ -+ function kill (pid : pid_t; sig : Signal) return int; -+ pragma Import (C, kill, "kill"); -+ -+ function getpid return pid_t; -+ pragma Import (C, getpid, "getpid"); -+ -+ ------------- -+ -- Threads -- -+ ------------- -+ -+ type Thread_Body is access -+ function (arg : System.Address) return System.Address; -+ pragma Convention (C, Thread_Body); -+ -+ function Thread_Body_Access is new -+ Ada.Unchecked_Conversion (System.Address, Thread_Body); -+ -+ type pthread_t is new unsigned_long; -+ subtype Thread_Id is pthread_t; -+ -+ function To_pthread_t is new Ada.Unchecked_Conversion -+ (unsigned_long, pthread_t); -+ -+ type pthread_mutex_t is limited private; -+ type pthread_cond_t is limited private; -+ type pthread_attr_t is limited private; -+ type pthread_mutexattr_t is limited private; -+ type pthread_condattr_t is limited private; -+ type pthread_key_t is private; -+ -+ PTHREAD_CREATE_DETACHED : constant := 1; -+ -+ ----------- -+ -- Stack -- -+ ----------- -+ -+ function Get_Stack_Base (thread : pthread_t) return Address; -+ pragma Inline (Get_Stack_Base); -+ -- This is a dummy procedure to share some GNULLI files -+ -+ --------------------------------------- -+ -- Nonstandard Thread Initialization -- -+ --------------------------------------- -+ -+ procedure pthread_init; -+ pragma Inline (pthread_init); -+ -- This is a dummy procedure to share some GNULLI files -+ -+ ------------------------- -+ -- POSIX.1c Section 3 -- -+ ------------------------- -+ -+ function sigwait (set : access sigset_t; sig : access Signal) return int; -+ pragma Import (C, sigwait, "sigwait"); -+ -+ function pthread_kill (thread : pthread_t; sig : Signal) return int; -+ pragma Import (C, pthread_kill, "pthread_kill"); -+ -+ function pthread_sigmask -+ (how : int; -+ set : access sigset_t; -+ oset : access sigset_t) return int; -+ pragma Import (C, pthread_sigmask, "pthread_sigmask"); -+ -+ -------------------------- -+ -- POSIX.1c Section 11 -- -+ -------------------------- -+ -+ function pthread_mutexattr_init -+ (attr : access pthread_mutexattr_t) return int; -+ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); -+ -+ function pthread_mutexattr_destroy -+ (attr : access pthread_mutexattr_t) return int; -+ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); -+ -+ function pthread_mutex_init -+ (mutex : access pthread_mutex_t; -+ attr : access pthread_mutexattr_t) return int; -+ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); -+ -+ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; -+ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); -+ -+ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; -+ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); -+ -+ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; -+ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); -+ -+ function pthread_condattr_init -+ (attr : access pthread_condattr_t) return int; -+ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); -+ -+ function pthread_condattr_destroy -+ (attr : access pthread_condattr_t) return int; -+ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); -+ -+ function pthread_cond_init -+ (cond : access pthread_cond_t; -+ attr : access pthread_condattr_t) return int; -+ pragma Import (C, pthread_cond_init, "pthread_cond_init"); -+ -+ function pthread_cond_destroy (cond : access pthread_cond_t) return int; -+ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); -+ -+ function pthread_cond_signal (cond : access pthread_cond_t) return int; -+ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); -+ -+ function pthread_cond_wait -+ (cond : access pthread_cond_t; -+ mutex : access pthread_mutex_t) return int; -+ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); -+ -+ function pthread_cond_timedwait -+ (cond : access pthread_cond_t; -+ mutex : access pthread_mutex_t; -+ abstime : access timespec) return int; -+ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -+ -+ -------------------------- -+ -- POSIX.1c Section 13 -- -+ -------------------------- -+ -+ type struct_sched_param is record -+ sched_priority : int; -- scheduling priority -+ end record; -+ pragma Convention (C, struct_sched_param); -+ -+ function pthread_setschedparam -+ (thread : pthread_t; -+ policy : int; -+ param : access struct_sched_param) return int; -+ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); -+ -+ function pthread_attr_setschedpolicy -+ (attr : access pthread_attr_t; -+ policy : int) return int; -+ pragma Import -+ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy"); -+ -+ function sched_yield return int; -+ pragma Import (C, sched_yield, "sched_yield"); -+ -+ --------------------------- -+ -- P1003.1c - Section 16 -- -+ --------------------------- -+ -+ function pthread_attr_init -+ (attributes : access pthread_attr_t) return int; -+ pragma Import (C, pthread_attr_init, "pthread_attr_init"); -+ -+ function pthread_attr_destroy -+ (attributes : access pthread_attr_t) return int; -+ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); -+ -+ function pthread_attr_setdetachstate -+ (attr : access pthread_attr_t; -+ detachstate : int) return int; -+ pragma Import -+ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); -+ -+ function pthread_attr_setstacksize -+ (attr : access pthread_attr_t; -+ stacksize : size_t) return int; -+ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); -+ -+ function pthread_create -+ (thread : access pthread_t; -+ attributes : access pthread_attr_t; -+ start_routine : Thread_Body; -+ arg : System.Address) return int; -+ pragma Import (C, pthread_create, "pthread_create"); -+ -+ procedure pthread_exit (status : System.Address); -+ pragma Import (C, pthread_exit, "pthread_exit"); -+ -+ function pthread_self return pthread_t; -+ pragma Import (C, pthread_self, "pthread_self"); -+ -+ -------------------------- -+ -- POSIX.1c Section 17 -- -+ -------------------------- -+ -+ function pthread_setspecific -+ (key : pthread_key_t; -+ value : System.Address) return int; -+ pragma Import (C, pthread_setspecific, "pthread_setspecific"); -+ -+ function pthread_getspecific (key : pthread_key_t) return System.Address; -+ pragma Import (C, pthread_getspecific, "pthread_getspecific"); -+ -+ type destructor_pointer is access procedure (arg : System.Address); -+ pragma Convention (C, destructor_pointer); -+ -+ function pthread_key_create -+ (key : access pthread_key_t; -+ destructor : destructor_pointer) return int; -+ pragma Import (C, pthread_key_create, "pthread_key_create"); -+ -+ CPU_SETSIZE : constant := 1_024; -+ -+ type bit_field is array (1 .. CPU_SETSIZE) of Boolean; -+ for bit_field'Size use CPU_SETSIZE; -+ pragma Pack (bit_field); -+ pragma Convention (C, bit_field); -+ -+ type cpu_set_t is record -+ bits : bit_field; -+ end record; -+ pragma Convention (C, cpu_set_t); -+ -+ function pthread_setaffinity_np -+ (thread : pthread_t; -+ cpusetsize : size_t; -+ cpuset : access cpu_set_t) return int; -+ pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np"); -+ -+ ------------------- -+ -- Win32 compat -- -+ ------------------- -+ -+ ------------------- -+ -- General Types -- -+ ------------------- -+ -+ type DWORD is new Interfaces.C.unsigned_long; -+ type WORD is new Interfaces.C.unsigned_short; -+ -+ -- The LARGE_INTEGER type is actually a fixed point type -+ -- that only can represent integers. The reason for this is -+ -- easier conversion to Duration or other fixed point types. -+ -- (See Operations.Clock) -+ -+ type LARGE_INTEGER is delta 1.0 range -2.0**63 .. 2.0**63 - 1.0; -+ -+ subtype PSZ is Interfaces.C.Strings.chars_ptr; -+ subtype PCHAR is Interfaces.C.Strings.chars_ptr; -+ -+ subtype PVOID is System.Address; -+ -+ Null_Void : constant PVOID := System.Null_Address; -+ -+ type PLONG is access all Interfaces.C.long; -+ type PDWORD is access all DWORD; -+ -+ type BOOL is new Boolean; -+ for BOOL'Size use Interfaces.C.unsigned_long'Size; -+ -+ ------------------------- -+ -- Handles for objects -- -+ ------------------------- -+ -+ type HANDLE is new Interfaces.C.long; -+ type PHANDLE is access all HANDLE; -+ -+ subtype Win32_Thread_Id is HANDLE; -+ -+ ------------------------ -+ -- System Information -- -+ ------------------------ -+ -+ type SYSTEM_INFO is record -+ dwOemId : DWORD; -+ dwPageSize : DWORD; -+ lpMinimumApplicationAddress : PVOID; -+ lpMaximumApplicationAddress : PVOID; -+ dwActiveProcessorMask : DWORD; -+ dwNumberOfProcessors : DWORD; -+ dwProcessorType : DWORD; -+ dwAllocationGranularity : DWORD; -+ dwReserved : DWORD; -+ end record; -+ -+ procedure GetSystemInfo (SI : access SYSTEM_INFO); -+ pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo"); -+ -+ --------------------- -+ -- Time Management -- -+ --------------------- -+ -+ procedure Sleep (dwMilliseconds : DWORD); -+ pragma Import (Stdcall, Sleep, External_Name => "Sleep"); -+ -+ type SYSTEMTIME is record -+ wYear : WORD; -+ wMonth : WORD; -+ wDayOfWeek : WORD; -+ wDay : WORD; -+ wHour : WORD; -+ wMinute : WORD; -+ wSecond : WORD; -+ wMilliseconds : WORD; -+ end record; -+ -+ procedure GetSystemTime (pSystemTime : access SYSTEMTIME); -+ pragma Import (Stdcall, GetSystemTime, "GetSystemTime"); -+ -+ procedure GetSystemTimeAsFileTime (lpFileTime : access Long_Long_Integer); -+ pragma Import (Stdcall, GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime"); -+ -+ function SetSystemTime (pSystemTime : access SYSTEMTIME) return BOOL; -+ pragma Import (Stdcall, SetSystemTime, "SetSystemTime"); -+ -+ function FileTimeToSystemTime -+ (lpFileTime : access Long_Long_Integer; -+ lpSystemTime : access SYSTEMTIME) return BOOL; -+ pragma Import (Stdcall, FileTimeToSystemTime, "FileTimeToSystemTime"); -+ -+ function SystemTimeToFileTime -+ (lpSystemTime : access SYSTEMTIME; -+ lpFileTime : access Long_Long_Integer) return BOOL; -+ pragma Import (Stdcall, SystemTimeToFileTime, "SystemTimeToFileTime"); -+ -+ function FileTimeToLocalFileTime -+ (lpFileTime : access Long_Long_Integer; -+ lpLocalFileTime : access Long_Long_Integer) return BOOL; -+ pragma Import (Stdcall, FileTimeToLocalFileTime, "FileTimeToLocalFileTime"); -+ -+ function LocalFileTimeToFileTime -+ (lpFileTime : access Long_Long_Integer; -+ lpLocalFileTime : access Long_Long_Integer) return BOOL; -+ pragma Import (Stdcall, LocalFileTimeToFileTime, "LocalFileTimeToFileTime"); -+ -+ function QueryPerformanceCounter -+ (lpPerformanceCount : access LARGE_INTEGER) return BOOL; -+ pragma Import -+ (Stdcall, QueryPerformanceCounter, "QueryPerformanceCounter"); -+ -+ function QueryPerformanceFrequency -+ (lpFrequency : access LARGE_INTEGER) return BOOL; -+ pragma Import -+ (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency"); -+ -+ ------------- -+ -- Threads -- -+ ------------- -+ -+-- type Win32_Thread_Body is access -+-- function (arg : System.Address) return System.Address; -+-- pragma Convention (C, Thread_Body); -+ -+-- function Win32_Thread_Body_Access is new -+-- Ada.Unchecked_Conversion (System.Address, Thread_Body); -+ -+ procedure SwitchToThread; -+ pragma Import (Stdcall, SwitchToThread, "SwitchToThread"); -+ -+ function GetThreadTimes -+ (hThread : HANDLE; -+ lpCreationTime : access Long_Long_Integer; -+ lpExitTime : access Long_Long_Integer; -+ lpKernelTime : access Long_Long_Integer; -+ lpUserTime : access Long_Long_Integer) return BOOL; -+ pragma Import (Stdcall, GetThreadTimes, "GetThreadTimes"); -+ -+ ----------------------- -+ -- Critical sections -- -+ ----------------------- -+ -+ type CRITICAL_SECTION is private; -+ -+ procedure InitializeCriticalSection -+ (pCriticalSection : access CRITICAL_SECTION); -+ pragma Import -+ (Stdcall, InitializeCriticalSection, "InitializeCriticalSection"); -+ -+ procedure EnterCriticalSection -+ (pCriticalSection : access CRITICAL_SECTION); -+ pragma Import (Stdcall, EnterCriticalSection, "EnterCriticalSection"); -+ -+ procedure LeaveCriticalSection -+ (pCriticalSection : access CRITICAL_SECTION); -+ pragma Import (Stdcall, LeaveCriticalSection, "LeaveCriticalSection"); -+ -+ procedure DeleteCriticalSection -+ (pCriticalSection : access CRITICAL_SECTION); -+ pragma Import (Stdcall, DeleteCriticalSection, "DeleteCriticalSection"); -+ -+ ------------------------------------------------------------- -+ -- Thread Creation, Activation, Suspension And Termination -- -+ ------------------------------------------------------------- -+ -+ subtype ProcessorId is DWORD; -+ -+ type PTHREAD_START_ROUTINE is access function -+ (pThreadParameter : PVOID) return DWORD; -+ pragma Convention (Stdcall, PTHREAD_START_ROUTINE); -+ -+ function To_PTHREAD_START_ROUTINE is new -+ Ada.Unchecked_Conversion (System.Address, PTHREAD_START_ROUTINE); -+ -+ type SECURITY_ATTRIBUTES is record -+ nLength : DWORD; -+ pSecurityDescriptor : PVOID; -+ bInheritHandle : BOOL; -+ end record; -+ -+ type PSECURITY_ATTRIBUTES is access all SECURITY_ATTRIBUTES; -+ -+ function CreateThread -+ (pThreadAttributes : PSECURITY_ATTRIBUTES; -+ dwStackSize : DWORD; -+ pStartAddress : PTHREAD_START_ROUTINE; -+ pParameter : PVOID; -+ dwCreationFlags : DWORD; -+ pThreadId : PDWORD) return HANDLE; -+ pragma Import (Stdcall, CreateThread, "CreateThread"); -+ -+ function BeginThreadEx -+ (pThreadAttributes : PSECURITY_ATTRIBUTES; -+ dwStackSize : DWORD; -+ pStartAddress : PTHREAD_START_ROUTINE; -+ pParameter : PVOID; -+ dwCreationFlags : DWORD; -+ pThreadId : PDWORD) return HANDLE; -+ pragma Import (C, BeginThreadEx, "_beginthreadex"); -+ -+ Debug_Process : constant := 16#00000001#; -+ Debug_Only_This_Process : constant := 16#00000002#; -+ Create_Suspended : constant := 16#00000004#; -+ Detached_Process : constant := 16#00000008#; -+ Create_New_Console : constant := 16#00000010#; -+ -+ Create_New_Process_Group : constant := 16#00000200#; -+ -+ Create_No_window : constant := 16#08000000#; -+ -+ Profile_User : constant := 16#10000000#; -+ Profile_Kernel : constant := 16#20000000#; -+ Profile_Server : constant := 16#40000000#; -+ -+ Stack_Size_Param_Is_A_Reservation : constant := 16#00010000#; -+ -+ function GetExitCodeThread -+ (hThread : HANDLE; -+ pExitCode : PDWORD) return BOOL; -+ pragma Import (Stdcall, GetExitCodeThread, "GetExitCodeThread"); -+ -+ function ResumeThread (hThread : HANDLE) return DWORD; -+ pragma Import (Stdcall, ResumeThread, "ResumeThread"); -+ -+ function SuspendThread (hThread : HANDLE) return DWORD; -+ pragma Import (Stdcall, SuspendThread, "SuspendThread"); -+ -+ procedure ExitThread (dwExitCode : DWORD); -+ pragma Import (Stdcall, ExitThread, "ExitThread"); -+ -+ procedure EndThreadEx (dwExitCode : DWORD); -+ pragma Import (C, EndThreadEx, "_endthreadex"); -+ -+ function TerminateThread -+ (hThread : HANDLE; -+ dwExitCode : DWORD) return BOOL; -+ pragma Import (Stdcall, TerminateThread, "TerminateThread"); -+ -+ function GetCurrentThread return HANDLE; -+ pragma Import (Stdcall, GetCurrentThread, "GetCurrentThread"); -+ -+ function GetCurrentProcess return HANDLE; -+ pragma Import (Stdcall, GetCurrentProcess, "GetCurrentProcess"); -+ -+ function GetCurrentThreadId return DWORD; -+ pragma Import (Stdcall, GetCurrentThreadId, "GetCurrentThreadId"); -+ -+ function TlsAlloc return DWORD; -+ pragma Import (Stdcall, TlsAlloc, "TlsAlloc"); -+ -+ function TlsGetValue (dwTlsIndex : DWORD) return PVOID; -+ pragma Import (Stdcall, TlsGetValue, "TlsGetValue"); -+ -+ function TlsSetValue (dwTlsIndex : DWORD; pTlsValue : PVOID) return BOOL; -+ pragma Import (Stdcall, TlsSetValue, "TlsSetValue"); -+ -+ function TlsFree (dwTlsIndex : DWORD) return BOOL; -+ pragma Import (Stdcall, TlsFree, "TlsFree"); -+ -+ TLS_Nothing : constant := DWORD'Last; -+ -+ procedure ExitProcess (uExitCode : Interfaces.C.unsigned); -+ pragma Import (Stdcall, ExitProcess, "ExitProcess"); -+ -+ function WaitForSingleObject -+ (hHandle : HANDLE; -+ dwMilliseconds : DWORD) return DWORD; -+ pragma Import (Stdcall, WaitForSingleObject, "WaitForSingleObject"); -+ -+ function WaitForSingleObjectEx -+ (hHandle : HANDLE; -+ dwMilliseconds : DWORD; -+ fAlertable : BOOL) return DWORD; -+ pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx"); -+ -+ function SetThreadIdealProcessor -+ (hThread : HANDLE; -+ dwIdealProcessor : ProcessorId) return DWORD; -+ pragma Import (Stdcall, SetThreadIdealProcessor, "SetThreadIdealProcessor"); -+ -+ Wait_Infinite : constant := DWORD'Last; -+ WAIT_TIMEOUT : constant := 16#0000_0102#; -+ WAIT_FAILED : constant := 16#FFFF_FFFF#; -+ -+ ------------------------------------ -+ -- Semaphores, Events and Mutexes -- -+ ------------------------------------ -+ -+ function CloseHandle (hObject : HANDLE) return BOOL; -+ pragma Import (Stdcall, CloseHandle, "CloseHandle"); -+ -+ function CreateSemaphore -+ (pSemaphoreAttributes : PSECURITY_ATTRIBUTES; -+ lInitialCount : Interfaces.C.long; -+ lMaximumCount : Interfaces.C.long; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, CreateSemaphore, "CreateSemaphoreA"); -+ -+ function OpenSemaphore -+ (dwDesiredAccess : DWORD; -+ bInheritHandle : BOOL; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, OpenSemaphore, "OpenSemaphoreA"); -+ -+ function ReleaseSemaphore -+ (hSemaphore : HANDLE; -+ lReleaseCount : Interfaces.C.long; -+ pPreviousCount : PLONG) return BOOL; -+ pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore"); -+ -+ function CreateEvent -+ (pEventAttributes : PSECURITY_ATTRIBUTES; -+ bManualReset : BOOL; -+ bInitialState : BOOL; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, CreateEvent, "CreateEventA"); -+ -+ function OpenEvent -+ (dwDesiredAccess : DWORD; -+ bInheritHandle : BOOL; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, OpenEvent, "OpenEventA"); -+ -+ function SetEvent (hEvent : HANDLE) return BOOL; -+ pragma Import (Stdcall, SetEvent, "SetEvent"); -+ -+ function ResetEvent (hEvent : HANDLE) return BOOL; -+ pragma Import (Stdcall, ResetEvent, "ResetEvent"); -+ -+ function PulseEvent (hEvent : HANDLE) return BOOL; -+ pragma Import (Stdcall, PulseEvent, "PulseEvent"); -+ -+ function CreateMutex -+ (pMutexAttributes : PSECURITY_ATTRIBUTES; -+ bInitialOwner : BOOL; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, CreateMutex, "CreateMutexA"); -+ -+ function OpenMutex -+ (dwDesiredAccess : DWORD; -+ bInheritHandle : BOOL; -+ pName : PSZ) return HANDLE; -+ pragma Import (Stdcall, OpenMutex, "OpenMutexA"); -+ -+ function ReleaseMutex (hMutex : HANDLE) return BOOL; -+ pragma Import (Stdcall, ReleaseMutex, "ReleaseMutex"); -+ -+ --------------------------------------------------- -+ -- Accessing properties of Threads and Processes -- -+ --------------------------------------------------- -+ -+ ----------------- -+ -- Priorities -- -+ ----------------- -+ -+ function SetThreadPriority -+ (hThread : HANDLE; -+ nPriority : Interfaces.C.int) return BOOL; -+ pragma Import (Stdcall, SetThreadPriority, "SetThreadPriority"); -+ -+ function GetThreadPriority (hThread : HANDLE) return Interfaces.C.int; -+ pragma Import (Stdcall, GetThreadPriority, "GetThreadPriority"); -+ -+ function SetPriorityClass -+ (hProcess : HANDLE; -+ dwPriorityClass : DWORD) return BOOL; -+ pragma Import (Stdcall, SetPriorityClass, "SetPriorityClass"); -+ -+ procedure SetThreadPriorityBoost -+ (hThread : HANDLE; -+ DisablePriorityBoost : BOOL); -+ pragma Import (Stdcall, SetThreadPriorityBoost, "SetThreadPriorityBoost"); -+ -+ Normal_Priority_Class : constant := 16#00000020#; -+ Idle_Priority_Class : constant := 16#00000040#; -+ High_Priority_Class : constant := 16#00000080#; -+ Realtime_Priority_Class : constant := 16#00000100#; -+ -+ Thread_Priority_Idle : constant := -15; -+ Thread_Priority_Lowest : constant := -2; -+ Thread_Priority_Below_Normal : constant := -1; -+ Thread_Priority_Normal : constant := 0; -+ Thread_Priority_Above_Normal : constant := 1; -+ Thread_Priority_Highest : constant := 2; -+ Thread_Priority_Time_Critical : constant := 15; -+ Thread_Priority_Error_Return : constant := Interfaces.C.long'Last; -+ -+ function GetLastError return DWORD; -+ pragma Import (Stdcall, GetLastError, "GetLastError"); -+ -+private -+ -+ type sigset_t is array (0 .. 127) of unsigned_char; -+ pragma Convention (C, sigset_t); -+ for sigset_t'Alignment use unsigned_long'Alignment; -+ -+ type pid_t is new int; -+ -+ type time_t is new long; -+ -+ type timespec is record -+ tv_sec : time_t; -+ tv_nsec : long; -+ end record; -+ pragma Convention (C, timespec); -+ -+ type struct_timeval is record -+ tv_sec : time_t; -+ tv_usec : time_t; -+ end record; -+ pragma Convention (C, struct_timeval); -+ -+ type pthread_attr_t is record -+ detachstate : int; -+ schedpolicy : int; -+ schedparam : struct_sched_param; -+ inheritsched : int; -+ scope : int; -+ guardsize : size_t; -+ stackaddr_set : int; -+ stackaddr : System.Address; -+ stacksize : size_t; -+ end record; -+ pragma Convention (C, pthread_attr_t); -+ -+ type pthread_condattr_t is record -+ dummy : int; -+ end record; -+ pragma Convention (C, pthread_condattr_t); -+ -+ type pthread_mutexattr_t is record -+ mutexkind : int; -+ end record; -+ pragma Convention (C, pthread_mutexattr_t); -+ -+ type struct_pthread_fast_lock is record -+ status : long; -+ spinlock : int; -+ end record; -+ pragma Convention (C, struct_pthread_fast_lock); -+ -+ type pthread_mutex_t is record -+ m_reserved : int; -+ m_count : int; -+ m_owner : System.Address; -+ m_kind : int; -+ m_lock : struct_pthread_fast_lock; -+ end record; -+ pragma Convention (C, pthread_mutex_t); -+ -+ type pthread_cond_t is array (0 .. 47) of unsigned_char; -+ pragma Convention (C, pthread_cond_t); -+ -+ type pthread_key_t is new unsigned; -+ -+ ------------------- -+ -- Win32 private -- -+ ------------------- -+ -+ type CRITICAL_SECTION is record -+ DebugInfo : System.Address; -+ -- The following three fields control entering and -+ -- exiting the critical section for the resource -+ LockCount : Long_Integer; -+ RecursionCount : Long_Integer; -+ OwningThread : HANDLE; -+ LockSemaphore : HANDLE; -+ Reserved : DWORD; -+ end record; -+ -+end System.OS_Interface; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/s-taprop-cygwin.adb src/gcc-4.5.0/gcc/ada/s-taprop-cygwin.adb ---- origsrc/gcc-4.5.0/gcc/ada/s-taprop-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/s-taprop-cygwin.adb 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,1339 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -+-- -- -+-- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S -- -+-- -- -+-- B o d y -- -+-- -- -+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -+-- -- -+-- GNARL is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNARL; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNARL was developed by the GNARL team at Florida State University. -- -+-- Extensive contributions were provided by Ada Core Technologies, Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+-- This is a GNU/Linux (GNU/LinuxThreads) version of this package -+ -+-- This package contains all the GNULL primitives that interface directly -+-- with the underlying OS. -+ -+pragma Polling (Off); -+-- Turn off polling, we do not want ATC polling to take place during -+-- tasking operations. It causes infinite loops and other problems. -+ -+with Interfaces.C; -+-- used for int -+-- size_t -+ -+with System.Task_Info; -+-- used for Unspecified_Task_Info -+ -+with System.Tasking.Debug; -+-- used for Known_Tasks -+ -+with System.Interrupt_Management; -+-- used for Keep_Unmasked -+-- Abort_Task_Interrupt -+-- Interrupt_ID -+ -+with System.OS_Primitives; -+-- used for Delay_Modes -+ -+with System.Soft_Links; -+-- used for Abort_Defer/Undefer -+ -+-- We use System.Soft_Links instead of System.Tasking.Initialization -+-- because the later is a higher level package that we shouldn't depend on. -+-- For example when using the restricted run time, it is replaced by -+-- System.Tasking.Restricted.Stages. -+ -+with System.Storage_Elements; -+with System.Stack_Checking.Operations; -+-- Used for Invalidate_Stack_Cache and Notify_Stack_Attributes; -+ -+with Ada.Exceptions; -+-- used for Raise_Exception -+-- Raise_From_Signal_Handler -+-- Exception_Id -+ -+with Ada.Unchecked_Conversion; -+with Ada.Unchecked_Deallocation; -+ -+package body System.Task_Primitives.Operations is -+ -+ package SSL renames System.Soft_Links; -+ package SC renames System.Stack_Checking.Operations; -+ -+ use System.Tasking.Debug; -+ use System.Tasking; -+ use Interfaces.C; -+ use System.OS_Interface; -+ use System.Parameters; -+ use System.OS_Primitives; -+ use System.Storage_Elements; -+ use System.Task_Info; -+ -+ ---------------- -+ -- Local Data -- -+ ---------------- -+ -+ -- The followings are logically constants, but need to be initialized -+ -- at run time. -+ -+ Single_RTS_Lock : aliased RTS_Lock; -+ -- This is a lock to allow only one thread of control in the RTS at -+ -- a time; it is used to execute in mutual exclusion from all other tasks. -+ -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List -+ -+ ATCB_Key : aliased pthread_key_t; -+ -- Key used to find the Ada Task_Id associated with a thread -+ -+ Environment_Task_Id : Task_Id; -+ -- A variable to hold Task_Id for the environment task -+ -+ Unblocked_Signal_Mask : aliased sigset_t; -+ -- The set of signals that should be unblocked in all tasks -+ -+ -- The followings are internal configuration constants needed -+ -+ Next_Serial_Number : Task_Serial_Number := 100; -+ -- We start at 100 (reserve some special values for using in error checks) -+ -+ Time_Slice_Val : Integer; -+ pragma Import (C, Time_Slice_Val, "__gl_time_slice_val"); -+ -+ Dispatching_Policy : Character; -+ pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy"); -+ -+ -- The following are effectively constants, but they need to be initialized -+ -- by calling a pthread_ function. -+ -+ Mutex_Attr : aliased pthread_mutexattr_t; -+ Cond_Attr : aliased pthread_condattr_t; -+ -+ Foreign_Task_Elaborated : aliased Boolean := True; -+ -- Used to identified fake tasks (i.e., non-Ada Threads) -+ -+ -------------------- -+ -- Local Packages -- -+ -------------------- -+ -+ package Specific is -+ -+ procedure Initialize (Environment_Task : Task_Id); -+ pragma Inline (Initialize); -+ -- Initialize various data needed by this package -+ -+ function Is_Valid_Task return Boolean; -+ pragma Inline (Is_Valid_Task); -+ -- Does executing thread have a TCB? -+ -+ procedure Set (Self_Id : Task_Id); -+ pragma Inline (Set); -+ -- Set the self id for the current task -+ -+ function Self return Task_Id; -+ pragma Inline (Self); -+ -- Return a pointer to the Ada Task Control Block of the calling task -+ -+ end Specific; -+ -+ package body Specific is separate; -+ -- The body of this package is target specific -+ -+ --------------------------------- -+ -- Support for foreign threads -- -+ --------------------------------- -+ -+ function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id; -+ -- Allocate and Initialize a new ATCB for the current Thread -+ -+ function Register_Foreign_Thread -+ (Thread : Thread_Id) return Task_Id is separate; -+ -+ ----------------------- -+ -- Local Subprograms -- -+ ----------------------- -+ -+ subtype unsigned_long is Interfaces.C.unsigned_long; -+ -+ procedure Abort_Handler (signo : Signal); -+ -+ function To_pthread_t is new Ada.Unchecked_Conversion -+ (unsigned_long, System.OS_Interface.pthread_t); -+ -+ procedure Get_Stack_Attributes -+ (T : Task_Id; -+ ISP : out System.Address; -+ Size : out Storage_Offset); -+ -- Fill ISP and Size with the Initial Stack Pointer value and the -+ -- thread stack size for task T. -+ -+ ------------------- -+ -- Abort_Handler -- -+ ------------------- -+ -+ procedure Abort_Handler (signo : Signal) is -+ pragma Unreferenced (signo); -+ -+ Self_Id : constant Task_Id := Self; -+ Result : Interfaces.C.int; -+ Old_Set : aliased sigset_t; -+ -+ begin -+ if ZCX_By_Default and then GCC_ZCX_Support then -+ return; -+ end if; -+ -+ if Self_Id.Deferral_Level = 0 -+ and then Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level -+ and then not Self_Id.Aborting -+ then -+ Self_Id.Aborting := True; -+ -+ -- Make sure signals used for RTS internal purpose are unmasked -+ -+ Result := -+ pthread_sigmask -+ (SIG_UNBLOCK, -+ Unblocked_Signal_Mask'Access, -+ Old_Set'Access); -+ pragma Assert (Result = 0); -+ -+ raise Standard'Abort_Signal; -+ end if; -+ end Abort_Handler; -+ -+ -------------- -+ -- Lock_RTS -- -+ -------------- -+ -+ procedure Lock_RTS is -+ begin -+ Write_Lock (Single_RTS_Lock'Access, Global_Lock => True); -+ end Lock_RTS; -+ -+ ---------------- -+ -- Unlock_RTS -- -+ ---------------- -+ -+ procedure Unlock_RTS is -+ begin -+ Unlock (Single_RTS_Lock'Access, Global_Lock => True); -+ end Unlock_RTS; -+ -+ ----------------- -+ -- Stack_Guard -- -+ ----------------- -+ -+ -- The underlying thread system extends the memory (up to 2MB) when needed -+ -+ procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is -+ pragma Unreferenced (T); -+ pragma Unreferenced (On); -+ begin -+ null; -+ end Stack_Guard; -+ -+ -------------------- -+ -- Get_Thread_Id -- -+ -------------------- -+ -+ function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is -+ begin -+ return T.Common.LL.Thread; -+ end Get_Thread_Id; -+ -+ ---------- -+ -- Self -- -+ ---------- -+ -+ function Self return Task_Id renames Specific.Self; -+ -+ --------------------- -+ -- Initialize_Lock -- -+ --------------------- -+ -+ -- Note: mutexes and cond_variables needed per-task basis are -+ -- initialized in Initialize_TCB and the Storage_Error is -+ -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...) -+ -- used in RTS is initialized before any status change of RTS. -+ -- Therefore rasing Storage_Error in the following routines -+ -- should be able to be handled safely. -+ -+ procedure Initialize_Lock -+ (Prio : System.Any_Priority; -+ L : not null access Lock) -+ is -+ pragma Unreferenced (Prio); -+ -+ Result : Interfaces.C.int; -+ -+ begin -+ Result := pthread_mutex_init (L, Mutex_Attr'Access); -+ -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result = ENOMEM then -+ Ada.Exceptions.Raise_Exception (Storage_Error'Identity, -+ "Failed to allocate a lock"); -+ end if; -+ end Initialize_Lock; -+ -+ procedure Initialize_Lock -+ (L : not null access RTS_Lock; -+ Level : Lock_Level) -+ is -+ pragma Unreferenced (Level); -+ -+ Result : Interfaces.C.int; -+ -+ begin -+ Result := pthread_mutex_init (L, Mutex_Attr'Access); -+ -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result = ENOMEM then -+ raise Storage_Error; -+ end if; -+ end Initialize_Lock; -+ -+ ------------------- -+ -- Finalize_Lock -- -+ ------------------- -+ -+ procedure Finalize_Lock (L : not null access Lock) is -+ Result : Interfaces.C.int; -+ begin -+ Result := pthread_mutex_destroy (L); -+ pragma Assert (Result = 0); -+ end Finalize_Lock; -+ -+ procedure Finalize_Lock (L : not null access RTS_Lock) is -+ Result : Interfaces.C.int; -+ begin -+ Result := pthread_mutex_destroy (L); -+ pragma Assert (Result = 0); -+ end Finalize_Lock; -+ -+ ---------------- -+ -- Write_Lock -- -+ ---------------- -+ -+ procedure Write_Lock -+ (L : not null access Lock; -+ Ceiling_Violation : out Boolean) -+ is -+ Result : Interfaces.C.int; -+ begin -+ Result := pthread_mutex_lock (L); -+ Ceiling_Violation := Result = EINVAL; -+ -+ -- Assume the cause of EINVAL is a priority ceiling violation -+ -+ pragma Assert (Result = 0 or else Result = EINVAL); -+ end Write_Lock; -+ -+ procedure Write_Lock -+ (L : not null access RTS_Lock; -+ Global_Lock : Boolean := False) -+ is -+ Result : Interfaces.C.int; -+ begin -+ if not Single_Lock or else Global_Lock then -+ Result := pthread_mutex_lock (L); -+ pragma Assert (Result = 0); -+ end if; -+ end Write_Lock; -+ -+ procedure Write_Lock (T : Task_Id) is -+ Result : Interfaces.C.int; -+ begin -+ if not Single_Lock then -+ Result := pthread_mutex_lock (T.Common.LL.L'Access); -+ pragma Assert (Result = 0); -+ end if; -+ end Write_Lock; -+ -+ --------------- -+ -- Read_Lock -- -+ --------------- -+ -+ procedure Read_Lock -+ (L : not null access Lock; -+ Ceiling_Violation : out Boolean) -+ is -+ begin -+ Write_Lock (L, Ceiling_Violation); -+ end Read_Lock; -+ -+ ------------ -+ -- Unlock -- -+ ------------ -+ -+ procedure Unlock (L : not null access Lock) is -+ Result : Interfaces.C.int; -+ begin -+ Result := pthread_mutex_unlock (L); -+ pragma Assert (Result = 0); -+ end Unlock; -+ -+ procedure Unlock -+ (L : not null access RTS_Lock; -+ Global_Lock : Boolean := False) -+ is -+ Result : Interfaces.C.int; -+ begin -+ if not Single_Lock or else Global_Lock then -+ Result := pthread_mutex_unlock (L); -+ pragma Assert (Result = 0); -+ end if; -+ end Unlock; -+ -+ procedure Unlock (T : Task_Id) is -+ Result : Interfaces.C.int; -+ begin -+ if not Single_Lock then -+ Result := pthread_mutex_unlock (T.Common.LL.L'Access); -+ pragma Assert (Result = 0); -+ end if; -+ end Unlock; -+ -+ ----------------- -+ -- Set_Ceiling -- -+ ----------------- -+ -+ -- Dynamic priority ceilings are not supported by the underlying system -+ -+ procedure Set_Ceiling -+ (L : not null access Lock; -+ Prio : System.Any_Priority) -+ is -+ pragma Unreferenced (L, Prio); -+ begin -+ null; -+ end Set_Ceiling; -+ -+ ----------- -+ -- Sleep -- -+ ----------- -+ -+ procedure Sleep -+ (Self_ID : Task_Id; -+ Reason : System.Tasking.Task_States) -+ is -+ pragma Unreferenced (Reason); -+ -+ Result : Interfaces.C.int; -+ -+ begin -+ pragma Assert (Self_ID = Self); -+ -+ if Single_Lock then -+ Result := -+ pthread_cond_wait -+ (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access); -+ else -+ Result := -+ pthread_cond_wait -+ (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access); -+ end if; -+ -+ -- EINTR is not considered a failure -+ -+ pragma Assert (Result = 0 or else Result = EINTR); -+ end Sleep; -+ -+ ----------------- -+ -- Timed_Sleep -- -+ ----------------- -+ -+ -- This is for use within the run-time system, so abort is -+ -- assumed to be already deferred, and the caller should be -+ -- holding its own ATCB lock. -+ -+ procedure Timed_Sleep -+ (Self_ID : Task_Id; -+ Time : Duration; -+ Mode : ST.Delay_Modes; -+ Reason : System.Tasking.Task_States; -+ Timedout : out Boolean; -+ Yielded : out Boolean) -+ is -+ pragma Unreferenced (Reason); -+ -+ Base_Time : constant Duration := Monotonic_Clock; -+ Check_Time : Duration := Base_Time; -+ Abs_Time : Duration; -+ Request : aliased timespec; -+ Result : Interfaces.C.int; -+ -+ begin -+ Timedout := True; -+ Yielded := False; -+ -+ if Mode = Relative then -+ Abs_Time := Duration'Min (Time, Max_Sensible_Delay) + Check_Time; -+ else -+ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); -+ end if; -+ -+ if Abs_Time > Check_Time then -+ Request := To_Timespec (Abs_Time); -+ -+ loop -+ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; -+ -+ if Single_Lock then -+ Result := -+ pthread_cond_timedwait -+ (Self_ID.Common.LL.CV'Access, -+ Single_RTS_Lock'Access, -+ Request'Access); -+ -+ else -+ Result := -+ pthread_cond_timedwait -+ (Self_ID.Common.LL.CV'Access, -+ Self_ID.Common.LL.L'Access, -+ Request'Access); -+ end if; -+ -+ Check_Time := Monotonic_Clock; -+ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; -+ -+ if Result = 0 or else Result = EINTR then -+ -+ -- Somebody may have called Wakeup for us -+ -+ Timedout := False; -+ exit; -+ end if; -+ -+ pragma Assert (Result = ETIMEDOUT); -+ end loop; -+ end if; -+ end Timed_Sleep; -+ -+ ----------------- -+ -- Timed_Delay -- -+ ----------------- -+ -+ -- This is for use in implementing delay statements, so we assume the -+ -- caller is abort-deferred but is holding no locks. -+ -+ procedure Timed_Delay -+ (Self_ID : Task_Id; -+ Time : Duration; -+ Mode : ST.Delay_Modes) -+ is -+ Base_Time : constant Duration := Monotonic_Clock; -+ Check_Time : Duration := Base_Time; -+ Abs_Time : Duration; -+ Request : aliased timespec; -+ -+ Result : Interfaces.C.int; -+ pragma Warnings (Off, Result); -+ -+ begin -+ if Single_Lock then -+ Lock_RTS; -+ end if; -+ -+ Write_Lock (Self_ID); -+ -+ if Mode = Relative then -+ Abs_Time := Time + Check_Time; -+ else -+ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); -+ end if; -+ -+ if Abs_Time > Check_Time then -+ Request := To_Timespec (Abs_Time); -+ Self_ID.Common.State := Delay_Sleep; -+ -+ loop -+ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; -+ -+ if Single_Lock then -+ Result := pthread_cond_timedwait -+ (Self_ID.Common.LL.CV'Access, -+ Single_RTS_Lock'Access, -+ Request'Access); -+ else -+ Result := pthread_cond_timedwait -+ (Self_ID.Common.LL.CV'Access, -+ Self_ID.Common.LL.L'Access, -+ Request'Access); -+ end if; -+ -+ Check_Time := Monotonic_Clock; -+ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; -+ -+ pragma Assert (Result = 0 or else -+ Result = ETIMEDOUT or else -+ Result = EINTR); -+ end loop; -+ -+ Self_ID.Common.State := Runnable; -+ end if; -+ -+ Unlock (Self_ID); -+ -+ if Single_Lock then -+ Unlock_RTS; -+ end if; -+ -+ Result := sched_yield; -+ end Timed_Delay; -+ -+ --------------------- -+ -- Monotonic_Clock -- -+ --------------------- -+ -+ function Monotonic_Clock return Duration is -+ TV : aliased struct_timeval; -+ Result : Interfaces.C.int; -+ begin -+ Result := gettimeofday (TV'Access, System.Null_Address); -+ pragma Assert (Result = 0); -+ return To_Duration (TV); -+ end Monotonic_Clock; -+ -+ ------------------- -+ -- RT_Resolution -- -+ ------------------- -+ -+ function RT_Resolution return Duration is -+ begin -+ return 10#1.0#E-6; -+ end RT_Resolution; -+ -+ ------------ -+ -- Wakeup -- -+ ------------ -+ -+ procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is -+ pragma Unreferenced (Reason); -+ Result : Interfaces.C.int; -+ begin -+ Result := pthread_cond_signal (T.Common.LL.CV'Access); -+ pragma Assert (Result = 0); -+ end Wakeup; -+ -+ ----------- -+ -- Yield -- -+ ----------- -+ -+ procedure Yield (Do_Yield : Boolean := True) is -+ Result : Interfaces.C.int; -+ pragma Unreferenced (Result); -+ begin -+ if Do_Yield then -+ Result := sched_yield; -+ end if; -+ end Yield; -+ -+ ------------------ -+ -- Set_Priority -- -+ ------------------ -+ -+ procedure Set_Priority -+ (T : Task_Id; -+ Prio : System.Any_Priority; -+ Loss_Of_Inheritance : Boolean := False) -+ is -+ pragma Unreferenced (Loss_Of_Inheritance); -+ -+ Result : Interfaces.C.int; -+ Param : aliased struct_sched_param; -+ -+ function Get_Policy (Prio : System.Any_Priority) return Character; -+ pragma Import (C, Get_Policy, "__gnat_get_specific_dispatching"); -+ -- Get priority specific dispatching policy -+ -+ Priority_Specific_Policy : constant Character := Get_Policy (Prio); -+ -- Upper case first character of the policy name corresponding to the -+ -- task as set by a Priority_Specific_Dispatching pragma. -+ -+ begin -+ T.Common.Current_Priority := Prio; -+ -+ -- Priorities on Cygwin follow Win32 standards, we use the -+ -- MinGW conversion table. -+ -+ Param.sched_priority := Interfaces.C.int (Underlying_Priorities (Prio)); -+ -+ if Dispatching_Policy = 'R' -+ or else Priority_Specific_Policy = 'R' -+ or else Time_Slice_Val > 0 -+ then -+ Result := -+ pthread_setschedparam -+ (T.Common.LL.Thread, SCHED_RR, Param'Access); -+ -+ elsif Dispatching_Policy = 'F' -+ or else Priority_Specific_Policy = 'F' -+ or else Time_Slice_Val = 0 -+ then -+ Result := -+ pthread_setschedparam -+ (T.Common.LL.Thread, SCHED_FIFO, Param'Access); -+ -+ else -+ Param.sched_priority := 0; -+ Result := -+ pthread_setschedparam -+ (T.Common.LL.Thread, -+ SCHED_OTHER, Param'Access); -+ end if; -+ -+ pragma Assert (Result = 0 or else Result = EPERM); -+ end Set_Priority; -+ -+ ------------------ -+ -- Get_Priority -- -+ ------------------ -+ -+ function Get_Priority (T : Task_Id) return System.Any_Priority is -+ begin -+ return T.Common.Current_Priority; -+ end Get_Priority; -+ -+ -------------------------- -+ -- Get_Stack_Attributes -- -+ -------------------------- -+ -+ procedure Get_Stack_Attributes -+ (T : Task_Id; -+ ISP : out System.Address; -+ Size : out Storage_Offset) -+ is -+ function pthread_getattr_np -+ (thread : pthread_t; -+ attr : System.Address) return Interfaces.C.int; -+ pragma Import (C, pthread_getattr_np, "pthread_getattr_np"); -+ -+ function pthread_attr_getstack -+ (attr : System.Address; -+ base : System.Address; -+ size : System.Address) return Interfaces.C.int; -+ pragma Import (C, pthread_attr_getstack, "pthread_attr_getstack"); -+ -+ Result : Interfaces.C.int; -+ -+ Attributes : aliased pthread_attr_t; -+ Stack_Base : aliased System.Address; -+ Stack_Size : aliased Storage_Offset; -+ -+ begin -+ Result := -+ pthread_getattr_np -+ (T.Common.LL.Thread, Attributes'Address); -+ pragma Assert (Result = 0); -+ -+ Result := -+ pthread_attr_getstack -+ (Attributes'Address, Stack_Base'Address, Stack_Size'Address); -+ pragma Assert (Result = 0); -+ -+ Result := pthread_attr_destroy (Attributes'Access); -+ pragma Assert (Result = 0); -+ -+ ISP := Stack_Base + Stack_Size; -+ Size := Stack_Size; -+ end Get_Stack_Attributes; -+ -+ ---------------- -+ -- Enter_Task -- -+ ---------------- -+ -+ procedure Enter_Task (Self_ID : Task_Id) is -+ begin -+ if Self_ID.Common.Task_Info /= null -+ and then -+ Self_ID.Common.Task_Info.CPU_Affinity = No_CPU -+ then -+ raise Invalid_CPU_Number; -+ end if; -+ -+ Self_ID.Common.LL.Thread := pthread_self; -+ -+ Specific.Set (Self_ID); -+ -+ Lock_RTS; -+ -+ for J in Known_Tasks'Range loop -+ if Known_Tasks (J) = null then -+ Known_Tasks (J) := Self_ID; -+ Self_ID.Known_Tasks_Index := J; -+ exit; -+ end if; -+ end loop; -+ -+ Unlock_RTS; -+ -+ -- Determine where the task stack starts, how large it is, and let the -+ -- stack checking engine know about it. -+ -+ declare -+ Initial_SP : System.Address; -+ Stack_Size : Storage_Offset; -+ begin -+ Get_Stack_Attributes (Self_ID, Initial_SP, Stack_Size); -+ System.Stack_Checking.Operations.Notify_Stack_Attributes -+ (Initial_SP, Stack_Size); -+ end; -+ end Enter_Task; -+ -+ -------------- -+ -- New_ATCB -- -+ -------------- -+ -+ function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is -+ begin -+ return new Ada_Task_Control_Block (Entry_Num); -+ end New_ATCB; -+ -+ ------------------- -+ -- Is_Valid_Task -- -+ ------------------- -+ -+ function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task; -+ -+ ----------------------------- -+ -- Register_Foreign_Thread -- -+ ----------------------------- -+ -+ function Register_Foreign_Thread return Task_Id is -+ begin -+ if Is_Valid_Task then -+ return Self; -+ else -+ return Register_Foreign_Thread (pthread_self); -+ end if; -+ end Register_Foreign_Thread; -+ -+ -------------------- -+ -- Initialize_TCB -- -+ -------------------- -+ -+ procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is -+ Result : Interfaces.C.int; -+ -+ begin -+ -- Give the task a unique serial number -+ -+ Self_ID.Serial_Number := Next_Serial_Number; -+ Next_Serial_Number := Next_Serial_Number + 1; -+ pragma Assert (Next_Serial_Number /= 0); -+ -+ Self_ID.Common.LL.Thread := To_pthread_t (-1); -+ -+ if not Single_Lock then -+ Result := pthread_mutex_init (Self_ID.Common.LL.L'Access, -+ Mutex_Attr'Access); -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result /= 0 then -+ Succeeded := False; -+ return; -+ end if; -+ end if; -+ -+ Result := pthread_cond_init (Self_ID.Common.LL.CV'Access, -+ Cond_Attr'Access); -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result = 0 then -+ Succeeded := True; -+ else -+ if not Single_Lock then -+ Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access); -+ pragma Assert (Result = 0); -+ end if; -+ -+ Succeeded := False; -+ end if; -+ end Initialize_TCB; -+ -+ ----------------- -+ -- Create_Task -- -+ ----------------- -+ -+ procedure Create_Task -+ (T : Task_Id; -+ Wrapper : System.Address; -+ Stack_Size : System.Parameters.Size_Type; -+ Priority : System.Any_Priority; -+ Succeeded : out Boolean) -+ is -+ Attributes : aliased pthread_attr_t; -+ Result : Interfaces.C.int; -+ -+ begin -+ Result := pthread_attr_init (Attributes'Access); -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result /= 0 then -+ Succeeded := False; -+ return; -+ end if; -+ -+ Result := -+ pthread_attr_setstacksize -+ (Attributes'Access, Interfaces.C.size_t (Stack_Size)); -+ pragma Assert (Result = 0); -+ -+ Result := -+ pthread_attr_setdetachstate -+ (Attributes'Access, PTHREAD_CREATE_DETACHED); -+ pragma Assert (Result = 0); -+ -+ -- Since the initial signal mask of a thread is inherited from the -+ -- creator, and the Environment task has all its signals masked, we -+ -- do not need to manipulate caller's signal mask at this point. -+ -- All tasks in RTS will have All_Tasks_Mask initially. -+ -+ Result := pthread_create -+ (T.Common.LL.Thread'Access, -+ Attributes'Access, -+ Thread_Body_Access (Wrapper), -+ To_Address (T)); -+ pragma Assert (Result = 0 or else Result = EAGAIN); -+ -+ Succeeded := Result = 0; -+ -+ -- Handle Task_Info -+ -+ if T.Common.Task_Info /= null then -+ if T.Common.Task_Info.CPU_Affinity /= Task_Info.Any_CPU then -+ Result := -+ pthread_setaffinity_np -+ (T.Common.LL.Thread, -+ CPU_SETSIZE / 8, -+ T.Common.Task_Info.CPU_Affinity'Access); -+ pragma Assert (Result = 0); -+ end if; -+ end if; -+ -+ Result := pthread_attr_destroy (Attributes'Access); -+ pragma Assert (Result = 0); -+ -+ Set_Priority (T, Priority); -+ end Create_Task; -+ -+ ------------------ -+ -- Finalize_TCB -- -+ ------------------ -+ -+ procedure Finalize_TCB (T : Task_Id) is -+ Result : Interfaces.C.int; -+ Tmp : Task_Id := T; -+ Is_Self : constant Boolean := T = Self; -+ -+ procedure Free is new -+ Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); -+ -+ begin -+ if not Single_Lock then -+ Result := pthread_mutex_destroy (T.Common.LL.L'Access); -+ pragma Assert (Result = 0); -+ end if; -+ -+ Result := pthread_cond_destroy (T.Common.LL.CV'Access); -+ pragma Assert (Result = 0); -+ -+ if T.Known_Tasks_Index /= -1 then -+ Known_Tasks (T.Known_Tasks_Index) := null; -+ end if; -+ SC.Invalidate_Stack_Cache (T.Common.Compiler_Data.Pri_Stack_Info'Access); -+ Free (Tmp); -+ -+ if Is_Self then -+ Specific.Set (null); -+ end if; -+ end Finalize_TCB; -+ -+ --------------- -+ -- Exit_Task -- -+ --------------- -+ -+ procedure Exit_Task is -+ begin -+ Specific.Set (null); -+ end Exit_Task; -+ -+ ---------------- -+ -- Abort_Task -- -+ ---------------- -+ -+ procedure Abort_Task (T : Task_Id) is -+ Result : Interfaces.C.int; -+ begin -+ Result := -+ pthread_kill -+ (T.Common.LL.Thread, -+ Signal (System.Interrupt_Management.Abort_Task_Interrupt)); -+ pragma Assert (Result = 0); -+ end Abort_Task; -+ -+ ---------------- -+ -- Initialize -- -+ ---------------- -+ -+ procedure Initialize (S : in out Suspension_Object) is -+ Result : Interfaces.C.int; -+ -+ begin -+ -- Initialize internal state (always to False (RM D.10(6))) -+ -+ S.State := False; -+ S.Waiting := False; -+ -+ -- Initialize internal mutex -+ -+ Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access); -+ -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result = ENOMEM then -+ raise Storage_Error; -+ end if; -+ -+ -- Initialize internal condition variable -+ -+ Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access); -+ -+ pragma Assert (Result = 0 or else Result = ENOMEM); -+ -+ if Result /= 0 then -+ Result := pthread_mutex_destroy (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ if Result = ENOMEM then -+ raise Storage_Error; -+ end if; -+ end if; -+ end Initialize; -+ -+ -------------- -+ -- Finalize -- -+ -------------- -+ -+ procedure Finalize (S : in out Suspension_Object) is -+ Result : Interfaces.C.int; -+ -+ begin -+ -- Destroy internal mutex -+ -+ Result := pthread_mutex_destroy (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ -- Destroy internal condition variable -+ -+ Result := pthread_cond_destroy (S.CV'Access); -+ pragma Assert (Result = 0); -+ end Finalize; -+ -+ ------------------- -+ -- Current_State -- -+ ------------------- -+ -+ function Current_State (S : Suspension_Object) return Boolean is -+ begin -+ -- We do not want to use lock on this read operation. State is marked -+ -- as Atomic so that we ensure that the value retrieved is correct. -+ -+ return S.State; -+ end Current_State; -+ -+ --------------- -+ -- Set_False -- -+ --------------- -+ -+ procedure Set_False (S : in out Suspension_Object) is -+ Result : Interfaces.C.int; -+ -+ begin -+ SSL.Abort_Defer.all; -+ -+ Result := pthread_mutex_lock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ S.State := False; -+ -+ Result := pthread_mutex_unlock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ SSL.Abort_Undefer.all; -+ end Set_False; -+ -+ -------------- -+ -- Set_True -- -+ -------------- -+ -+ procedure Set_True (S : in out Suspension_Object) is -+ Result : Interfaces.C.int; -+ -+ begin -+ SSL.Abort_Defer.all; -+ -+ Result := pthread_mutex_lock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ -- If there is already a task waiting on this suspension object then -+ -- we resume it, leaving the state of the suspension object to False, -+ -- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves -+ -- the state to True. -+ -+ if S.Waiting then -+ S.Waiting := False; -+ S.State := False; -+ -+ Result := pthread_cond_signal (S.CV'Access); -+ pragma Assert (Result = 0); -+ -+ else -+ S.State := True; -+ end if; -+ -+ Result := pthread_mutex_unlock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ SSL.Abort_Undefer.all; -+ end Set_True; -+ -+ ------------------------ -+ -- Suspend_Until_True -- -+ ------------------------ -+ -+ procedure Suspend_Until_True (S : in out Suspension_Object) is -+ Result : Interfaces.C.int; -+ -+ begin -+ SSL.Abort_Defer.all; -+ -+ Result := pthread_mutex_lock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ if S.Waiting then -+ -+ -- Program_Error must be raised upon calling Suspend_Until_True -+ -- if another task is already waiting on that suspension object -+ -- (RM D.10(10)). -+ -+ Result := pthread_mutex_unlock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ SSL.Abort_Undefer.all; -+ -+ raise Program_Error; -+ else -+ -- Suspend the task if the state is False. Otherwise, the task -+ -- continues its execution, and the state of the suspension object -+ -- is set to False (ARM D.10 par. 9). -+ -+ if S.State then -+ S.State := False; -+ else -+ S.Waiting := True; -+ Result := pthread_cond_wait (S.CV'Access, S.L'Access); -+ end if; -+ -+ Result := pthread_mutex_unlock (S.L'Access); -+ pragma Assert (Result = 0); -+ -+ SSL.Abort_Undefer.all; -+ end -+ if; -+ end Suspend_Until_True; -+ -+ ---------------- -+ -- Check_Exit -- -+ ---------------- -+ -+ -- Dummy version -+ -+ function Check_Exit (Self_ID : ST.Task_Id) return Boolean is -+ pragma Unreferenced (Self_ID); -+ begin -+ return True; -+ end Check_Exit; -+ -+ -------------------- -+ -- Check_No_Locks -- -+ -------------------- -+ -+ function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is -+ pragma Unreferenced (Self_ID); -+ begin -+ return True; -+ end Check_No_Locks; -+ -+ ---------------------- -+ -- Environment_Task -- -+ ---------------------- -+ -+ function Environment_Task return Task_Id is -+ begin -+ return Environment_Task_Id; -+ end Environment_Task; -+ -+ ------------------ -+ -- Suspend_Task -- -+ ------------------ -+ -+ function Suspend_Task -+ (T : ST.Task_Id; -+ Thread_Self : Thread_Id) return Boolean -+ is -+ begin -+ if T.Common.LL.Thread /= Thread_Self then -+ return pthread_kill (T.Common.LL.Thread, SIGSTOP) = 0; -+ else -+ return True; -+ end if; -+ end Suspend_Task; -+ -+ ----------------- -+ -- Resume_Task -- -+ ----------------- -+ -+ function Resume_Task -+ (T : ST.Task_Id; -+ Thread_Self : Thread_Id) return Boolean -+ is -+ begin -+ if T.Common.LL.Thread /= Thread_Self then -+ return pthread_kill (T.Common.LL.Thread, SIGCONT) = 0; -+ else -+ return True; -+ end if; -+ end Resume_Task; -+ -+ -------------------- -+ -- Stop_All_Tasks -- -+ -------------------- -+ -+ procedure Stop_All_Tasks is -+ begin -+ null; -+ end Stop_All_Tasks; -+ -+ --------------- -+ -- Stop_Task -- -+ --------------- -+ -+ function Stop_Task (T : ST.Task_Id) return Boolean is -+ pragma Unreferenced (T); -+ begin -+ return False; -+ end Stop_Task; -+ -+ ------------------- -+ -- Continue_Task -- -+ ------------------- -+ -+ function Continue_Task (T : ST.Task_Id) return Boolean is -+ pragma Unreferenced (T); -+ begin -+ return False; -+ end Continue_Task; -+ -+ ---------------- -+ -- Initialize -- -+ ---------------- -+ -+ procedure Initialize (Environment_Task : Task_Id) is -+ act : aliased struct_sigaction; -+ old_act : aliased struct_sigaction; -+ Tmp_Set : aliased sigset_t; -+ Result : Interfaces.C.int; -+ -+ function State -+ (Int : System.Interrupt_Management.Interrupt_ID) return Character; -+ pragma Import (C, State, "__gnat_get_interrupt_state"); -+ -- Get interrupt state. Defined in a-init.c -+ -- The input argument is the interrupt number, -+ -- and the result is one of the following: -+ -+ Default : constant Character := 's'; -+ -- 'n' this interrupt not set by any Interrupt_State pragma -+ -- 'u' Interrupt_State pragma set state to User -+ -- 'r' Interrupt_State pragma set state to Runtime -+ -- 's' Interrupt_State pragma set state to System (use "default" -+ -- system handler) -+ -+ begin -+ Environment_Task_Id := Environment_Task; -+ -+ Interrupt_Management.Initialize; -+ -+ -- Prepare the set of signals that should be unblocked in all tasks -+ -+ Result := sigemptyset (Unblocked_Signal_Mask'Access); -+ pragma Assert (Result = 0); -+ -+ for J in Interrupt_Management.Interrupt_ID loop -+ if System.Interrupt_Management.Keep_Unmasked (J) then -+ Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J)); -+ pragma Assert (Result = 0); -+ end if; -+ end loop; -+ -+ Result := pthread_mutexattr_init (Mutex_Attr'Access); -+ pragma Assert (Result = 0); -+ -+ Result := pthread_condattr_init (Cond_Attr'Access); -+ pragma Assert (Result = 0); -+ -+ Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level); -+ -+ -- Initialize the global RTS lock -+ -+ Specific.Initialize (Environment_Task); -+ -+ Enter_Task (Environment_Task); -+ -+ -- Install the abort-signal handler -+ -+ if State -+ (System.Interrupt_Management.Abort_Task_Interrupt) /= Default -+ then -+ act.sa_flags := 0; -+ act.sa_handler := Abort_Handler'Address; -+ -+ Result := sigemptyset (Tmp_Set'Access); -+ pragma Assert (Result = 0); -+ act.sa_mask := Tmp_Set; -+ -+ Result := -+ sigaction -+ (Signal (Interrupt_Management.Abort_Task_Interrupt), -+ act'Unchecked_Access, -+ old_act'Unchecked_Access); -+ pragma Assert (Result = 0); -+ end if; -+ end Initialize; -+ -+end System.Task_Primitives.Operations; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/sysdep.c src/gcc-4.5.0/gcc/ada/sysdep.c ---- origsrc/gcc-4.5.0/gcc/ada/sysdep.c 2010-04-22 12:15:22.093750000 +0100 -+++ src/gcc-4.5.0/gcc/ada/sysdep.c 2010-04-19 06:08:12.000000000 +0100 -@@ -405,7 +405,7 @@ getc_immediate_common (FILE *stream, - { - #if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \ - || (defined (__osf__) && ! defined (__alpha_vxworks)) \ -- || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ -+ || defined (__CYGWIN__) || defined (__MACHTEN__) || defined (__hpux__) \ - || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ - || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ - || defined (__GLIBC__) || defined (__APPLE__) -@@ -694,6 +694,40 @@ rts_get_nShowCmd (void) - } - - #endif /* WINNT */ -+ -+#ifdef __CYGWIN__ -+ -+size_t _msize(void *memblock) -+{ -+ return (size_t) malloc_usable_size (memblock); -+} -+ -+#include -+ -+int -+__gnat_is_windows_xp (void) -+{ -+ static int is_win_xp=0, is_win_xp_checked=0; -+ -+ if (!is_win_xp_checked) -+ { -+ OSVERSIONINFO version; -+ -+ is_win_xp_checked = 1; -+ -+ memset (&version, 0, sizeof (version)); -+ version.dwOSVersionInfoSize = sizeof (version); -+ -+ is_win_xp = GetVersionEx (&version) -+ && version.dwPlatformId == VER_PLATFORM_WIN32_NT -+ && (version.dwMajorVersion > 5 -+ || (version.dwMajorVersion == 5 && version.dwMinorVersion >= 1)); -+ } -+ return is_win_xp; -+} -+ -+#endif /* __CYGWIN__ */ -+ - #ifdef VMS - - /* This gets around a problem with using the old threads library on VMS 7.0. */ -diff -pruN origsrc/gcc-4.5.0/gcc/ada/system-cygwin.ads src/gcc-4.5.0/gcc/ada/system-cygwin.ads ---- origsrc/gcc-4.5.0/gcc/ada/system-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 -+++ src/gcc-4.5.0/gcc/ada/system-cygwin.ads 2010-04-19 06:08:12.000000000 +0100 -@@ -0,0 +1,199 @@ -+------------------------------------------------------------------------------ -+-- -- -+-- GNAT RUN-TIME COMPONENTS -- -+-- -- -+-- S Y S T E M -- -+-- -- -+-- S p e c -- -+-- (Cygwin Version) -- -+-- -- -+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -+-- -- -+-- This specification is derived from the Ada Reference Manual for use with -- -+-- GNAT. The copyright notice above, and the license provisions that follow -- -+-- apply solely to the contents of the part following the private keyword. -- -+-- -- -+-- GNAT is free software; you can redistribute it and/or modify it under -- -+-- terms of the GNU General Public License as published by the Free Soft- -- -+-- ware Foundation; either version 2, or (at your option) any later ver- -- -+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -+-- OUT 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 distributed with GNAT; see file COPYING. If not, write -- -+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -+-- Boston, MA 02110-1301, USA. -- -+-- -- -+-- As a special exception, if other files instantiate generics from this -- -+-- unit, or you link this unit with other files to produce an executable, -- -+-- this unit does not by itself cause the resulting executable to be -- -+-- covered by the GNU General Public License. This exception does not -- -+-- however invalidate any other reasons why the executable file might be -- -+-- covered by the GNU Public License. -- -+-- -- -+-- GNAT was originally developed by the GNAT team at New York University. -- -+-- Extensive contributions were provided by Ada Core Technologies Inc. -- -+-- -- -+------------------------------------------------------------------------------ -+ -+package System is -+ pragma Pure; -+ -- Note that we take advantage of the implementation permission to make -+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada -+ -- 2005, this is Pure in any case (AI-362). -+ -+ type Name is (SYSTEM_NAME_GNAT); -+ System_Name : constant Name := SYSTEM_NAME_GNAT; -+ -+ -- System-Dependent Named Numbers -+ -+ Min_Int : constant := Long_Long_Integer'First; -+ Max_Int : constant := Long_Long_Integer'Last; -+ -+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; -+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; -+ -+ Max_Base_Digits : constant := Long_Long_Float'Digits; -+ Max_Digits : constant := Long_Long_Float'Digits; -+ -+ Max_Mantissa : constant := 63; -+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); -+ -+ Tick : constant := 0.01; -+ -+ -- Storage-related Declarations -+ -+ type Address is private; -+ pragma Preelaborable_Initialization (Address); -+ Null_Address : constant Address; -+ -+ Storage_Unit : constant := 8; -+ Word_Size : constant := 32; -+ Memory_Size : constant := 2 ** 32; -+ -+ -- Address comparison -+ -+ function "<" (Left, Right : Address) return Boolean; -+ function "<=" (Left, Right : Address) return Boolean; -+ function ">" (Left, Right : Address) return Boolean; -+ function ">=" (Left, Right : Address) return Boolean; -+ function "=" (Left, Right : Address) return Boolean; -+ -+ pragma Import (Intrinsic, "<"); -+ pragma Import (Intrinsic, "<="); -+ pragma Import (Intrinsic, ">"); -+ pragma Import (Intrinsic, ">="); -+ pragma Import (Intrinsic, "="); -+ -+ -- Other System-Dependent Declarations -+ -+ type Bit_Order is (High_Order_First, Low_Order_First); -+ Default_Bit_Order : constant Bit_Order := Low_Order_First; -+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -+ -+ -- Priority-related Declarations (RM D.1) -+ -+ Max_Priority : constant Positive := 30; -+ Max_Interrupt_Priority : constant Positive := 31; -+ -+ subtype Any_Priority is Integer range 0 .. 31; -+ subtype Priority is Any_Priority range 0 .. 30; -+ subtype Interrupt_Priority is Any_Priority range 31 .. 31; -+ -+ Default_Priority : constant Priority := 15; -+ -+private -+ -+ type Address is mod Memory_Size; -+ Null_Address : constant Address := 0; -+ -+ -------------------------------------- -+ -- System Implementation Parameters -- -+ -------------------------------------- -+ -+ -- These parameters provide information about the target that is used -+ -- by the compiler. They are in the private part of System, where they -+ -- can be accessed using the special circuitry in the Targparm unit -+ -- whose source should be consulted for more detailed descriptions -+ -- of the individual switch values. -+ -+ Backend_Divide_Checks : constant Boolean := False; -+ Backend_Overflow_Checks : constant Boolean := False; -+ Command_Line_Args : constant Boolean := True; -+ Configurable_Run_Time : constant Boolean := False; -+ Denorm : constant Boolean := True; -+ Duration_32_Bits : constant Boolean := False; -+ Exit_Status_Supported : constant Boolean := True; -+ Fractional_Fixed_Ops : constant Boolean := False; -+ Frontend_Layout : constant Boolean := False; -+ Machine_Overflows : constant Boolean := False; -+ Machine_Rounds : constant Boolean := True; -+ Preallocated_Stacks : constant Boolean := False; -+ Signed_Zeros : constant Boolean := True; -+ Stack_Check_Default : constant Boolean := False; -+ Stack_Check_Probes : constant Boolean := True; -+ Stack_Check_Limits : constant Boolean := False; -+ Support_64_Bit_Divides : constant Boolean := True; -+ Support_Aggregates : constant Boolean := True; -+ Support_Composite_Assign : constant Boolean := True; -+ Support_Composite_Compare : constant Boolean := True; -+ Support_Long_Shifts : constant Boolean := True; -+ Always_Compatible_Rep : constant Boolean := True; -+ Suppress_Standard_Library : constant Boolean := False; -+ Use_Ada_Main_Program_Name : constant Boolean := False; -+ ZCX_By_Default : constant Boolean := True; -+ GCC_ZCX_Support : constant Boolean := True; -+ -+ --------------------------- -+ -- Underlying Priorities -- -+ --------------------------- -+ -+ -- Important note: this section of the file must come AFTER the -+ -- definition of the system implementation parameters to ensure -+ -- that the value of these parameters is available for analysis -+ -- of the declarations here (using Rtsfind at compile time). -+ -+ -- The underlying priorities table provides a generalized mechanism -+ -- for mapping from Ada priorities to system priorities. In some -+ -- cases a 1-1 mapping is not the convenient or optimal choice. -+ -+ type Priorities_Mapping is array (Any_Priority) of Integer; -+ pragma Suppress_Initialization (Priorities_Mapping); -+ -- Suppress initialization in case gnat.adc specifies Normalize_Scalars -+ -+ Underlying_Priorities : constant Priorities_Mapping := -+ (Priority'First .. -+ Default_Priority - 8 => -15, -+ Default_Priority - 7 => -7, -+ Default_Priority - 6 => -6, -+ Default_Priority - 5 => -5, -+ Default_Priority - 4 => -4, -+ Default_Priority - 3 => -3, -+ Default_Priority - 2 => -2, -+ Default_Priority - 1 => -1, -+ Default_Priority => 0, -+ Default_Priority + 1 => 1, -+ Default_Priority + 2 => 2, -+ Default_Priority + 3 => 3, -+ Default_Priority + 4 => 4, -+ Default_Priority + 5 => 5, -+ Default_Priority + 6 .. -+ Priority'Last => 6, -+ Interrupt_Priority => 15); -+ -- The default mapping preserves the standard 31 priorities of the Ada -+ -- model, but maps them using compression onto the 7 priority levels -+ -- available in NT and on the 16 priority levels available in 2000/XP. -+ -+ -- To replace the default values of the Underlying_Priorities mapping, -+ -- copy this source file into your build directory, edit the file to -+ -- reflect your desired behavior, and recompile using Makefile.adalib -+ -- which can be found under the adalib directory of your gnat installation -+ -+ pragma Linker_Options ("-Wl,--stack=0x2000000"); -+ -- This is used to change the default stack (32 MB) size for non tasking -+ -- programs. We change this value for GNAT on Windows here because the -+ -- binutils on this platform have switched to a too low value for Ada -+ -- programs. Note that we also set the stack size for tasking programs in -+ -- System.Task_Primitives.Operations. -+ -+end System; -diff -pruN origsrc/gcc-4.5.0/gcc/ada/system-mingw.ads src/gcc-4.5.0/gcc/ada/system-mingw.ads ---- origsrc/gcc-4.5.0/gcc/ada/system-mingw.ads 2010-04-22 12:15:22.140625000 +0100 -+++ src/gcc-4.5.0/gcc/ada/system-mingw.ads 2010-04-19 06:08:12.000000000 +0100 -@@ -139,7 +139,7 @@ private - Always_Compatible_Rep : constant Boolean := False; - Suppress_Standard_Library : constant Boolean := False; - Use_Ada_Main_Program_Name : constant Boolean := False; -- ZCX_By_Default : constant Boolean := False; -+ ZCX_By_Default : constant Boolean := True; - GCC_ZCX_Support : constant Boolean := True; - - --------------------------- diff --git a/gcc45-cross-ecjx.patch b/gcc45-cross-ecjx.patch deleted file mode 100644 index cca8271..0000000 --- a/gcc45-cross-ecjx.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- origsrc/gcc-4.5.2/libjava/Makefile.am 2010-07-15 07:05:56.000000000 -0500 -+++ src/gcc-4.5.2/libjava/Makefile.am 2011-01-11 16:17:07.828828300 -0600 -@@ -1124,10 +1124,17 @@ endif - else !NATIVE - - ecjx_LINK = $(GCJ_FOR_ECJX_LINK) $(ecjx_LDFLAGS) -+if INSTALL_ECJ_JAR - ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -+else -+ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) -+endif - ecjx_LDADD = - ecjx_DEPENDENCIES = - -+ecjx.$(OBJEXT): ecjx.cc -+ $(GCJ_FOR_ECJX) -c -o $@ $< -+ - endif !NATIVE - - ## This is a dummy definition. ---- origsrc/gcc-4.5.2/libjava/Makefile.in 2010-12-16 06:49:03.000000000 -0600 -+++ src/gcc-4.5.2/libjava/Makefile.in 2011-01-11 16:18:06.282130200 -0600 -@@ -8515,7 +8515,8 @@ ECJX_BASE_FLAGS = -findirect-dispatch \ - @NATIVE_TRUE@ecjx_LINK = $(GCJLINK) $(ecjx_LDFLAGS) - @ENABLE_SHARED_FALSE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH) - @ENABLE_SHARED_TRUE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) --@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -+@INSTALL_ECJ_JAR_FALSE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) -+@INSTALL_ECJ_JAR_TRUE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) - @NATIVE_FALSE@ecjx_LDADD = - @NATIVE_TRUE@ecjx_LDADD = -L$(here)/.libs $(extra_ldflags) \ - @NATIVE_TRUE@ $(am__append_31) -@@ -12888,6 +12889,9 @@ write-entries-to-file-check: - @MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ >> tmp-0212; \ - @MAINTAINER_MODE_TRUE@@NATIVE_TRUE@ mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h - -+@NATIVE_FALSE@ecjx.$(OBJEXT): ecjx.cc -+@NATIVE_FALSE@ $(GCJ_FOR_ECJX) -c -o $@ $< -+ - src.zip: - -rm -f src.zip - here=`pwd`; \ diff --git a/gcc45-cross-exe-suffix.diff b/gcc45-cross-exe-suffix.diff index 0a71b11..6fbddf8 100644 --- a/gcc45-cross-exe-suffix.diff +++ b/gcc45-cross-exe-suffix.diff @@ -1,7 +1,6 @@ --- a/gcc/gcc.c 2011-08-14 14:15:46.614869280 -0500 +++ b/gcc/gcc.c 2011-08-14 14:16:05.757302186 -0500 -@@ -98,8 +98,7 @@ compilation is specified by a string cal - #endif +@@ -98,6 +98,5 @@ compilation is specified by a string cal /* By default there is no special suffix for target executables. */ -/* FIXME: when autoconf is fixed, remove the host check - dj */ @@ -9,4 +8,3 @@ +#if defined(TARGET_EXECUTABLE_SUFFIX) #define HAVE_TARGET_EXECUTABLE_SUFFIX #endif - diff --git a/gcc45-ehdebug.diff b/gcc45-ehdebug.diff deleted file mode 100644 index 1534aa9..0000000 --- a/gcc45-ehdebug.diff +++ /dev/null @@ -1,157 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/gcc/unwind-dw2-fde.c src/gcc-4.5.0/gcc/unwind-dw2-fde.c ---- origsrc/gcc-4.5.0/gcc/unwind-dw2-fde.c 2009-09-20 12:03:33.000000000 +0100 -+++ src/gcc-4.5.0/gcc/unwind-dw2-fde.c 2010-04-19 04:28:35.406250000 +0100 -@@ -37,6 +37,8 @@ see the files COPYING3 and COPYING.RUNTI - #include "gthr.h" - #endif - -+#define __debug_unwind_enabled (0) -+ - /* The unseen_objects list contains objects that have been registered - but not yet categorized in any way. The seen_objects list has had - its pc_begin and count fields initialized at minimum, and is sorted -@@ -840,6 +842,8 @@ binary_search_unencoded_fdes (struct obj - struct fde_vector *vec = ob->u.sort; - size_t lo, hi; - -+ if (__debug_unwind_enabled) printf ("search fdes ob %p: vec %p count %d\n", ob, vec, vec->count); -+ - for (lo = 0, hi = vec->count; lo < hi; ) - { - size_t i = (lo + hi) / 2; -@@ -849,6 +853,8 @@ binary_search_unencoded_fdes (struct obj - memcpy (&pc_begin, (const void * const *) f->pc_begin, sizeof (void *)); - memcpy (&pc_range, (const uaddr *) f->pc_begin + 1, sizeof (uaddr)); - -+if (__debug_unwind_enabled) printf ("fde#%d (%p): pc_begin %p pc_range %p\n", i, f, pc_begin, (void *)pc_range); -+ - if (pc < pc_begin) - hi = i; - else if (pc >= pc_begin + pc_range) -@@ -856,7 +862,7 @@ binary_search_unencoded_fdes (struct obj - else - return f; - } -- -+if (__debug_unwind_enabled) printf ("**not found\n"); - return NULL; - } - -@@ -977,6 +983,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf - /* Linear search through the classified objects, to find the one - containing the pc. Note that pc_begin is sorted descending, and - we expect objects to be non-overlapping. */ -+ if (__debug_unwind_enabled) printf ("Search seen obs for pc %p: Bases t %p, d %p, func %p\n", -+ pc, bases->tbase, bases->dbase, bases->func); - for (ob = seen_objects; ob; ob = ob->next) - if (pc >= ob->pc_begin) - { -@@ -987,6 +995,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf - } - - /* Classify and search the objects we've not yet processed. */ -+ if (__debug_unwind_enabled) printf ("Search unseen obs for pc %p: Bases t %p, d %p, func %p\n", -+ pc, bases->tbase, bases->dbase, bases->func); - while ((ob = unseen_objects)) - { - struct object **p; -@@ -1022,6 +1032,15 @@ _Unwind_Find_FDE (void *pc, struct dwarf - read_encoded_value_with_base (encoding, base_from_object (encoding, ob), - f->pc_begin, &func); - bases->func = (void *) func; -+ -+ if (__debug_unwind_enabled) printf ("Found fde %p: Bases t %p, d %p, func %p\n", -+ f, bases->tbase, bases->dbase, bases->func); -+ -+ } -+ else -+ { -+ if (__debug_unwind_enabled) printf ("No fde %p: Bases t %p, d %p, func %p\n", -+ f, bases->tbase, bases->dbase, bases->func); - } - - return f; -diff -pruN origsrc/gcc-4.5.0/gcc/unwind-dw2.c src/gcc-4.5.0/gcc/unwind-dw2.c ---- origsrc/gcc-4.5.0/gcc/unwind-dw2.c 2010-01-20 08:13:50.000000000 +0000 -+++ src/gcc-4.5.0/gcc/unwind-dw2.c 2010-04-19 04:28:35.421875000 +0100 -@@ -79,6 +79,7 @@ struct _Unwind_Context - - /* Byte size of every register managed by these routines. */ - static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS+1]; -+#define __debug_unwind_enabled (0) - - - /* Read unaligned data from the instruction buffer. */ -@@ -370,7 +371,7 @@ extract_cie_info (const struct dwarf_cie - fs->retaddr_column = (_Unwind_Word)utmp; - } - fs->lsda_encoding = DW_EH_PE_omit; -- -+if (__debug_unwind_enabled) printf ("extract cie: augmentation '%c'\n", *aug); - /* If the augmentation starts with 'z', then a uleb128 immediately - follows containing the length of the augmentation field following - the size. */ -@@ -386,6 +387,7 @@ extract_cie_info (const struct dwarf_cie - /* Iterate over recognized augmentation subsequences. */ - while (*aug != '\0') - { -+if (__debug_unwind_enabled) printf ("handle augmentation '%c'\n", *aug); - /* "L" indicates a byte showing how the LSDA pointer is encoded. */ - if (aug[0] == 'L') - { -@@ -423,6 +425,7 @@ extract_cie_info (const struct dwarf_cie - return ret; - } - -+if (__debug_unwind_enabled) printf ("extract cie: augmentation done\n"); - return ret ? ret : p; - } - -@@ -1568,9 +1571,25 @@ uw_identify_context (struct _Unwind_Cont - return _Unwind_GetCFA (context) + _Unwind_IsSignalFrame (context); - } - -+static _Unwind_Reason_Code -+debug_unwind_trace (struct _Unwind_Context *ctx, void *arg) -+{ -+ fflush (NULL); -+ printf ("_Unwind_Context %p\n", ctx); -+ printf (" cfa %p ra %p lsda %p\n", ctx->cfa, ctx->ra, ctx->lsda); -+ printf (" bases: t %p d %p func %p\n", ctx->bases.tbase, ctx->bases.dbase, ctx->bases.func); -+ printf ("\n"); -+ fflush (NULL); -+ return _URC_NO_REASON; -+} - - #include "unwind.inc" - -+void debug_dump_stack_trace (void *arg) -+{ -+ _Unwind_Backtrace (debug_unwind_trace, arg); -+} -+ - #if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS) - alias (_Unwind_Backtrace); - alias (_Unwind_DeleteException); -diff -pruN origsrc/gcc-4.5.0/gcc/unwind.inc src/gcc-4.5.0/gcc/unwind.inc ---- origsrc/gcc-4.5.0/gcc/unwind.inc 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/gcc/unwind.inc 2010-04-19 04:28:35.421875000 +0100 -@@ -96,8 +96,9 @@ _Unwind_RaiseException(struct _Unwind_Ex - - /* Set up fs to describe the FDE for the caller of cur_context. The - first time through the loop, that means __cxa_throw. */ -+if (__debug_unwind_enabled) printf ("Ctx: ra %p\n", cur_context.ra); - code = uw_frame_state_for (&cur_context, &fs); -- -+if (__debug_unwind_enabled) printf ("... code %d, perso %p\n", code, fs.personality); - if (code == _URC_END_OF_STACK) - /* Hit end of stack with no handler found. */ - return _URC_END_OF_STACK; -@@ -112,6 +113,7 @@ _Unwind_RaiseException(struct _Unwind_Ex - { - code = (*fs.personality) (1, _UA_SEARCH_PHASE, exc->exception_class, - exc, &cur_context); -+if (__debug_unwind_enabled) printf ("perso returns code %d\n", code); - if (code == _URC_HANDLER_FOUND) - break; - else if (code != _URC_CONTINUE_UNWIND) diff --git a/gcc45-gc-win32-threads.diff b/gcc45-gc-win32-threads.diff deleted file mode 100644 index f295272..0000000 --- a/gcc45-gc-win32-threads.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- gcc-4.5.3/libjava/boehm.cc.orig 2012-05-29 20:37:15.802823780 -0500 -+++ gcc-4.5.3/libjava/boehm.cc 2012-05-29 20:37:48.329821290 -0500 -@@ -747,7 +747,7 @@ _Jv_GCAttachThread () - // The registration interface is only defined on posixy systems and - // only actually works if pthread_getattr_np is defined. - // FIXME: until gc7 it is simpler to disable this on solaris. --#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) -+#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) && !defined(GC_WIN32_THREADS) - GC_register_my_thread (); - #endif - } -@@ -755,7 +755,7 @@ _Jv_GCAttachThread () - void - _Jv_GCDetachThread () - { --#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) -+#if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(GC_SOLARIS_THREADS) && !defined(GC_WIN32_THREADS) - GC_unregister_my_thread (); - #endif - } diff --git a/gcc45-libffi.diff b/gcc45-libffi.diff deleted file mode 100644 index a69cd9d..0000000 --- a/gcc45-libffi.diff +++ /dev/null @@ -1,63 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/libffi/Makefile.am src/gcc-4.5.0/libffi/Makefile.am ---- origsrc/gcc-4.5.0/libffi/Makefile.am 2009-12-31 17:44:32.000000000 +0000 -+++ src/gcc-4.5.0/libffi/Makefile.am 2010-04-22 04:55:33.078125000 +0100 -@@ -32,6 +32,11 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change - src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ - src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c - -+# Where generated headers like ffitarget.h get installed. -+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) -+# There's probably already some other name for this directory. -+toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version) -+ - ## ################################################################ - - ## -diff -pruN origsrc/gcc-4.5.0/libffi/configure.ac src/gcc-4.5.0/libffi/configure.ac ---- origsrc/gcc-4.5.0/libffi/configure.ac 2010-03-15 19:36:26.000000000 +0000 -+++ src/gcc-4.5.0/libffi/configure.ac 2010-04-22 05:02:49.078125000 +0100 -@@ -83,7 +83,7 @@ case "$host" in - i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*) - TARGET=X86_WIN32; TARGETDIR=x86 - # All mingw/cygwin/win32 builds require this for sharedlib -- AM_LTLDFLAGS="-no-undefined" -+ AM_LTLDFLAGS='-no-undefined -bindir $(bindir)' - ;; - i?86-*-darwin*) - TARGET=X86_DARWIN; TARGETDIR=x86 -@@ -390,7 +390,7 @@ if test -n "$with_cross_host" && - toolexeclibdir='$(toolexecdir)/lib' - else - toolexecdir='$(libdir)/gcc-lib/$(target_alias)' -- toolexeclibdir='$(libdir)' -+ toolexeclibdir="${host__toolexeclibdir:-\$(libdir)}" - fi - multi_os_directory=`$CC -print-multi-os-directory` - case $multi_os_directory in -diff -pruN origsrc/gcc-4.5.0/libffi/configure.host src/gcc-4.5.0/libffi/configure.host ---- origsrc/gcc-4.5.0/libffi/configure.host 2004-08-30 16:43:03.000000000 +0100 -+++ src/gcc-4.5.0/libffi/configure.host 2010-04-22 04:55:33.078125000 +0100 -@@ -8,4 +8,8 @@ case "${host}" in - frv*-elf) - LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ - ;; -+ i?86-*-cygwin*) -+ # Redirect installation to gcc private dir. -+ host__toolexeclibdir='$(toollibffidir)' -+ ;; - esac -diff -pruN origsrc/gcc-4.5.0/libffi/Makefile.in src/gcc-4.5.0/libffi/Makefile.in ---- origsrc/gcc-4.5.0/libffi/Makefile.in 2010-04-02 19:18:06.000000000 +0100 -+++ src/gcc-4.5.0/libffi/Makefile.in 2010-04-22 05:03:04.796875000 +0100 -@@ -417,6 +417,11 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change - src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c - - -+# Where generated headers like ffitarget.h get installed. -+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) -+# There's probably already some other name for this directory. -+toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version) -+ - # Work around what appears to be a GNU make bug handling MAKEFLAGS - # values defined in terms of make variables, as is the case for CC and - # friends when we are called from the top level Makefile. diff --git a/gcc45-libstdc.diff b/gcc45-libstdc.diff deleted file mode 100644 index 79bc0c6..0000000 --- a/gcc45-libstdc.diff +++ /dev/null @@ -1,791 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/config/os/mingw32/os_defines.h src/gcc-4.5.0/libstdc++-v3/config/os/mingw32/os_defines.h ---- origsrc/gcc-4.5.0/libstdc++-v3/config/os/mingw32/os_defines.h 2009-11-30 23:22:04.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/config/os/mingw32/os_defines.h 2010-04-19 05:11:01.671875000 +0100 -@@ -60,4 +60,10 @@ - // See libstdc++/37522. - #define _GLIBCXX_HAVE_BROKEN_VSWPRINTF 1 - -+#ifdef _DLL -+#define _GLIBCXX_IMPORT __attribute__((dllimport)) -+#else -+#define _GLIBCXX_IMPORT -+#endif -+ - #endif -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/config/os/newlib/os_defines.h src/gcc-4.5.0/libstdc++-v3/config/os/newlib/os_defines.h ---- origsrc/gcc-4.5.0/libstdc++-v3/config/os/newlib/os_defines.h 2009-11-30 23:22:04.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/config/os/newlib/os_defines.h 2010-04-19 05:11:01.687500000 +0100 -@@ -35,6 +35,8 @@ - - #ifdef __CYGWIN__ - #define _GLIBCXX_GTHREAD_USE_WEAK 0 -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 - - #if defined (_GLIBCXX_DLL) - #define _GLIBCXX_PSEUDO_VISIBILITY_default __attribute__ ((__dllimport__)) -@@ -47,6 +49,13 @@ - - // See libstdc++/20806. - #define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1 -+ -+#ifdef _DLL -+#define _GLIBCXX_IMPORT __attribute__((dllimport)) -+#else -+#define _GLIBCXX_IMPORT -+#endif -+ - #endif - - #endif -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/configure.host src/gcc-4.5.0/libstdc++-v3/configure.host ---- origsrc/gcc-4.5.0/libstdc++-v3/configure.host 2009-11-30 23:22:04.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/configure.host 2010-04-19 05:11:01.703125000 +0100 -@@ -209,6 +209,7 @@ case "${host_os}" in - ;; - cygwin*) - os_include_dir="os/newlib" -+ OPT_LDFLAGS="-Wl,--exclude-modules-for-implib=\`cd ../libsupc++; ls *type_inf*.o -1 | tr '\012' ':'\`tinfo.o:tinfo2.o" - OPT_LDFLAGS="${OPT_LDFLAGS} -no-undefined -bindir \$(bindir)" - ;; - darwin | darwin[1-7] | darwin[1-7].*) -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/backward/strstream src/gcc-4.5.0/libstdc++-v3/include/backward/strstream ---- origsrc/gcc-4.5.0/libstdc++-v3/include/backward/strstream 2010-03-16 22:34:53.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/backward/strstream 2010-04-19 05:11:01.703125000 +0100 -@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - - // Class strstreambuf, a streambuf class that manages an array of char. - // Note that this class is not a template. -- class strstreambuf : public basic_streambuf > -+ class _GLIBCXX_IMPORT strstreambuf : public basic_streambuf > - { - public: - // Types. -@@ -117,7 +117,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - }; - - // Class istrstream, an istream that manages a strstreambuf. -- class istrstream : public basic_istream -+ class _GLIBCXX_IMPORT istrstream : public basic_istream - { - public: - explicit istrstream(char*); -@@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - }; - - // Class ostrstream -- class ostrstream : public basic_ostream -+ class _GLIBCXX_IMPORT ostrstream : public basic_ostream - { - public: - ostrstream(); -@@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - }; - - // Class strstream -- class strstream : public basic_iostream -+ class _GLIBCXX_IMPORT strstream : public basic_iostream - { - public: - typedef char char_type; -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/basic_ios.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/basic_ios.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/basic_ios.tcc 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/basic_ios.tcc 2010-04-19 05:11:01.703125000 +0100 -@@ -175,10 +175,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_ios; -+ extern template class _GLIBCXX_IMPORT basic_ios; - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_ios; -+ extern template class _GLIBCXX_IMPORT basic_ios; - #endif - #endif - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/c++config src/gcc-4.5.0/libstdc++-v3/include/bits/c++config ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/c++config 2009-11-30 23:22:04.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/c++config 2010-04-19 05:11:01.718750000 +0100 -@@ -376,4 +376,8 @@ _GLIBCXX_END_NAMESPACE - # endif - #endif - -+#ifndef _GLIBCXX_IMPORT -+#define _GLIBCXX_IMPORT -+#endif -+ - // End of prewritten config; the discovered settings follow. -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/codecvt.h src/gcc-4.5.0/libstdc++-v3/include/bits/codecvt.h ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/codecvt.h 2010-02-10 05:45:24.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/codecvt.h 2010-04-19 05:11:01.750000000 +0100 -@@ -476,7 +476,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class codecvt_byname; -+ extern template class _GLIBCXX_IMPORT codecvt_byname; - - extern template - const codecvt& -@@ -487,7 +487,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - has_facet >(const locale&); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class codecvt_byname; -+ extern template class _GLIBCXX_IMPORT codecvt_byname; - - extern template - const codecvt& -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/fstream.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/fstream.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/fstream.tcc 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/fstream.tcc 2010-04-19 05:11:01.750000000 +0100 -@@ -908,16 +908,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_filebuf; -- extern template class basic_ifstream; -- extern template class basic_ofstream; -- extern template class basic_fstream; -+ extern template class _GLIBCXX_IMPORT basic_filebuf; -+ extern template class _GLIBCXX_IMPORT basic_ifstream; -+ extern template class _GLIBCXX_IMPORT basic_ofstream; -+ extern template class _GLIBCXX_IMPORT basic_fstream; - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_filebuf; -- extern template class basic_ifstream; -- extern template class basic_ofstream; -- extern template class basic_fstream; -+ extern template class _GLIBCXX_IMPORT basic_filebuf; -+ extern template class _GLIBCXX_IMPORT basic_ifstream; -+ extern template class _GLIBCXX_IMPORT basic_ofstream; -+ extern template class _GLIBCXX_IMPORT basic_fstream; - #endif - #endif - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/ios_base.h src/gcc-4.5.0/libstdc++-v3/include/bits/ios_base.h ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/ios_base.h 2010-02-17 05:43:24.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/ios_base.h 2010-04-19 05:07:26.125000000 +0100 -@@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * people will only see @c ios_base when they need to specify the full - * name of the various I/O flags (e.g., the openmodes). - */ -- class ios_base -+ class _GLIBCXX_IMPORT ios_base - { - public: - -@@ -214,7 +214,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * - * 27.4.2.1.1 Class ios_base::failure - */ -- class failure : public exception -+ class _GLIBCXX_IMPORT failure : public exception - { - public: - // _GLIBCXX_RESOLVE_LIB_DEFECTS -@@ -529,7 +529,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // Used to initialize standard streams. In theory, g++ could use - // -finit-priority to order this stuff correctly without going - // through these machinations. -- class Init -+ class _GLIBCXX_IMPORT Init - { - friend class ios_base; - public: -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/istream.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/istream.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/istream.tcc 2009-09-05 01:18:07.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/istream.tcc 2010-04-19 05:11:01.750000000 +0100 -@@ -1018,7 +1018,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_istream; -+ extern template class _GLIBCXX_IMPORT basic_istream; - extern template istream& ws(istream&); - extern template istream& operator>>(istream&, char&); - extern template istream& operator>>(istream&, char*); -@@ -1041,10 +1041,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - extern template istream& istream::_M_extract(long double&); - extern template istream& istream::_M_extract(void*&); - -- extern template class basic_iostream; -+ extern template class _GLIBCXX_IMPORT basic_iostream; - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_istream; -+ extern template class _GLIBCXX_IMPORT basic_istream; - extern template wistream& ws(wistream&); - extern template wistream& operator>>(wistream&, wchar_t&); - extern template wistream& operator>>(wistream&, wchar_t*); -@@ -1063,7 +1063,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - extern template wistream& wistream::_M_extract(long double&); - extern template wistream& wistream::_M_extract(void*&); - -- extern template class basic_iostream; -+ extern template class _GLIBCXX_IMPORT basic_iostream; - #endif - #endif - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.h src/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.h ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.h 2010-02-17 05:43:24.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.h 2010-04-19 05:11:01.765625000 +0100 -@@ -59,7 +59,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * This library supports efficient construction and copying of locales - * through a reference counting implementation of the locale class. - */ -- class locale -+ class _GLIBCXX_IMPORT locale - { - public: - // Types: -@@ -67,9 +67,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - typedef int category; - - // Forward decls and friends: -- class facet; -- class id; -- class _Impl; -+ class _GLIBCXX_IMPORT facet; -+ class _GLIBCXX_IMPORT id; -+ class _GLIBCXX_IMPORT _Impl; - - friend class facet; - friend class _Impl; -@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * - * Facets may not be copied or assigned. - */ -- class locale::facet -+ class _GLIBCXX_IMPORT locale::facet - { - private: - friend class locale; -@@ -429,7 +429,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * cannot be used in a locale. The locale::id ensures that each class - * type gets a unique identifier. - */ -- class locale::id -+ class _GLIBCXX_IMPORT locale::id - { - private: - friend class locale; -@@ -468,7 +468,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - - - // Implementation object for locale. -- class locale::_Impl -+ class _GLIBCXX_IMPORT locale::_Impl - { - public: - // Friends. -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.tcc 2009-04-18 22:19:18.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/locale_classes.tcc 2010-04-19 05:11:01.765625000 +0100 -@@ -241,8 +241,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class collate; -- extern template class collate_byname; -+ extern template class _GLIBCXX_IMPORT collate; -+ extern template class _GLIBCXX_IMPORT collate_byname; - - extern template - const collate& -@@ -253,8 +253,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - has_facet >(const locale&); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class collate; -- extern template class collate_byname; -+ extern template class _GLIBCXX_IMPORT collate; -+ extern template class _GLIBCXX_IMPORT collate_byname; - - extern template - const collate& -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.h src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.h ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.h 2010-02-19 03:30:46.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.h 2010-04-19 05:11:01.765625000 +0100 -@@ -670,7 +670,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * optimizations as well. - */ - template<> -- class ctype : public locale::facet, public ctype_base -+ class _GLIBCXX_IMPORT ctype : public locale::facet, public ctype_base - { - public: - // Types: -@@ -1171,7 +1171,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * __ctype_abstract_base. - */ - template<> -- class ctype : public __ctype_abstract_base -+ class _GLIBCXX_IMPORT ctype : public __ctype_abstract_base - { - public: - // Types: -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.tcc 2009-07-18 23:58:10.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets.tcc 2010-04-19 05:11:01.781250000 +0100 -@@ -1276,11 +1276,11 @@ _GLIBCXX_END_LDBL_NAMESPACE - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class numpunct; -- extern template class numpunct_byname; -- extern template class _GLIBCXX_LDBL_NAMESPACE num_get; -- extern template class _GLIBCXX_LDBL_NAMESPACE num_put; -- extern template class ctype_byname; -+ extern template class _GLIBCXX_IMPORT numpunct; -+ extern template class _GLIBCXX_IMPORT numpunct_byname; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_get; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_put; -+ extern template class _GLIBCXX_IMPORT ctype_byname; - - extern template - const ctype& -@@ -1315,11 +1315,11 @@ _GLIBCXX_END_LDBL_NAMESPACE - has_facet >(const locale&); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class numpunct; -- extern template class numpunct_byname; -- extern template class _GLIBCXX_LDBL_NAMESPACE num_get; -- extern template class _GLIBCXX_LDBL_NAMESPACE num_put; -- extern template class ctype_byname; -+ extern template class _GLIBCXX_IMPORT numpunct; -+ extern template class _GLIBCXX_IMPORT numpunct_byname; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_get; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_put; -+ extern template class _GLIBCXX_IMPORT ctype_byname; - - extern template - const ctype& -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2010-01-07 17:20:45.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2010-04-19 05:11:01.781250000 +0100 -@@ -1214,19 +1214,19 @@ _GLIBCXX_END_LDBL_NAMESPACE - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class moneypunct; -- extern template class moneypunct; -- extern template class moneypunct_byname; -- extern template class moneypunct_byname; -- extern template class _GLIBCXX_LDBL_NAMESPACE money_get; -- extern template class _GLIBCXX_LDBL_NAMESPACE money_put; -- extern template class __timepunct; -- extern template class time_put; -- extern template class time_put_byname; -- extern template class time_get; -- extern template class time_get_byname; -- extern template class messages; -- extern template class messages_byname; -+ extern template class _GLIBCXX_IMPORT moneypunct; -+ extern template class _GLIBCXX_IMPORT moneypunct; -+ extern template class _GLIBCXX_IMPORT moneypunct_byname; -+ extern template class _GLIBCXX_IMPORT moneypunct_byname; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_get; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_put; -+ extern template class _GLIBCXX_IMPORT __timepunct; -+ extern template class _GLIBCXX_IMPORT time_put; -+ extern template class _GLIBCXX_IMPORT time_put_byname; -+ extern template class _GLIBCXX_IMPORT time_get; -+ extern template class _GLIBCXX_IMPORT time_get_byname; -+ extern template class _GLIBCXX_IMPORT messages; -+ extern template class _GLIBCXX_IMPORT messages_byname; - - extern template - const moneypunct& -@@ -1289,19 +1289,19 @@ _GLIBCXX_END_LDBL_NAMESPACE - has_facet >(const locale&); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class moneypunct; -- extern template class moneypunct; -- extern template class moneypunct_byname; -- extern template class moneypunct_byname; -- extern template class _GLIBCXX_LDBL_NAMESPACE money_get; -- extern template class _GLIBCXX_LDBL_NAMESPACE money_put; -- extern template class __timepunct; -- extern template class time_put; -- extern template class time_put_byname; -- extern template class time_get; -- extern template class time_get_byname; -- extern template class messages; -- extern template class messages_byname; -+ extern template class _GLIBCXX_IMPORT moneypunct; -+ extern template class _GLIBCXX_IMPORT moneypunct; -+ extern template class _GLIBCXX_IMPORT moneypunct_byname; -+ extern template class _GLIBCXX_IMPORT moneypunct_byname; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_get; -+ extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_put; -+ extern template class _GLIBCXX_IMPORT __timepunct; -+ extern template class _GLIBCXX_IMPORT time_put; -+ extern template class _GLIBCXX_IMPORT time_put_byname; -+ extern template class _GLIBCXX_IMPORT time_get; -+ extern template class _GLIBCXX_IMPORT time_get_byname; -+ extern template class _GLIBCXX_IMPORT messages; -+ extern template class _GLIBCXX_IMPORT messages_byname; - - extern template - const moneypunct& -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/ostream.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/ostream.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/ostream.tcc 2009-09-05 01:18:07.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/ostream.tcc 2010-04-19 05:11:01.781250000 +0100 -@@ -357,7 +357,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_ostream; -+ extern template class _GLIBCXX_IMPORT basic_ostream; - extern template ostream& endl(ostream&); - extern template ostream& ends(ostream&); - extern template ostream& flush(ostream&); -@@ -380,7 +380,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - extern template ostream& ostream::_M_insert(const void*); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_ostream; -+ extern template class _GLIBCXX_IMPORT basic_ostream; - extern template wostream& endl(wostream&); - extern template wostream& ends(wostream&); - extern template wostream& flush(wostream&); -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/sstream.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/sstream.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/sstream.tcc 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/sstream.tcc 2010-04-19 05:11:01.796875000 +0100 -@@ -255,16 +255,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_stringbuf; -- extern template class basic_istringstream; -- extern template class basic_ostringstream; -- extern template class basic_stringstream; -+ extern template class _GLIBCXX_IMPORT basic_stringbuf; -+ extern template class _GLIBCXX_IMPORT basic_istringstream; -+ extern template class _GLIBCXX_IMPORT basic_ostringstream; -+ extern template class _GLIBCXX_IMPORT basic_stringstream; - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_stringbuf; -- extern template class basic_istringstream; -- extern template class basic_ostringstream; -- extern template class basic_stringstream; -+ extern template class _GLIBCXX_IMPORT basic_stringbuf; -+ extern template class _GLIBCXX_IMPORT basic_istringstream; -+ extern template class _GLIBCXX_IMPORT basic_ostringstream; -+ extern template class _GLIBCXX_IMPORT basic_stringstream; - #endif - #endif - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/bits/streambuf.tcc src/gcc-4.5.0/libstdc++-v3/include/bits/streambuf.tcc ---- origsrc/gcc-4.5.0/libstdc++-v3/include/bits/streambuf.tcc 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/bits/streambuf.tcc 2010-04-19 05:11:01.796875000 +0100 -@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. - #if _GLIBCXX_EXTERN_TEMPLATE -- extern template class basic_streambuf; -+ extern template class _GLIBCXX_IMPORT basic_streambuf; - extern template - streamsize - __copy_streambufs(basic_streambuf*, -@@ -157,7 +157,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - basic_streambuf*, bool&); - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern template class basic_streambuf; -+ extern template class _GLIBCXX_IMPORT basic_streambuf; - extern template - streamsize - __copy_streambufs(basic_streambuf*, -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/ext/concurrence.h src/gcc-4.5.0/libstdc++-v3/include/ext/concurrence.h ---- origsrc/gcc-4.5.0/libstdc++-v3/include/ext/concurrence.h 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/ext/concurrence.h 2010-04-19 05:11:01.796875000 +0100 -@@ -60,7 +60,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - - // NB: As this is used in libsupc++, need to only depend on - // exception. No stdexception classes, no use of std::string. -- class __concurrence_lock_error : public std::exception -+ class _GLIBCXX_IMPORT __concurrence_lock_error : public std::exception - { - public: - virtual char const* -@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - { return "__gnu_cxx::__concurrence_lock_error"; } - }; - -- class __concurrence_unlock_error : public std::exception -+ class _GLIBCXX_IMPORT __concurrence_unlock_error : public std::exception - { - public: - virtual char const* -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/std/iostream src/gcc-4.5.0/libstdc++-v3/include/std/iostream ---- origsrc/gcc-4.5.0/libstdc++-v3/include/std/iostream 2010-02-04 18:20:34.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/include/std/iostream 2010-04-19 05:11:01.796875000 +0100 -@@ -56,16 +56,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * linked to above. - */ - //@{ -- extern istream cin; ///< Linked to standard input -- extern ostream cout; ///< Linked to standard output -- extern ostream cerr; ///< Linked to standard error (unbuffered) -- extern ostream clog; ///< Linked to standard error (buffered) -+ extern _GLIBCXX_IMPORT istream cin; ///< Linked to standard input -+ extern _GLIBCXX_IMPORT ostream cout; ///< Linked to standard output -+ extern _GLIBCXX_IMPORT ostream cerr; ///< Linked to standard error (unbuffered) -+ extern _GLIBCXX_IMPORT ostream clog; ///< Linked to standard error (buffered) - - #ifdef _GLIBCXX_USE_WCHAR_T -- extern wistream wcin; ///< Linked to standard input -- extern wostream wcout; ///< Linked to standard output -- extern wostream wcerr; ///< Linked to standard error (unbuffered) -- extern wostream wclog; ///< Linked to standard error (buffered) -+ extern _GLIBCXX_IMPORT wistream wcin; ///< Linked to standard input -+ extern _GLIBCXX_IMPORT wostream wcout; ///< Linked to standard output -+ extern _GLIBCXX_IMPORT wostream wcerr; ///< Linked to standard error (unbuffered) -+ extern _GLIBCXX_IMPORT wostream wclog; ///< Linked to standard error (buffered) - #endif - //@} - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/include/std/stdexcept src/gcc-4.5.0/libstdc++-v3/include/std/stdexcept ---- origsrc/gcc-4.5.0/libstdc++-v3/include/std/stdexcept 2009-04-09 16:00:19.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/include/std/stdexcept 2010-04-19 05:11:01.812500000 +0100 -@@ -50,7 +50,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * program runs (e.g., violations of class invariants). - * @brief One of two subclasses of exception. - */ -- class logic_error : public exception -+ class _GLIBCXX_IMPORT logic_error : public exception - { - string _M_msg; - -@@ -70,14 +70,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - - /** Thrown by the library, or by you, to report domain errors (domain in - * the mathematical sense). */ -- class domain_error : public logic_error -+ class _GLIBCXX_IMPORT domain_error : public logic_error - { - public: - explicit domain_error(const string& __arg); - }; - - /** Thrown to report invalid arguments to functions. */ -- class invalid_argument : public logic_error -+ class _GLIBCXX_IMPORT invalid_argument : public logic_error - { - public: - explicit invalid_argument(const string& __arg); -@@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - - /** Thrown when an object is constructed that would exceed its maximum - * permitted size (e.g., a basic_string instance). */ -- class length_error : public logic_error -+ class _GLIBCXX_IMPORT length_error : public logic_error - { - public: - explicit length_error(const string& __arg); -@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - - /** This represents an argument whose value is not within the expected - * range (e.g., boundary checks in basic_string). */ -- class out_of_range : public logic_error -+ class _GLIBCXX_IMPORT out_of_range : public logic_error - { - public: - explicit out_of_range(const string& __arg); -@@ -104,7 +104,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - * the program executes. - * @brief One of two subclasses of exception. - */ -- class runtime_error : public exception -+ class _GLIBCXX_IMPORT runtime_error : public exception - { - string _M_msg; - -@@ -123,7 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - }; - - /** Thrown to indicate range errors in internal computations. */ -- class range_error : public runtime_error -+ class _GLIBCXX_IMPORT range_error : public runtime_error - { - public: - explicit range_error(const string& __arg); -@@ -137,7 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - }; - - /** Thrown to indicate arithmetic underflow. */ -- class underflow_error : public runtime_error -+ class _GLIBCXX_IMPORT underflow_error : public runtime_error - { - public: - explicit underflow_error(const string& __arg); -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.am src/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.am ---- origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.am 2009-08-23 08:28:35.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.am 2010-04-19 05:11:01.812500000 +0100 -@@ -154,7 +154,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --ta - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) - --LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) -+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \ -+ -no-undefined -bindir $(bindir) - - # 3) We'd have a problem when building the shared libstdc++ object if - # the rules automake generates would be used. We cannot allow g++ to -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.in src/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.in ---- origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.in 2010-04-02 19:18:06.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/libsupc++/Makefile.in 2010-04-19 05:11:01.812500000 +0100 -@@ -466,7 +466,9 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --ta - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) - --LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) -+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \ -+ -no-undefined -bindir $(bindir) -+ - - # 3) We'd have a problem when building the shared libstdc++ object if - # the rules automake generates would be used. We cannot allow g++ to -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/exception src/gcc-4.5.0/libstdc++-v3/libsupc++/exception ---- origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/exception 2010-02-18 17:58:53.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/libsupc++/exception 2010-04-19 05:09:20.750000000 +0100 -@@ -58,7 +58,7 @@ namespace std - * your own %exception classes, or use a different hierarchy, or to - * throw non-class data (e.g., fundamental types). - */ -- class exception -+ class _GLIBCXX_IMPORT exception - { - public: - exception() throw() { } -@@ -71,7 +71,7 @@ namespace std - - /** If an %exception is thrown which is not listed in a function's - * %exception specification, one of these may be thrown. */ -- class bad_exception : public exception -+ class _GLIBCXX_IMPORT bad_exception : public exception - { - public: - bad_exception() throw() { } -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/new src/gcc-4.5.0/libstdc++-v3/libsupc++/new ---- origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/new 2010-02-18 17:58:53.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/libsupc++/new 2010-04-19 05:11:01.828125000 +0100 -@@ -53,7 +53,7 @@ namespace std - * - * @c bad_alloc (or classes derived from it) is used to report allocation - * errors from the throwing forms of @c new. */ -- class bad_alloc : public exception -+ class _GLIBCXX_IMPORT bad_alloc : public exception - { - public: - bad_alloc() throw() { } -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/typeinfo src/gcc-4.5.0/libstdc++-v3/libsupc++/typeinfo ---- origsrc/gcc-4.5.0/libstdc++-v3/libsupc++/typeinfo 2010-02-18 17:58:53.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/libsupc++/typeinfo 2010-04-19 05:10:35.125000000 +0100 -@@ -84,7 +84,7 @@ namespace std - * The @c type_info class describes type information generated by - * an implementation. - */ -- class type_info -+ class _GLIBCXX_IMPORT type_info - { - public: - /** Destructor first. Being the first non-inline virtual function, this -@@ -171,7 +171,7 @@ namespace std - * - * If you attempt an invalid @c dynamic_cast expression, an instance of - * this class (or something derived from this class) is thrown. */ -- class bad_cast : public exception -+ class _GLIBCXX_IMPORT bad_cast : public exception - { - public: - bad_cast() throw() { } -@@ -188,7 +188,7 @@ namespace std - * @brief Thrown when a NULL pointer in a @c typeid expression is used. - * @ingroup exceptions - */ -- class bad_typeid : public exception -+ class _GLIBCXX_IMPORT bad_typeid : public exception - { - public: - bad_typeid () throw() { } -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/scripts/testsuite_flags.in src/gcc-4.5.0/libstdc++-v3/scripts/testsuite_flags.in ---- origsrc/gcc-4.5.0/libstdc++-v3/scripts/testsuite_flags.in 2007-09-11 23:32:51.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/scripts/testsuite_flags.in 2010-04-19 05:11:01.828125000 +0100 -@@ -27,6 +27,7 @@ EOF - BUILD_DIR=@glibcxx_builddir@ - SRC_DIR=@glibcxx_srcdir@ - PREFIX_DIR=@glibcxx_prefixdir@ -+target=@target@ - query=$1 - - case ${query} in -@@ -71,6 +72,12 @@ case ${query} in - ;; - --cxxldflags) - SECTIONLDFLAGS="@SECTION_LDFLAGS@ @LIBICONV@" -+ case ${target} in -+ *cygwin*) -+ SECTIONLDFLAGS="${SECTIONLDFLAGS} -Wl,--enable-auto-import" -+ ;; -+ esac -+ - echo ${SECTIONLDFLAGS} - ;; - *) -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/src/Makefile.am src/gcc-4.5.0/libstdc++-v3/src/Makefile.am ---- origsrc/gcc-4.5.0/libstdc++-v3/src/Makefile.am 2010-02-22 18:07:07.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/src/Makefile.am 2010-04-19 05:11:01.828125000 +0100 -@@ -210,7 +210,8 @@ libstdc___la_DEPENDENCIES = \ - $(top_builddir)/libsupc++/libsupc++convenience.la - - libstdc___la_LDFLAGS = \ -- -version-info $(libtool_VERSION) ${version_arg} -lm -+ -version-info $(libtool_VERSION) ${version_arg} -lm \ -+ -no-undefined -bindir $(bindir) - - libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/src/Makefile.in src/gcc-4.5.0/libstdc++-v3/src/Makefile.in ---- origsrc/gcc-4.5.0/libstdc++-v3/src/Makefile.in 2010-04-02 19:18:06.000000000 +0100 -+++ src/gcc-4.5.0/libstdc++-v3/src/Makefile.in 2010-04-19 05:11:01.828125000 +0100 -@@ -452,7 +452,8 @@ libstdc___la_DEPENDENCIES = \ - $(top_builddir)/libsupc++/libsupc++convenience.la - - libstdc___la_LDFLAGS = \ -- -version-info $(libtool_VERSION) ${version_arg} -lm -+ -version-info $(libtool_VERSION) ${version_arg} -lm \ -+ -no-undefined -bindir $(bindir) - - libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) - -diff -pruN origsrc/gcc-4.5.0/libstdc++-v3/testsuite/lib/libstdc++.exp src/gcc-4.5.0/libstdc++-v3/testsuite/lib/libstdc++.exp ---- origsrc/gcc-4.5.0/libstdc++-v3/testsuite/lib/libstdc++.exp 2010-01-07 00:22:51.000000000 +0000 -+++ src/gcc-4.5.0/libstdc++-v3/testsuite/lib/libstdc++.exp 2010-04-19 05:11:01.843750000 +0100 -@@ -124,6 +124,9 @@ proc libstdc++_init { testfile } { - if { [string match "powerpc-*-darwin*" $target_triplet] } { - append DEFAULT_CXXFLAGS " -multiply_defined suppress" - } -+ if { [string match "*-*-cygwin*" $target_triplet] } { -+ append DEFAULT_CXXFLAGS " -Wl,--enable-auto-import" -+ } - } - v3track DEFAULT_CXXFLAGS 2 - -@@ -144,6 +147,9 @@ proc libstdc++_init { testfile } { - set gccdir [file dirname $gccdir] - append ld_library_path_tmp ":${gccdir}" - } -+ if { [string match "*-*-cygwin*" $target_triplet] } { -+ append ld_library_path_tmp ":${blddir}/../libgcc" -+ } - v3track gccdir 3 - - # Locate libgomp. This is only required for parallel mode. diff --git a/gcc45-misc-core.diff b/gcc45-misc-core.diff deleted file mode 100644 index 51cee37..0000000 --- a/gcc45-misc-core.diff +++ /dev/null @@ -1,54 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/gcc/config/i386/cygwin.h src/gcc-4.5.0/gcc/config/i386/cygwin.h ---- origsrc/gcc-4.5.0/gcc/config/i386/cygwin.h 2010-04-02 20:54:46.000000000 +0100 -+++ src/gcc-4.5.0/gcc/config/i386/cygwin.h 2010-04-19 03:58:09.031250000 +0100 -@@ -303,3 +303,23 @@ while (0) - /* We should find a way to not have to update this manually. */ - #define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-11.dll" - -+/* Make stack executable to avoid DEP problems with trampolines. */ -+#undef CYGWIN_ENABLE_EXECUTE_STACK -+#define CYGWIN_ENABLE_EXECUTE_STACK \ -+extern void __enable_execute_stack (void *); \ -+void \ -+__enable_execute_stack (void *addr) \ -+{ \ -+ MEMORY_BASIC_INFORMATION b; \ -+ if (!VirtualQuery (addr, &b, sizeof(b))) \ -+ abort (); \ -+ VirtualProtect (b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE, \ -+ &b.Protect); \ -+} -+ -+#undef ENABLE_EXECUTE_STACK -+#define ENABLE_EXECUTE_STACK CYGWIN_ENABLE_EXECUTE_STACK -+ -+#ifdef IN_LIBGCC2 -+#include -+#endif -diff -pruN origsrc/gcc-4.5.0/gcc/cppdefault.c src/gcc-4.5.0/gcc/cppdefault.c ---- origsrc/gcc-4.5.0/gcc/cppdefault.c 2007-07-26 09:37:01.000000000 +0100 -+++ src/gcc-4.5.0/gcc/cppdefault.c 2010-04-19 04:28:35.406250000 +0100 -@@ -39,6 +39,8 @@ - # undef STANDARD_INCLUDE_DIR - #else - # undef CROSS_INCLUDE_DIR -+# undef CROSS_INCLUDE_DIR_1 -+# undef CROSS_INCLUDE_DIR_2 - #endif - - const struct default_include cpp_include_defaults[] -@@ -85,6 +87,14 @@ const struct default_include cpp_include - /* One place the target system's headers might be. */ - { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, - #endif -+#ifdef CROSS_INCLUDE_DIR_1 -+ /* One more place the target system's headers might be. */ -+ { CROSS_INCLUDE_DIR_1, "GCC", 0, 0, 0, 0 }, -+#endif -+#ifdef CROSS_INCLUDE_DIR_2 -+ /* One more place the target system's headers might be. */ -+ { CROSS_INCLUDE_DIR_2, "GCC", 0, 0, 0, 0 }, -+#endif - #ifdef TOOL_INCLUDE_DIR - /* Another place the target system's headers might be. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, diff --git a/gcc45-mnocygwin.diff b/gcc45-mnocygwin.diff deleted file mode 100644 index 3dd13b5..0000000 --- a/gcc45-mnocygwin.diff +++ /dev/null @@ -1,120 +0,0 @@ -diff -pruN origsrc/gcc-4.5.0/gcc/config.gcc src/gcc-4.5.0/gcc/config.gcc ---- origsrc/gcc-4.5.0/gcc/config.gcc 2010-04-07 11:34:00.000000000 +0100 -+++ src/gcc-4.5.0/gcc/config.gcc 2010-04-20 07:29:42.921875000 +0100 -@@ -1329,8 +1329,8 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*) - target_gtfiles="\$(srcdir)/config/i386/winnt.c" - extra_options="${extra_options} i386/cygming.opt" - extra_objs="winnt.o winnt-stubs.o" -- c_target_objs="${c_target_objs} cygwin2.o msformat-c.o" -- cxx_target_objs="${cxx_target_objs} cygwin2.o winnt-cxx.o msformat-c.o" -+ c_target_objs="${c_target_objs} msformat-c.o" -+ cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" - extra_gcc_objs=cygwin1.o - if test x$enable_threads = xyes; then - thread_file='posix' -diff -pruN origsrc/gcc-4.5.0/gcc/config/i386/cygwin1.c src/gcc-4.5.0/gcc/config/i386/cygwin1.c ---- origsrc/gcc-4.5.0/gcc/config/i386/cygwin1.c 2009-02-20 15:20:38.000000000 +0000 -+++ src/gcc-4.5.0/gcc/config/i386/cygwin1.c 2010-04-19 04:13:04.578125000 +0100 -@@ -38,16 +38,8 @@ mingw_scan (int argc ATTRIBUTE_UNUSED, - putenv (xstrdup ("GCC_CYGWIN_WIN32=1")); - else if (strcmp (*argv, "-mno-cygwin") == 0) - { -- char *p = strstr (*spec_machine, "-cygwin"); -- if (p) -- { -- int len = p - *spec_machine; -- char *s = XNEWVEC (char, strlen (*spec_machine) + 3); -- memcpy (s, *spec_machine, len); -- strcpy (s + len, "-mingw32"); -- *spec_machine = s; -- } -- putenv (xstrdup ("GCC_CYGWIN_MINGW=1")); -+ fatal ("The -mno-cygwin flag has been removed; use a " -+ "mingw-targeted cross-compiler.\n"); - } - return; - } -diff -pruN origsrc/gcc-4.5.0/gcc/config/i386/cygwin2.c src/gcc-4.5.0/gcc/config/i386/cygwin2.c ---- origsrc/gcc-4.5.0/gcc/config/i386/cygwin2.c 2007-08-02 11:49:31.000000000 +0100 -+++ src/gcc-4.5.0/gcc/config/i386/cygwin2.c 1970-01-01 00:00:00.000000000 +0000 -@@ -1,66 +0,0 @@ --/* Helper routines for cygwin-specific command-line parsing. -- Contributed by Christopher Faylor (cgf@redhat.com) -- Copyright 2003, 2007 Free Software Foundation, Inc. -- --This file is part of GCC. -- --GCC 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, or (at your option) --any later version. -- --GCC 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 GCC; see the file COPYING3. If not see --. */ -- --#include "config.h" --#include "system.h" --#include "coretypes.h" --#include "tm.h" -- --#include "safe-ctype.h" --#include -- --/* --static void remove_w32api (void); --*/ --static void add_mingw (void); --static void set_mingw (void) __attribute__ ((constructor)); -- --static void --add_mingw (void) --{ -- char **av; -- char *p; -- for (av = cvt_to_mingw; *av; av++) -- { -- int sawcygwin = 0; -- while ((p = strstr (*av, "-cygwin"))) -- { -- char *over = p + sizeof ("-cygwin") - 1; -- memmove (over + 1, over, strlen (over)); -- memcpy (p, "-mingw32", sizeof("-mingw32") - 1); -- p = ++over; -- while (ISALNUM (*p)) -- p++; -- strcpy (over, p); -- sawcygwin = 1; -- } -- if (!sawcygwin && !strstr (*av, "mingw")) -- strcat (*av, CYGWIN_MINGW_SUBDIR); -- } --} -- -- --static void --set_mingw (void) --{ -- char *env = getenv ("GCC_CYGWIN_MINGW"); -- if (env && *env == '1') -- add_mingw (); --} -diff -pruN origsrc/gcc-4.5.0/gcc/config/i386/t-cygwin src/gcc-4.5.0/gcc/config/i386/t-cygwin ---- origsrc/gcc-4.5.0/gcc/config/i386/t-cygwin 2009-05-26 15:02:04.000000000 +0100 -+++ src/gcc-4.5.0/gcc/config/i386/t-cygwin 2010-04-19 04:28:35.406250000 +0100 -@@ -28,10 +28,6 @@ cygwin1.o: $(srcdir)/config/i386/cygwin1 - $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/cygwin1.c - --cygwin2.o: $(srcdir)/config/i386/cygwin2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ -- $(TM_H) $(TM_P_H) -- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -- $(srcdir)/config/i386/cygwin2.c - - # Cygwin-specific parts of LIB_SPEC - SHLIB_LC = -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 diff --git a/gcc45-peflags.diff b/gcc45-peflags.diff deleted file mode 100644 index 7b01c05..0000000 --- a/gcc45-peflags.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- origsrc/gcc-4.5.3/gcc/config/i386/cygwin.h 2011-07-10 00:52:31.709323700 -0500 -+++ src/gcc-4.5.3/gcc/config/i386/cygwin.h 2011-07-10 01:24:24.630654600 -0500 -@@ -126,7 +126,8 @@ along with GCC; see the file COPYING3. - %{shared|mdll: --enable-auto-image-base -e \ - %{mno-cygwin:_DllMainCRTStartup@12} \ - %{!mno-cygwin:__cygwin_dll_entry@12}}\ -- %{!mno-cygwin:--dll-search-prefix=cyg -tsaware}" -+ %{!mno-cygwin:--dll-search-prefix=cyg \ -+ %{!shared: %{!mdll: --large-address-aware --tsaware}}}" - - /* Allocate space for all of the machine-spec-specific stuff. - Allocate enough space for cygwin -> mingw32 munging plus diff --git a/gcc45-sig-unwind.diff b/gcc45-sig-unwind.diff deleted file mode 100644 index 55776cb..0000000 --- a/gcc45-sig-unwind.diff +++ /dev/null @@ -1,90 +0,0 @@ -Contributed by the AdaCore guys on the gcc-patches list at: -http://gcc.gnu.org/ml/gcc-patches/2010-03/msg01234.html - - -2010-03-26 Eric Botcazou - Olivier Hainque - - * config/i386/w32-unwind.h (i386_w32_fallback_frame_state): Fix regnum - of EBP. Do not restore reg #9. Remove +1 adjustment to EIP and set - fs->signal_frame instead. - - -Index: gcc/config/i386/w32-unwind.h -=================================================================== ---- gcc/config/i386/w32-unwind.h (revision 157721) -+++ gcc/config/i386/w32-unwind.h (working copy) -@@ -1,5 +1,5 @@ --/* Definitions for Dwarf2 EH unwind support for Windows32 targets -- Copyright (C) 2007, 2009 -+/* Definitions for Dwarf2 EH unwind support for Windows32 targets -+ Copyright (C) 2007, 2009, 2010 - Free Software Foundation, Inc. - Contributed by Pascal Obry - -@@ -129,7 +129,6 @@ i386_w32_fallback_frame_state (struct _U - - /* In the test below we look for two specific patterns found - experimentally to be in the Windows signal handler. */ -- - if (SIG_PAT1 || SIG_PAT2 || SIG_SEH1 || SIG_SEH2) - { - PEXCEPTION_POINTERS weinfo_; -@@ -147,14 +146,12 @@ i386_w32_fallback_frame_state (struct _U - } - - /* The new context frame address is the stack pointer. */ -- - new_cfa_ = proc_ctx_->Esp; - fs->regs.cfa_how = CFA_REG_OFFSET; - fs->regs.cfa_reg = __builtin_dwarf_sp_column(); - fs->regs.cfa_offset = new_cfa_ - (long) ctx_cfa_; - -- /* Save some registers. */ -- -+ /* Restore registers. */ - fs->regs.reg[0].how = REG_SAVED_OFFSET; - fs->regs.reg[0].loc.offset = (long)&proc_ctx_->Eax - new_cfa_; - fs->regs.reg[3].how = REG_SAVED_OFFSET; -@@ -167,18 +164,13 @@ i386_w32_fallback_frame_state (struct _U - fs->regs.reg[6].loc.offset = (long)&proc_ctx_->Esi - new_cfa_; - fs->regs.reg[7].how = REG_SAVED_OFFSET; - fs->regs.reg[7].loc.offset = (long)&proc_ctx_->Edi - new_cfa_; -- fs->regs.reg[9].how = REG_SAVED_OFFSET; -- fs->regs.reg[9].loc.offset = (long)&proc_ctx_->Eip - new_cfa_; -- fs->regs.reg[4].how = REG_SAVED_OFFSET; -- fs->regs.reg[4].loc.offset = (long)&proc_ctx_->Ebp - new_cfa_; -- -- /* Set the return address to Eip + 1. As we can be called multiple -- times we use another register for this. */ -- -- proc_ctx_->Dr0 = proc_ctx_->Eip + 1; -+ fs->regs.reg[5].how = REG_SAVED_OFFSET; -+ fs->regs.reg[5].loc.offset = (long)&proc_ctx_->Ebp - new_cfa_; - fs->regs.reg[8].how = REG_SAVED_OFFSET; -- fs->regs.reg[8].loc.offset = (long)&proc_ctx_->Dr0 - new_cfa_; -+ fs->regs.reg[8].loc.offset = (long)&proc_ctx_->Eip - new_cfa_; - fs->retaddr_column = 8; -+ fs->signal_frame = 1; -+ - return _URC_NO_REASON; - } - -@@ -186,7 +178,6 @@ i386_w32_fallback_frame_state (struct _U - one of it's probes prior to the real SP adjustment. The only - operations of interest performed is "pushl %ecx", followed by - ecx clobbering. */ -- - else if (SIG_ALLOCA) - { - /* Only one push between entry in _alloca and the probe trap. */ -@@ -204,7 +195,8 @@ i386_w32_fallback_frame_state (struct _U - fs->retaddr_column = 8; - fs->regs.reg[8].how = REG_SAVED_OFFSET; - fs->regs.reg[8].loc.offset = 0; -- -+ fs->signal_frame = 1; -+ - return _URC_NO_REASON; - } - else diff --git a/gcc47-ada.patch b/gcc47-ada.patch new file mode 100644 index 0000000..ad67a4a --- /dev/null +++ b/gcc47-ada.patch @@ -0,0 +1,3269 @@ +--- origsrc/gcc-4.7.2/gcc/ada//a-intnam-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//a-intnam-cygwin.ads 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,170 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- A D A . I N T E R R U P T S . N A M E S -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- . -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is a Cygwin version of this package but really it's a copy of the ++-- Linux version, so the below comments are probably irrelevant: ++ ++-- The following signals are reserved by the run time (FSU threads): ++ ++-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT, ++-- SIGALRM, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL ++ ++-- The following signals are reserved by the run time (LinuxThreads): ++ ++-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT, ++-- SIGUSR1, SIGUSR2, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL ++ ++-- The pragma Unreserve_All_Interrupts affects the following signal(s): ++ ++-- SIGINT: made available for Ada handler ++ ++-- This target-dependent package spec contains names of interrupts ++-- supported by the local system. ++ ++with System.OS_Interface; ++-- used for names of interrupts ++ ++package Ada.Interrupts.Names is ++ ++ -- All identifiers in this unit are implementation defined ++ ++ pragma Implementation_Defined; ++ ++ -- Beware that the mapping of names to signals may be many-to-one. There ++ -- may be aliases. Also, for all signal names that are not supported on the ++ -- current system the value of the corresponding constant will be zero. ++ ++ SIGHUP : constant Interrupt_ID := ++ System.OS_Interface.SIGHUP; -- hangup ++ ++ SIGINT : constant Interrupt_ID := ++ System.OS_Interface.SIGINT; -- interrupt (rubout) ++ ++ SIGQUIT : constant Interrupt_ID := ++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS) ++ ++ SIGILL : constant Interrupt_ID := ++ System.OS_Interface.SIGILL; -- illegal instruction (not reset) ++ ++ SIGTRAP : constant Interrupt_ID := ++ System.OS_Interface.SIGTRAP; -- trace trap (not reset) ++ ++ SIGIOT : constant Interrupt_ID := ++ System.OS_Interface.SIGIOT; -- IOT instruction ++ ++ SIGABRT : constant Interrupt_ID := -- used by abort, ++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future ++ ++ SIGFPE : constant Interrupt_ID := ++ System.OS_Interface.SIGFPE; -- floating point exception ++ ++ SIGKILL : constant Interrupt_ID := ++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) ++ ++ SIGBUS : constant Interrupt_ID := ++ System.OS_Interface.SIGBUS; -- bus error ++ ++ SIGSEGV : constant Interrupt_ID := ++ System.OS_Interface.SIGSEGV; -- segmentation violation ++ ++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with ++ System.OS_Interface.SIGPIPE; -- no one to read it ++ ++ SIGALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGALRM; -- alarm clock ++ ++ SIGTERM : constant Interrupt_ID := ++ System.OS_Interface.SIGTERM; -- software termination signal from kill ++ ++ SIGUSR1 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR1; -- user defined signal 1 ++ ++ SIGUSR2 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR2; -- user defined signal 2 ++ ++ SIGCLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCLD; -- child status change ++ ++ SIGCHLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD ++ ++ SIGWINCH : constant Interrupt_ID := ++ System.OS_Interface.SIGWINCH; -- window size change ++ ++ SIGURG : constant Interrupt_ID := ++ System.OS_Interface.SIGURG; -- urgent condition on IO channel ++ ++ SIGPOLL : constant Interrupt_ID := ++ System.OS_Interface.SIGPOLL; -- pollable event occurred ++ ++ SIGIO : constant Interrupt_ID := -- input/output possible, ++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) ++ ++ SIGSTOP : constant Interrupt_ID := ++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) ++ ++ SIGTSTP : constant Interrupt_ID := ++ System.OS_Interface.SIGTSTP; -- user stop requested from tty ++ ++ SIGCONT : constant Interrupt_ID := ++ System.OS_Interface.SIGCONT; -- stopped process has been continued ++ ++ SIGTTIN : constant Interrupt_ID := ++ System.OS_Interface.SIGTTIN; -- background tty read attempted ++ ++ SIGTTOU : constant Interrupt_ID := ++ System.OS_Interface.SIGTTOU; -- background tty write attempted ++ ++ SIGVTALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGVTALRM; -- virtual timer expired ++ ++ SIGPROF : constant Interrupt_ID := ++ System.OS_Interface.SIGPROF; -- profiling timer expired ++ ++ SIGXCPU : constant Interrupt_ID := ++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded ++ ++ SIGXFSZ : constant Interrupt_ID := ++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded ++ ++ SIGUNUSED : constant Interrupt_ID := ++ System.OS_Interface.SIGUNUSED; -- unused signal ++ ++ SIGSTKFLT : constant Interrupt_ID := ++ System.OS_Interface.SIGSTKFLT; -- stack fault on coprocessor ++ ++ SIGLOST : constant Interrupt_ID := ++ System.OS_Interface.SIGLOST; -- Linux alias for SIGIO ++ ++ SIGPWR : constant Interrupt_ID := ++ System.OS_Interface.SIGPWR; -- Power failure ++ ++end Ada.Interrupts.Names; +--- origsrc/gcc-4.7.2/gcc/ada//gcc-interface/Makefile.in 2012-11-02 15:16:49.765625000 +0000 ++++ src/gcc-4.7.2/gcc/ada//gcc-interface/Makefile.in 2012-11-01 21:17:31.000000000 +0000 +@@ -191,6 +191,13 @@ TARGET_ADA_SRCS = + # Type of tools build we are doing; default is not compiling tools. + TOOLSCASE = + ++# Which install goal to use. ++INSTALL_GNATLIB_MAIN = install-gnatlib ++INSTALL_GNATLIB_WIN32 = unused-install-gnatlib ++ ++# Set shared lib prefix (lib on all systems but cygwin, which uses cyg) ++LIBGNAT_SHARED_LIB_PREFIX=lib ++ + # Multilib handling + MULTISUBDIR = + RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) +@@ -1583,6 +1590,12 @@ ifeq ($(strip $(filter-out avr none powe + endif + + ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(osys))),) ++ # Set target pair suffix for mingw or cygwin ++ W32_TARG=mingw ++ ifneq ($(strip $(filter cygwin%,$(osys))),) ++ W32_TARG=cygwin ++ LIBGNAT_SHARED_LIB_PREFIX=cyg ++ endif + # Cygwin provides a full Posix environment, and so we use the default + # versions of s-memory and g-socthi rather than the Windows-specific + # MinGW versions. Ideally we would use all the default versions for +@@ -1651,24 +1664,24 @@ ifeq ($(strip $(filter-out cygwin% mingw + ifeq ($(strip $(MULTISUBDIR)),/32) + LIBGNAT_TARGET_PAIRS += \ + $(X86_TARGET_PAIRS) \ +- system.ads. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the Windows version ++ ++package body Indepsw is ++ ++ Map_Switch : aliased constant String := "-Wl,-Map,"; ++ ++ ------------- ++ -- Convert -- ++ ------------- ++ ++ procedure Convert ++ (Switch : Switch_Kind; ++ Argument : String; ++ To : out String_List_Access) ++ is ++ begin ++ case Switch is ++ when Map_File => ++ To := new Argument_List'(1 => new String'(Map_Switch & Argument)); ++ end case; ++ end Convert; ++ ++ ------------------ ++ -- Is_Supported -- ++ ------------------ ++ ++ function Is_Supported (Switch : Switch_Kind) return Boolean is ++ begin ++ case Switch is ++ when Map_File => ++ return True; ++ end case; ++ end Is_Supported; ++ ++end Indepsw; +--- origsrc/gcc-4.7.2/gcc/ada//initialize.c 2012-11-02 15:16:50.031250000 +0000 ++++ src/gcc-4.7.2/gcc/ada//initialize.c 2012-11-01 21:17:31.000000000 +0000 +@@ -348,6 +348,40 @@ __gnat_initialize (void *eh ATTRIBUTE_UN + __main (); + } + ++#elif defined (__CYGWIN__) ++ ++/***************************************/ ++/* __gnat_initialize (Cygwin Version) */ ++/***************************************/ ++ ++extern void __main (void); ++ ++void ++__gnat_initialize (void *eh ATTRIBUTE_UNUSED) ++{ ++#ifdef IN_RTS ++ /* We must call __main to run the static ctors, or DW2 EH, amongst ++ other things, will fail. */ ++ __main (); ++#endif ++ /* Initialize floating-point coprocessor. This call is needed because ++ the MS libraries default to 64-bit precision instead of 80-bit ++ precision, and we require the full precision for proper operation, ++ given that we have set Max_Digits etc with this in mind */ ++ __gnat_init_float (); ++ ++ /* Note that we do not activate this for the compiler itself to avoid a ++ bootstrap path problem. Older version of gnatbind will generate a call ++ to __gnat_initialize() without argument. Therefore we cannot use eh in ++ this case. It will be possible to remove the following #ifdef at some ++ point. */ ++#ifdef IN_RTS ++ /* Install the Structured Exception handler. */ ++ if (eh) ++ __gnat_install_SEH_handler (eh); ++#endif ++} ++ + #else + + /* For all other versions of GNAT, the initialize routine and handler +--- origsrc/gcc-4.7.2/gcc/ada//mlib-tgt-specific-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//mlib-tgt-specific-cygwin.adb 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,162 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT COMPILER COMPONENTS -- ++-- -- ++-- M L I B . T G T . S P E C I F I C -- ++-- (Cygwin Version) -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 2002-2010, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT 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 distributed with GNAT; see file COPYING3. If not, go to -- ++-- http://www.gnu.org/licenses for a complete copy of the license. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the Windows version of the body. Works only with GCC versions ++-- supporting the "-shared" option. ++ ++with Opt; ++with Output; use Output; ++ ++with MLib.Fil; ++with MLib.Utl; ++ ++package body MLib.Tgt.Specific is ++ ++ package Files renames MLib.Fil; ++ package Tools renames MLib.Utl; ++ ++ -- Non default subprograms ++ ++ procedure Build_Dynamic_Library ++ (Ofiles : Argument_List; ++ Options : Argument_List; ++ Interfaces : Argument_List; ++ Lib_Filename : String; ++ Lib_Dir : String; ++ Symbol_Data : Symbol_Record; ++ Driver_Name : Name_Id := No_Name; ++ Lib_Version : String := ""; ++ Auto_Init : Boolean := False); ++ ++ function DLL_Ext return String; ++ ++ function DLL_Prefix return String; ++ ++ function Is_Archive_Ext (Ext : String) return Boolean; ++ ++ function Library_Major_Minor_Id_Supported return Boolean; ++ ++ function PIC_Option return String; ++ ++ Shared_Libgcc : aliased String := "-shared-libgcc"; ++ ++ Shared_Libgcc_Switch : constant Argument_List := ++ (1 => Shared_Libgcc'Access); ++ ++ --------------------------- ++ -- Build_Dynamic_Library -- ++ --------------------------- ++ ++ procedure Build_Dynamic_Library ++ (Ofiles : Argument_List; ++ Options : Argument_List; ++ Interfaces : Argument_List; ++ Lib_Filename : String; ++ Lib_Dir : String; ++ Symbol_Data : Symbol_Record; ++ Driver_Name : Name_Id := No_Name; ++ Lib_Version : String := ""; ++ Auto_Init : Boolean := False) ++ is ++ pragma Unreferenced (Symbol_Data); ++ pragma Unreferenced (Interfaces); ++ pragma Unreferenced (Lib_Version); ++ pragma Unreferenced (Auto_Init); ++ ++ Lib_File : constant String := ++ Lib_Dir & Directory_Separator & ++ DLL_Prefix & Files.Append_To (Lib_Filename, DLL_Ext); ++ ++ -- Start of processing for Build_Dynamic_Library ++ ++ begin ++ if Opt.Verbose_Mode then ++ Write_Str ("building relocatable shared library "); ++ Write_Line (Lib_File); ++ end if; ++ ++ Tools.Gcc ++ (Output_File => Lib_File, ++ Objects => Ofiles, ++ Options => Shared_Libgcc_Switch, ++ Options_2 => Options, ++ Driver_Name => Driver_Name); ++ end Build_Dynamic_Library; ++ ++ ------------- ++ -- DLL_Ext -- ++ ------------- ++ ++ function DLL_Ext return String is ++ begin ++ return "dll"; ++ end DLL_Ext; ++ ++ ---------------- ++ -- DLL_Prefix -- ++ ---------------- ++ ++ function DLL_Prefix return String is ++ begin ++ return "cyg"; ++ end DLL_Prefix; ++ ++ -------------------- ++ -- Is_Archive_Ext -- ++ -------------------- ++ ++ function Is_Archive_Ext (Ext : String) return Boolean is ++ begin ++ return Ext = ".a" or else Ext = ".dll"; ++ end Is_Archive_Ext; ++ ++ -------------------------------------- ++ -- Library_Major_Minor_Id_Supported -- ++ -------------------------------------- ++ ++ function Library_Major_Minor_Id_Supported return Boolean is ++ begin ++ return False; ++ end Library_Major_Minor_Id_Supported; ++ ++ ---------------- ++ -- PIC_Option -- ++ ---------------- ++ ++ function PIC_Option return String is ++ begin ++ return ""; ++ end PIC_Option; ++ ++begin ++ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access; ++ DLL_Ext_Ptr := DLL_Ext'Access; ++ DLL_Prefix_Ptr := DLL_Prefix'Access; ++ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access; ++ PIC_Option_Ptr := PIC_Option'Access; ++ Library_Major_Minor_Id_Supported_Ptr := ++ Library_Major_Minor_Id_Supported'Access; ++end MLib.Tgt.Specific; +--- origsrc/gcc-4.7.2/gcc/ada//s-gloloc-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//s-gloloc-cygwin.adb 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,107 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT COMPILER COMPONENTS -- ++-- -- ++-- S Y S T E M . G L O B A L _ L O C K S -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1999-2010, AdaCore -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- . -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This implementation is specific to NT ++ ++with System.OS_Interface; ++with System.Task_Lock; ++with System.Win32; ++ ++with Interfaces.C.Strings; ++ ++package body System.Global_Locks is ++ ++ package TSL renames System.Task_Lock; ++ package OSI renames System.OS_Interface; ++ package ICS renames Interfaces.C.Strings; ++ ++ subtype Lock_File_Entry is Win32.HANDLE; ++ ++ Last_Lock : Lock_Type := Null_Lock; ++ Lock_Table : array (Lock_Type range 1 .. 15) of Lock_File_Entry; ++ ++ ----------------- ++ -- Create_Lock -- ++ ----------------- ++ ++ procedure Create_Lock (Lock : out Lock_Type; Name : String) is ++ L : Lock_Type; ++ ++ begin ++ TSL.Lock; ++ Last_Lock := Last_Lock + 1; ++ L := Last_Lock; ++ TSL.Unlock; ++ ++ if L > Lock_Table'Last then ++ raise Lock_Error; ++ end if; ++ ++ Lock_Table (L) := ++ OSI.CreateMutex (null, Win32.FALSE, ICS.New_String (Name)); ++ Lock := L; ++ end Create_Lock; ++ ++ ------------------ ++ -- Acquire_Lock -- ++ ------------------ ++ ++ procedure Acquire_Lock (Lock : in out Lock_Type) is ++ use type Win32.DWORD; ++ ++ Res : Win32.DWORD; ++ ++ begin ++ Res := OSI.WaitForSingleObject (Lock_Table (Lock), OSI.Wait_Infinite); ++ ++ if Res = OSI.WAIT_FAILED then ++ raise Lock_Error; ++ end if; ++ end Acquire_Lock; ++ ++ ------------------ ++ -- Release_Lock -- ++ ------------------ ++ ++ procedure Release_Lock (Lock : in out Lock_Type) is ++ use type Win32.BOOL; ++ ++ Res : Win32.BOOL; ++ ++ begin ++ Res := OSI.ReleaseMutex (Lock_Table (Lock)); ++ ++ if Res = Win32.FALSE then ++ raise Lock_Error; ++ end if; ++ end Release_Lock; ++ ++end System.Global_Locks; +--- origsrc/gcc-4.7.2/gcc/ada//s-osinte-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//s-osinte-cygwin.ads 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,951 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2010, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- . -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is a GNU/Linux (GNU/LinuxThreads) version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by children of System. ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Interfaces.C; ++with Interfaces.C.Strings; ++with Ada.Unchecked_Conversion; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ subtype int is Interfaces.C.int; ++ subtype char is Interfaces.C.char; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function errno return int; ++ pragma Import (C, errno, "__get_errno"); ++ ++ EAGAIN : constant := 11; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ EPERM : constant := 1; ++ ETIMEDOUT : constant := 110; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 63; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 7; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGUSR1 : constant := 10; -- user defined signal 1 ++ SIGUSR2 : constant := 12; -- user defined signal 2 ++ SIGCLD : constant := 17; -- alias for SIGCHLD ++ SIGCHLD : constant := 17; -- child status change ++ SIGPWR : constant := 30; -- power-fail restart ++ SIGWINCH : constant := 28; -- window size change ++ SIGURG : constant := 23; -- urgent condition on IO channel ++ SIGPOLL : constant := 29; -- pollable event occurred ++ SIGIO : constant := 29; -- I/O now possible (4.2 BSD) ++ SIGLOST : constant := 29; -- File lock lost ++ SIGSTOP : constant := 19; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 20; -- user stop requested from tty ++ SIGCONT : constant := 18; -- stopped process has been continued ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGUNUSED : constant := 31; -- unused signal (GNU/Linux) ++ SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux) ++ SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal ++ SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal ++ SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ Unmasked : constant Signal_Set := ( ++ SIGTRAP, ++ -- To enable debugging on multithreaded applications, mark SIGTRAP to ++ -- be kept unmasked. ++ ++ SIGBUS, ++ ++ SIGTTIN, SIGTTOU, SIGTSTP, ++ -- Keep these three signals unmasked so that background processes ++ -- and IO behaves as normal "C" applications ++ ++ SIGPROF, ++ -- To avoid confusing the profiler ++ ++ SIGKILL, SIGSTOP, ++ -- These two signals actually cannot be masked; ++ -- POSIX simply won't allow it. ++ ++ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG); ++ -- These three signals are used by GNU/LinuxThreads starting from ++ -- glibc 2.1 (future 2.2). ++ ++ Reserved : constant Signal_Set := ++ -- I am not sure why the following two signals are reserved. ++ -- I guess they are not supported by this version of GNU/Linux. ++ (SIGVTALRM, SIGUNUSED); ++ ++ type sigset_t is private; ++ ++ function sigaddset (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ type union_type_3 is new String (1 .. 116); ++ type siginfo_t is record ++ si_signo : int; ++ si_code : int; ++ si_errno : int; ++ X_data : union_type_3; ++ end record; ++ pragma Convention (C, siginfo_t); ++ ++ type struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : unsigned_long; ++ sa_restorer : System.Address; ++ end record; ++ pragma Convention (C, struct_sigaction); ++ ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ type Machine_State is record ++ eip : unsigned_long; ++ ebx : unsigned_long; ++ esp : unsigned_long; ++ ebp : unsigned_long; ++ esi : unsigned_long; ++ edi : unsigned_long; ++ end record; ++ type Machine_State_Ptr is access all Machine_State; ++ ++ SA_SIGINFO : constant := 16#04#; ++ ++ SIG_BLOCK : constant := 0; ++ SIG_UNBLOCK : constant := 1; ++ SIG_SETMASK : constant := 2; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ type timespec is private; ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timeval is private; ++ ++ function To_Duration (TV : struct_timeval) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timeval (D : Duration) return struct_timeval; ++ pragma Inline (To_Timeval); ++ ++ function gettimeofday ++ (tv : access struct_timeval; ++ tz : System.Address := System.Null_Address) return int; ++ pragma Import (C, gettimeofday, "gettimeofday"); ++ ++ function sysconf (name : int) return long; ++ pragma Import (C, sysconf); ++ ++ SC_CLK_TCK : constant := 2; ++ SC_NPROCESSORS_ONLN : constant := 84; ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_OTHER : constant := 0; ++ SCHED_FIFO : constant := 1; ++ SCHED_RR : constant := 2; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is new unsigned_long; ++ subtype Thread_Id is pthread_t; ++ ++ function To_pthread_t is ++ new Ada.Unchecked_Conversion (unsigned_long, pthread_t); ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- This is a dummy procedure to share some GNULLI files ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ procedure pthread_init; ++ pragma Inline (pthread_init); ++ -- This is a dummy procedure to share some GNULLI files ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait (set : access sigset_t; sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill (thread : pthread_t; sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ type struct_sched_param is record ++ sched_priority : int; -- scheduling priority ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import ++ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "sched_yield"); ++ ++ --------------------------- ++ -- P1003.1c - Section 16 -- ++ --------------------------- ++ ++ function pthread_attr_init ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ CPU_SETSIZE : constant := 1_024; ++ ++ type bit_field is array (1 .. CPU_SETSIZE) of Boolean; ++ for bit_field'Size use CPU_SETSIZE; ++ pragma Pack (bit_field); ++ pragma Convention (C, bit_field); ++ ++ type cpu_set_t is record ++ bits : bit_field; ++ end record; ++ pragma Convention (C, cpu_set_t); ++ ++ function pthread_setaffinity_np ++ (thread : pthread_t; ++ cpusetsize : size_t; ++ cpuset : access cpu_set_t) return int; ++ pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np"); ++ ++ ------------------- ++ -- Win32 compat -- ++ ------------------- ++ ++ ------------------- ++ -- General Types -- ++ ------------------- ++ ++ type DWORD is new Interfaces.C.unsigned_long; ++ type WORD is new Interfaces.C.unsigned_short; ++ ++ -- The LARGE_INTEGER type is actually a fixed point type ++ -- that only can represent integers. The reason for this is ++ -- easier conversion to Duration or other fixed point types. ++ -- (See Operations.Clock) ++ ++ type LARGE_INTEGER is delta 1.0 range -2.0**63 .. 2.0**63 - 1.0; ++ ++ subtype PSZ is Interfaces.C.Strings.chars_ptr; ++ subtype PCHAR is Interfaces.C.Strings.chars_ptr; ++ ++ subtype PVOID is System.Address; ++ ++ Null_Void : constant PVOID := System.Null_Address; ++ ++ type PLONG is access all Interfaces.C.long; ++ type PDWORD is access all DWORD; ++ ++ type BOOL is new Boolean; ++ for BOOL'Size use Interfaces.C.unsigned_long'Size; ++ ++ ------------------------- ++ -- Handles for objects -- ++ ------------------------- ++ ++ type HANDLE is new Interfaces.C.long; ++ type PHANDLE is access all HANDLE; ++ ++ subtype Win32_Thread_Id is HANDLE; ++ ++ ------------------------ ++ -- System Information -- ++ ------------------------ ++ ++ type SYSTEM_INFO is record ++ dwOemId : DWORD; ++ dwPageSize : DWORD; ++ lpMinimumApplicationAddress : PVOID; ++ lpMaximumApplicationAddress : PVOID; ++ dwActiveProcessorMask : DWORD; ++ dwNumberOfProcessors : DWORD; ++ dwProcessorType : DWORD; ++ dwAllocationGranularity : DWORD; ++ dwReserved : DWORD; ++ end record; ++ ++ procedure GetSystemInfo (SI : access SYSTEM_INFO); ++ pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo"); ++ ++ --------------------- ++ -- Time Management -- ++ --------------------- ++ ++ procedure Sleep (dwMilliseconds : DWORD); ++ pragma Import (Stdcall, Sleep, External_Name => "Sleep"); ++ ++ type SYSTEMTIME is record ++ wYear : WORD; ++ wMonth : WORD; ++ wDayOfWeek : WORD; ++ wDay : WORD; ++ wHour : WORD; ++ wMinute : WORD; ++ wSecond : WORD; ++ wMilliseconds : WORD; ++ end record; ++ ++ procedure GetSystemTime (pSystemTime : access SYSTEMTIME); ++ pragma Import (Stdcall, GetSystemTime, "GetSystemTime"); ++ ++ procedure GetSystemTimeAsFileTime (lpFileTime : access Long_Long_Integer); ++ pragma Import (Stdcall, GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime"); ++ ++ function SetSystemTime (pSystemTime : access SYSTEMTIME) return BOOL; ++ pragma Import (Stdcall, SetSystemTime, "SetSystemTime"); ++ ++ function FileTimeToSystemTime ++ (lpFileTime : access Long_Long_Integer; ++ lpSystemTime : access SYSTEMTIME) return BOOL; ++ pragma Import (Stdcall, FileTimeToSystemTime, "FileTimeToSystemTime"); ++ ++ function SystemTimeToFileTime ++ (lpSystemTime : access SYSTEMTIME; ++ lpFileTime : access Long_Long_Integer) return BOOL; ++ pragma Import (Stdcall, SystemTimeToFileTime, "SystemTimeToFileTime"); ++ ++ function FileTimeToLocalFileTime ++ (lpFileTime : access Long_Long_Integer; ++ lpLocalFileTime : access Long_Long_Integer) return BOOL; ++ pragma Import (Stdcall, FileTimeToLocalFileTime, "FileTimeToLocalFileTime"); ++ ++ function LocalFileTimeToFileTime ++ (lpFileTime : access Long_Long_Integer; ++ lpLocalFileTime : access Long_Long_Integer) return BOOL; ++ pragma Import (Stdcall, LocalFileTimeToFileTime, "LocalFileTimeToFileTime"); ++ ++ function QueryPerformanceCounter ++ (lpPerformanceCount : access LARGE_INTEGER) return BOOL; ++ pragma Import ++ (Stdcall, QueryPerformanceCounter, "QueryPerformanceCounter"); ++ ++ function QueryPerformanceFrequency ++ (lpFrequency : access LARGE_INTEGER) return BOOL; ++ pragma Import ++ (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++-- type Win32_Thread_Body is access ++-- function (arg : System.Address) return System.Address; ++-- pragma Convention (C, Thread_Body); ++ ++-- function Win32_Thread_Body_Access is new ++-- Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ procedure SwitchToThread; ++ pragma Import (Stdcall, SwitchToThread, "SwitchToThread"); ++ ++ function GetThreadTimes ++ (hThread : HANDLE; ++ lpCreationTime : access Long_Long_Integer; ++ lpExitTime : access Long_Long_Integer; ++ lpKernelTime : access Long_Long_Integer; ++ lpUserTime : access Long_Long_Integer) return BOOL; ++ pragma Import (Stdcall, GetThreadTimes, "GetThreadTimes"); ++ ++ ----------------------- ++ -- Critical sections -- ++ ----------------------- ++ ++ type CRITICAL_SECTION is private; ++ ++ procedure InitializeCriticalSection ++ (pCriticalSection : access CRITICAL_SECTION); ++ pragma Import ++ (Stdcall, InitializeCriticalSection, "InitializeCriticalSection"); ++ ++ procedure EnterCriticalSection ++ (pCriticalSection : access CRITICAL_SECTION); ++ pragma Import (Stdcall, EnterCriticalSection, "EnterCriticalSection"); ++ ++ procedure LeaveCriticalSection ++ (pCriticalSection : access CRITICAL_SECTION); ++ pragma Import (Stdcall, LeaveCriticalSection, "LeaveCriticalSection"); ++ ++ procedure DeleteCriticalSection ++ (pCriticalSection : access CRITICAL_SECTION); ++ pragma Import (Stdcall, DeleteCriticalSection, "DeleteCriticalSection"); ++ ++ ------------------------------------------------------------- ++ -- Thread Creation, Activation, Suspension And Termination -- ++ ------------------------------------------------------------- ++ ++ subtype ProcessorId is DWORD; ++ ++ type PTHREAD_START_ROUTINE is access function ++ (pThreadParameter : PVOID) return DWORD; ++ pragma Convention (Stdcall, PTHREAD_START_ROUTINE); ++ ++ function To_PTHREAD_START_ROUTINE is new ++ Ada.Unchecked_Conversion (System.Address, PTHREAD_START_ROUTINE); ++ ++ type SECURITY_ATTRIBUTES is record ++ nLength : DWORD; ++ pSecurityDescriptor : PVOID; ++ bInheritHandle : BOOL; ++ end record; ++ ++ type PSECURITY_ATTRIBUTES is access all SECURITY_ATTRIBUTES; ++ ++ function CreateThread ++ (pThreadAttributes : PSECURITY_ATTRIBUTES; ++ dwStackSize : DWORD; ++ pStartAddress : PTHREAD_START_ROUTINE; ++ pParameter : PVOID; ++ dwCreationFlags : DWORD; ++ pThreadId : PDWORD) return HANDLE; ++ pragma Import (Stdcall, CreateThread, "CreateThread"); ++ ++ function BeginThreadEx ++ (pThreadAttributes : PSECURITY_ATTRIBUTES; ++ dwStackSize : DWORD; ++ pStartAddress : PTHREAD_START_ROUTINE; ++ pParameter : PVOID; ++ dwCreationFlags : DWORD; ++ pThreadId : PDWORD) return HANDLE; ++ pragma Import (C, BeginThreadEx, "_beginthreadex"); ++ ++ Debug_Process : constant := 16#00000001#; ++ Debug_Only_This_Process : constant := 16#00000002#; ++ Create_Suspended : constant := 16#00000004#; ++ Detached_Process : constant := 16#00000008#; ++ Create_New_Console : constant := 16#00000010#; ++ ++ Create_New_Process_Group : constant := 16#00000200#; ++ ++ Create_No_window : constant := 16#08000000#; ++ ++ Profile_User : constant := 16#10000000#; ++ Profile_Kernel : constant := 16#20000000#; ++ Profile_Server : constant := 16#40000000#; ++ ++ Stack_Size_Param_Is_A_Reservation : constant := 16#00010000#; ++ ++ function GetExitCodeThread ++ (hThread : HANDLE; ++ pExitCode : PDWORD) return BOOL; ++ pragma Import (Stdcall, GetExitCodeThread, "GetExitCodeThread"); ++ ++ function ResumeThread (hThread : HANDLE) return DWORD; ++ pragma Import (Stdcall, ResumeThread, "ResumeThread"); ++ ++ function SuspendThread (hThread : HANDLE) return DWORD; ++ pragma Import (Stdcall, SuspendThread, "SuspendThread"); ++ ++ procedure ExitThread (dwExitCode : DWORD); ++ pragma Import (Stdcall, ExitThread, "ExitThread"); ++ ++ procedure EndThreadEx (dwExitCode : DWORD); ++ pragma Import (C, EndThreadEx, "_endthreadex"); ++ ++ function TerminateThread ++ (hThread : HANDLE; ++ dwExitCode : DWORD) return BOOL; ++ pragma Import (Stdcall, TerminateThread, "TerminateThread"); ++ ++ function GetCurrentThread return HANDLE; ++ pragma Import (Stdcall, GetCurrentThread, "GetCurrentThread"); ++ ++ function GetCurrentProcess return HANDLE; ++ pragma Import (Stdcall, GetCurrentProcess, "GetCurrentProcess"); ++ ++ function GetCurrentThreadId return DWORD; ++ pragma Import (Stdcall, GetCurrentThreadId, "GetCurrentThreadId"); ++ ++ function TlsAlloc return DWORD; ++ pragma Import (Stdcall, TlsAlloc, "TlsAlloc"); ++ ++ function TlsGetValue (dwTlsIndex : DWORD) return PVOID; ++ pragma Import (Stdcall, TlsGetValue, "TlsGetValue"); ++ ++ function TlsSetValue (dwTlsIndex : DWORD; pTlsValue : PVOID) return BOOL; ++ pragma Import (Stdcall, TlsSetValue, "TlsSetValue"); ++ ++ function TlsFree (dwTlsIndex : DWORD) return BOOL; ++ pragma Import (Stdcall, TlsFree, "TlsFree"); ++ ++ TLS_Nothing : constant := DWORD'Last; ++ ++ procedure ExitProcess (uExitCode : Interfaces.C.unsigned); ++ pragma Import (Stdcall, ExitProcess, "ExitProcess"); ++ ++ function WaitForSingleObject ++ (hHandle : HANDLE; ++ dwMilliseconds : DWORD) return DWORD; ++ pragma Import (Stdcall, WaitForSingleObject, "WaitForSingleObject"); ++ ++ function WaitForSingleObjectEx ++ (hHandle : HANDLE; ++ dwMilliseconds : DWORD; ++ fAlertable : BOOL) return DWORD; ++ pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx"); ++ ++ function SetThreadIdealProcessor ++ (hThread : HANDLE; ++ dwIdealProcessor : ProcessorId) return DWORD; ++ pragma Import (Stdcall, SetThreadIdealProcessor, "SetThreadIdealProcessor"); ++ ++ Wait_Infinite : constant := DWORD'Last; ++ WAIT_TIMEOUT : constant := 16#0000_0102#; ++ WAIT_FAILED : constant := 16#FFFF_FFFF#; ++ ++ ------------------------------------ ++ -- Semaphores, Events and Mutexes -- ++ ------------------------------------ ++ ++ function CloseHandle (hObject : HANDLE) return BOOL; ++ pragma Import (Stdcall, CloseHandle, "CloseHandle"); ++ ++ function CreateSemaphore ++ (pSemaphoreAttributes : PSECURITY_ATTRIBUTES; ++ lInitialCount : Interfaces.C.long; ++ lMaximumCount : Interfaces.C.long; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, CreateSemaphore, "CreateSemaphoreA"); ++ ++ function OpenSemaphore ++ (dwDesiredAccess : DWORD; ++ bInheritHandle : BOOL; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, OpenSemaphore, "OpenSemaphoreA"); ++ ++ function ReleaseSemaphore ++ (hSemaphore : HANDLE; ++ lReleaseCount : Interfaces.C.long; ++ pPreviousCount : PLONG) return BOOL; ++ pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore"); ++ ++ function CreateEvent ++ (pEventAttributes : PSECURITY_ATTRIBUTES; ++ bManualReset : BOOL; ++ bInitialState : BOOL; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, CreateEvent, "CreateEventA"); ++ ++ function OpenEvent ++ (dwDesiredAccess : DWORD; ++ bInheritHandle : BOOL; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, OpenEvent, "OpenEventA"); ++ ++ function SetEvent (hEvent : HANDLE) return BOOL; ++ pragma Import (Stdcall, SetEvent, "SetEvent"); ++ ++ function ResetEvent (hEvent : HANDLE) return BOOL; ++ pragma Import (Stdcall, ResetEvent, "ResetEvent"); ++ ++ function PulseEvent (hEvent : HANDLE) return BOOL; ++ pragma Import (Stdcall, PulseEvent, "PulseEvent"); ++ ++ function CreateMutex ++ (pMutexAttributes : PSECURITY_ATTRIBUTES; ++ bInitialOwner : BOOL; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, CreateMutex, "CreateMutexA"); ++ ++ function OpenMutex ++ (dwDesiredAccess : DWORD; ++ bInheritHandle : BOOL; ++ pName : PSZ) return HANDLE; ++ pragma Import (Stdcall, OpenMutex, "OpenMutexA"); ++ ++ function ReleaseMutex (hMutex : HANDLE) return BOOL; ++ pragma Import (Stdcall, ReleaseMutex, "ReleaseMutex"); ++ ++ --------------------------------------------------- ++ -- Accessing properties of Threads and Processes -- ++ --------------------------------------------------- ++ ++ ----------------- ++ -- Priorities -- ++ ----------------- ++ ++ function SetThreadPriority ++ (hThread : HANDLE; ++ nPriority : Interfaces.C.int) return BOOL; ++ pragma Import (Stdcall, SetThreadPriority, "SetThreadPriority"); ++ ++ function GetThreadPriority (hThread : HANDLE) return Interfaces.C.int; ++ pragma Import (Stdcall, GetThreadPriority, "GetThreadPriority"); ++ ++ function SetPriorityClass ++ (hProcess : HANDLE; ++ dwPriorityClass : DWORD) return BOOL; ++ pragma Import (Stdcall, SetPriorityClass, "SetPriorityClass"); ++ ++ procedure SetThreadPriorityBoost ++ (hThread : HANDLE; ++ DisablePriorityBoost : BOOL); ++ pragma Import (Stdcall, SetThreadPriorityBoost, "SetThreadPriorityBoost"); ++ ++ Normal_Priority_Class : constant := 16#00000020#; ++ Idle_Priority_Class : constant := 16#00000040#; ++ High_Priority_Class : constant := 16#00000080#; ++ Realtime_Priority_Class : constant := 16#00000100#; ++ ++ Thread_Priority_Idle : constant := -15; ++ Thread_Priority_Lowest : constant := -2; ++ Thread_Priority_Below_Normal : constant := -1; ++ Thread_Priority_Normal : constant := 0; ++ Thread_Priority_Above_Normal : constant := 1; ++ Thread_Priority_Highest : constant := 2; ++ Thread_Priority_Time_Critical : constant := 15; ++ Thread_Priority_Error_Return : constant := Interfaces.C.long'Last; ++ ++ function GetLastError return DWORD; ++ pragma Import (Stdcall, GetLastError, "GetLastError"); ++ ++private ++ ++ type sigset_t is array (0 .. 127) of unsigned_char; ++ pragma Convention (C, sigset_t); ++ for sigset_t'Alignment use unsigned_long'Alignment; ++ ++ type pid_t is new int; ++ ++ type time_t is new long; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type struct_timeval is record ++ tv_sec : time_t; ++ tv_usec : time_t; ++ end record; ++ pragma Convention (C, struct_timeval); ++ ++ type pthread_attr_t is record ++ detachstate : int; ++ schedpolicy : int; ++ schedparam : struct_sched_param; ++ inheritsched : int; ++ scope : int; ++ guardsize : size_t; ++ stackaddr_set : int; ++ stackaddr : System.Address; ++ stacksize : size_t; ++ end record; ++ pragma Convention (C, pthread_attr_t); ++ ++ type pthread_condattr_t is record ++ dummy : int; ++ end record; ++ pragma Convention (C, pthread_condattr_t); ++ ++ type pthread_mutexattr_t is record ++ mutexkind : int; ++ end record; ++ pragma Convention (C, pthread_mutexattr_t); ++ ++ type struct_pthread_fast_lock is record ++ status : long; ++ spinlock : int; ++ end record; ++ pragma Convention (C, struct_pthread_fast_lock); ++ ++ type pthread_mutex_t is record ++ m_reserved : int; ++ m_count : int; ++ m_owner : System.Address; ++ m_kind : int; ++ m_lock : struct_pthread_fast_lock; ++ end record; ++ pragma Convention (C, pthread_mutex_t); ++ ++ type pthread_cond_t is array (0 .. 47) of unsigned_char; ++ pragma Convention (C, pthread_cond_t); ++ ++ type pthread_key_t is new unsigned; ++ ++ ------------------- ++ -- Win32 private -- ++ ------------------- ++ ++ type CRITICAL_SECTION is record ++ DebugInfo : System.Address; ++ -- The following three fields control entering and ++ -- exiting the critical section for the resource ++ LockCount : Long_Integer; ++ RecursionCount : Long_Integer; ++ OwningThread : HANDLE; ++ LockSemaphore : HANDLE; ++ Reserved : DWORD; ++ end record; ++ ++end System.OS_Interface; +--- origsrc/gcc-4.7.2/gcc/ada//s-taprop-cygwin.adb 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//s-taprop-cygwin.adb 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,1337 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- . -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is a GNU/Linux (GNU/LinuxThreads) version of this package ++ ++-- This package contains all the GNULL primitives that interface directly ++-- with the underlying OS. ++ ++pragma Polling (Off); ++-- Turn off polling, we do not want ATC polling to take place during ++-- tasking operations. It causes infinite loops and other problems. ++ ++with Interfaces.C; ++-- used for int ++-- size_t ++ ++with System.Task_Info; ++-- used for Unspecified_Task_Info ++ ++with System.Tasking.Debug; ++-- used for Known_Tasks ++ ++with System.Interrupt_Management; ++-- used for Keep_Unmasked ++-- Abort_Task_Interrupt ++-- Interrupt_ID ++ ++with System.OS_Primitives; ++-- used for Delay_Modes ++ ++with System.Soft_Links; ++-- used for Abort_Defer/Undefer ++ ++-- We use System.Soft_Links instead of System.Tasking.Initialization ++-- because the later is a higher level package that we shouldn't depend on. ++-- For example when using the restricted run time, it is replaced by ++-- System.Tasking.Restricted.Stages. ++ ++with System.Storage_Elements; ++with System.Stack_Checking.Operations; ++-- Used for Invalidate_Stack_Cache and Notify_Stack_Attributes; ++ ++with Ada.Exceptions; ++-- used for Raise_Exception ++-- Raise_From_Signal_Handler ++-- Exception_Id ++ ++with Ada.Unchecked_Conversion; ++with Ada.Unchecked_Deallocation; ++ ++package body System.Task_Primitives.Operations is ++ ++ package SSL renames System.Soft_Links; ++ package SC renames System.Stack_Checking.Operations; ++ ++ use System.Tasking.Debug; ++ use System.Tasking; ++ use Interfaces.C; ++ use System.OS_Interface; ++ use System.Parameters; ++ use System.OS_Primitives; ++ use System.Storage_Elements; ++ use System.Task_Info; ++ ++ ---------------- ++ -- Local Data -- ++ ---------------- ++ ++ -- The followings are logically constants, but need to be initialized ++ -- at run time. ++ ++ Single_RTS_Lock : aliased RTS_Lock; ++ -- This is a lock to allow only one thread of control in the RTS at ++ -- a time; it is used to execute in mutual exclusion from all other tasks. ++ -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List ++ ++ ATCB_Key : aliased pthread_key_t; ++ -- Key used to find the Ada Task_Id associated with a thread ++ ++ Environment_Task_Id : Task_Id; ++ -- A variable to hold Task_Id for the environment task ++ ++ Unblocked_Signal_Mask : aliased sigset_t; ++ -- The set of signals that should be unblocked in all tasks ++ ++ -- The followings are internal configuration constants needed ++ ++ Next_Serial_Number : Task_Serial_Number := 100; ++ -- We start at 100 (reserve some special values for using in error checks) ++ ++ Time_Slice_Val : Integer; ++ pragma Import (C, Time_Slice_Val, "__gl_time_slice_val"); ++ ++ Dispatching_Policy : Character; ++ pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy"); ++ ++ -- The following are effectively constants, but they need to be initialized ++ -- by calling a pthread_ function. ++ ++ Mutex_Attr : aliased pthread_mutexattr_t; ++ Cond_Attr : aliased pthread_condattr_t; ++ ++ Foreign_Task_Elaborated : aliased Boolean := True; ++ -- Used to identified fake tasks (i.e., non-Ada Threads) ++ ++ -------------------- ++ -- Local Packages -- ++ -------------------- ++ ++ package Specific is ++ ++ procedure Initialize (Environment_Task : Task_Id); ++ pragma Inline (Initialize); ++ -- Initialize various data needed by this package ++ ++ function Is_Valid_Task return Boolean; ++ pragma Inline (Is_Valid_Task); ++ -- Does executing thread have a TCB? ++ ++ procedure Set (Self_Id : Task_Id); ++ pragma Inline (Set); ++ -- Set the self id for the current task ++ ++ function Self return Task_Id; ++ pragma Inline (Self); ++ -- Return a pointer to the Ada Task Control Block of the calling task ++ ++ end Specific; ++ ++ package body Specific is separate; ++ -- The body of this package is target specific ++ ++ --------------------------------- ++ -- Support for foreign threads -- ++ --------------------------------- ++ ++ function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id; ++ -- Allocate and Initialize a new ATCB for the current Thread ++ ++ function Register_Foreign_Thread ++ (Thread : Thread_Id) return Task_Id is separate; ++ ++ ----------------------- ++ -- Local Subprograms -- ++ ----------------------- ++ ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ ++ procedure Abort_Handler (signo : Signal); ++ ++ function To_pthread_t is new Ada.Unchecked_Conversion ++ (unsigned_long, System.OS_Interface.pthread_t); ++ ++ procedure Get_Stack_Attributes ++ (T : Task_Id; ++ ISP : out System.Address; ++ Size : out Storage_Offset); ++ -- Fill ISP and Size with the Initial Stack Pointer value and the ++ -- thread stack size for task T. ++ ++ ------------------- ++ -- Abort_Handler -- ++ ------------------- ++ ++ procedure Abort_Handler (signo : Signal) is ++ pragma Unreferenced (signo); ++ ++ Self_Id : constant Task_Id := Self; ++ Result : Interfaces.C.int; ++ Old_Set : aliased sigset_t; ++ ++ begin ++ if ZCX_By_Default and then GCC_ZCX_Support then ++ return; ++ end if; ++ ++ if Self_Id.Deferral_Level = 0 ++ and then Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level ++ and then not Self_Id.Aborting ++ then ++ Self_Id.Aborting := True; ++ ++ -- Make sure signals used for RTS internal purpose are unmasked ++ ++ Result := ++ pthread_sigmask ++ (SIG_UNBLOCK, ++ Unblocked_Signal_Mask'Access, ++ Old_Set'Access); ++ pragma Assert (Result = 0); ++ ++ raise Standard'Abort_Signal; ++ end if; ++ end Abort_Handler; ++ ++ -------------- ++ -- Lock_RTS -- ++ -------------- ++ ++ procedure Lock_RTS is ++ begin ++ Write_Lock (Single_RTS_Lock'Access, Global_Lock => True); ++ end Lock_RTS; ++ ++ ---------------- ++ -- Unlock_RTS -- ++ ---------------- ++ ++ procedure Unlock_RTS is ++ begin ++ Unlock (Single_RTS_Lock'Access, Global_Lock => True); ++ end Unlock_RTS; ++ ++ ----------------- ++ -- Stack_Guard -- ++ ----------------- ++ ++ -- The underlying thread system extends the memory (up to 2MB) when needed ++ ++ procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is ++ pragma Unreferenced (T); ++ pragma Unreferenced (On); ++ begin ++ null; ++ end Stack_Guard; ++ ++ -------------------- ++ -- Get_Thread_Id -- ++ -------------------- ++ ++ function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is ++ begin ++ return T.Common.LL.Thread; ++ end Get_Thread_Id; ++ ++ ---------- ++ -- Self -- ++ ---------- ++ ++ function Self return Task_Id renames Specific.Self; ++ ++ --------------------- ++ -- Initialize_Lock -- ++ --------------------- ++ ++ -- Note: mutexes and cond_variables needed per-task basis are ++ -- initialized in Initialize_TCB and the Storage_Error is ++ -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...) ++ -- used in RTS is initialized before any status change of RTS. ++ -- Therefore rasing Storage_Error in the following routines ++ -- should be able to be handled safely. ++ ++ procedure Initialize_Lock ++ (Prio : System.Any_Priority; ++ L : not null access Lock) ++ is ++ pragma Unreferenced (Prio); ++ ++ Result : Interfaces.C.int; ++ ++ begin ++ Result := pthread_mutex_init (L, Mutex_Attr'Access); ++ ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result = ENOMEM then ++ Ada.Exceptions.Raise_Exception (Storage_Error'Identity, ++ "Failed to allocate a lock"); ++ end if; ++ end Initialize_Lock; ++ ++ procedure Initialize_Lock ++ (L : not null access RTS_Lock; ++ Level : Lock_Level) ++ is ++ pragma Unreferenced (Level); ++ ++ Result : Interfaces.C.int; ++ ++ begin ++ Result := pthread_mutex_init (L, Mutex_Attr'Access); ++ ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result = ENOMEM then ++ raise Storage_Error; ++ end if; ++ end Initialize_Lock; ++ ++ ------------------- ++ -- Finalize_Lock -- ++ ------------------- ++ ++ procedure Finalize_Lock (L : not null access Lock) is ++ Result : Interfaces.C.int; ++ begin ++ Result := pthread_mutex_destroy (L); ++ pragma Assert (Result = 0); ++ end Finalize_Lock; ++ ++ procedure Finalize_Lock (L : not null access RTS_Lock) is ++ Result : Interfaces.C.int; ++ begin ++ Result := pthread_mutex_destroy (L); ++ pragma Assert (Result = 0); ++ end Finalize_Lock; ++ ++ ---------------- ++ -- Write_Lock -- ++ ---------------- ++ ++ procedure Write_Lock ++ (L : not null access Lock; ++ Ceiling_Violation : out Boolean) ++ is ++ Result : Interfaces.C.int; ++ begin ++ Result := pthread_mutex_lock (L); ++ Ceiling_Violation := Result = EINVAL; ++ ++ -- Assume the cause of EINVAL is a priority ceiling violation ++ ++ pragma Assert (Result = 0 or else Result = EINVAL); ++ end Write_Lock; ++ ++ procedure Write_Lock ++ (L : not null access RTS_Lock; ++ Global_Lock : Boolean := False) ++ is ++ Result : Interfaces.C.int; ++ begin ++ if not Single_Lock or else Global_Lock then ++ Result := pthread_mutex_lock (L); ++ pragma Assert (Result = 0); ++ end if; ++ end Write_Lock; ++ ++ procedure Write_Lock (T : Task_Id) is ++ Result : Interfaces.C.int; ++ begin ++ if not Single_Lock then ++ Result := pthread_mutex_lock (T.Common.LL.L'Access); ++ pragma Assert (Result = 0); ++ end if; ++ end Write_Lock; ++ ++ --------------- ++ -- Read_Lock -- ++ --------------- ++ ++ procedure Read_Lock ++ (L : not null access Lock; ++ Ceiling_Violation : out Boolean) ++ is ++ begin ++ Write_Lock (L, Ceiling_Violation); ++ end Read_Lock; ++ ++ ------------ ++ -- Unlock -- ++ ------------ ++ ++ procedure Unlock (L : not null access Lock) is ++ Result : Interfaces.C.int; ++ begin ++ Result := pthread_mutex_unlock (L); ++ pragma Assert (Result = 0); ++ end Unlock; ++ ++ procedure Unlock ++ (L : not null access RTS_Lock; ++ Global_Lock : Boolean := False) ++ is ++ Result : Interfaces.C.int; ++ begin ++ if not Single_Lock or else Global_Lock then ++ Result := pthread_mutex_unlock (L); ++ pragma Assert (Result = 0); ++ end if; ++ end Unlock; ++ ++ procedure Unlock (T : Task_Id) is ++ Result : Interfaces.C.int; ++ begin ++ if not Single_Lock then ++ Result := pthread_mutex_unlock (T.Common.LL.L'Access); ++ pragma Assert (Result = 0); ++ end if; ++ end Unlock; ++ ++ ----------------- ++ -- Set_Ceiling -- ++ ----------------- ++ ++ -- Dynamic priority ceilings are not supported by the underlying system ++ ++ procedure Set_Ceiling ++ (L : not null access Lock; ++ Prio : System.Any_Priority) ++ is ++ pragma Unreferenced (L, Prio); ++ begin ++ null; ++ end Set_Ceiling; ++ ++ ----------- ++ -- Sleep -- ++ ----------- ++ ++ procedure Sleep ++ (Self_ID : Task_Id; ++ Reason : System.Tasking.Task_States) ++ is ++ pragma Unreferenced (Reason); ++ ++ Result : Interfaces.C.int; ++ ++ begin ++ pragma Assert (Self_ID = Self); ++ ++ if Single_Lock then ++ Result := ++ pthread_cond_wait ++ (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access); ++ else ++ Result := ++ pthread_cond_wait ++ (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access); ++ end if; ++ ++ -- EINTR is not considered a failure ++ ++ pragma Assert (Result = 0 or else Result = EINTR); ++ end Sleep; ++ ++ ----------------- ++ -- Timed_Sleep -- ++ ----------------- ++ ++ -- This is for use within the run-time system, so abort is ++ -- assumed to be already deferred, and the caller should be ++ -- holding its own ATCB lock. ++ ++ procedure Timed_Sleep ++ (Self_ID : Task_Id; ++ Time : Duration; ++ Mode : ST.Delay_Modes; ++ Reason : System.Tasking.Task_States; ++ Timedout : out Boolean; ++ Yielded : out Boolean) ++ is ++ pragma Unreferenced (Reason); ++ ++ Base_Time : constant Duration := Monotonic_Clock; ++ Check_Time : Duration := Base_Time; ++ Abs_Time : Duration; ++ Request : aliased timespec; ++ Result : Interfaces.C.int; ++ ++ begin ++ Timedout := True; ++ Yielded := False; ++ ++ if Mode = Relative then ++ Abs_Time := Duration'Min (Time, Max_Sensible_Delay) + Check_Time; ++ else ++ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); ++ end if; ++ ++ if Abs_Time > Check_Time then ++ Request := To_Timespec (Abs_Time); ++ ++ loop ++ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; ++ ++ if Single_Lock then ++ Result := ++ pthread_cond_timedwait ++ (Self_ID.Common.LL.CV'Access, ++ Single_RTS_Lock'Access, ++ Request'Access); ++ ++ else ++ Result := ++ pthread_cond_timedwait ++ (Self_ID.Common.LL.CV'Access, ++ Self_ID.Common.LL.L'Access, ++ Request'Access); ++ end if; ++ ++ Check_Time := Monotonic_Clock; ++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; ++ ++ if Result = 0 or else Result = EINTR then ++ ++ -- Somebody may have called Wakeup for us ++ ++ Timedout := False; ++ exit; ++ end if; ++ ++ pragma Assert (Result = ETIMEDOUT); ++ end loop; ++ end if; ++ end Timed_Sleep; ++ ++ ----------------- ++ -- Timed_Delay -- ++ ----------------- ++ ++ -- This is for use in implementing delay statements, so we assume the ++ -- caller is abort-deferred but is holding no locks. ++ ++ procedure Timed_Delay ++ (Self_ID : Task_Id; ++ Time : Duration; ++ Mode : ST.Delay_Modes) ++ is ++ Base_Time : constant Duration := Monotonic_Clock; ++ Check_Time : Duration := Base_Time; ++ Abs_Time : Duration; ++ Request : aliased timespec; ++ ++ Result : Interfaces.C.int; ++ pragma Warnings (Off, Result); ++ ++ begin ++ if Single_Lock then ++ Lock_RTS; ++ end if; ++ ++ Write_Lock (Self_ID); ++ ++ if Mode = Relative then ++ Abs_Time := Time + Check_Time; ++ else ++ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); ++ end if; ++ ++ if Abs_Time > Check_Time then ++ Request := To_Timespec (Abs_Time); ++ Self_ID.Common.State := Delay_Sleep; ++ ++ loop ++ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; ++ ++ if Single_Lock then ++ Result := pthread_cond_timedwait ++ (Self_ID.Common.LL.CV'Access, ++ Single_RTS_Lock'Access, ++ Request'Access); ++ else ++ Result := pthread_cond_timedwait ++ (Self_ID.Common.LL.CV'Access, ++ Self_ID.Common.LL.L'Access, ++ Request'Access); ++ end if; ++ ++ Check_Time := Monotonic_Clock; ++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; ++ ++ pragma Assert (Result = 0 or else ++ Result = ETIMEDOUT or else ++ Result = EINTR); ++ end loop; ++ ++ Self_ID.Common.State := Runnable; ++ end if; ++ ++ Unlock (Self_ID); ++ ++ if Single_Lock then ++ Unlock_RTS; ++ end if; ++ ++ Result := sched_yield; ++ end Timed_Delay; ++ ++ --------------------- ++ -- Monotonic_Clock -- ++ --------------------- ++ ++ function Monotonic_Clock return Duration is ++ TV : aliased struct_timeval; ++ Result : Interfaces.C.int; ++ begin ++ Result := gettimeofday (TV'Access, System.Null_Address); ++ pragma Assert (Result = 0); ++ return To_Duration (TV); ++ end Monotonic_Clock; ++ ++ ------------------- ++ -- RT_Resolution -- ++ ------------------- ++ ++ function RT_Resolution return Duration is ++ begin ++ return 10#1.0#E-6; ++ end RT_Resolution; ++ ++ ------------ ++ -- Wakeup -- ++ ------------ ++ ++ procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is ++ pragma Unreferenced (Reason); ++ Result : Interfaces.C.int; ++ begin ++ Result := pthread_cond_signal (T.Common.LL.CV'Access); ++ pragma Assert (Result = 0); ++ end Wakeup; ++ ++ ----------- ++ -- Yield -- ++ ----------- ++ ++ procedure Yield (Do_Yield : Boolean := True) is ++ Result : Interfaces.C.int; ++ pragma Unreferenced (Result); ++ begin ++ if Do_Yield then ++ Result := sched_yield; ++ end if; ++ end Yield; ++ ++ ------------------ ++ -- Set_Priority -- ++ ------------------ ++ ++ procedure Set_Priority ++ (T : Task_Id; ++ Prio : System.Any_Priority; ++ Loss_Of_Inheritance : Boolean := False) ++ is ++ pragma Unreferenced (Loss_Of_Inheritance); ++ ++ Result : Interfaces.C.int; ++ Param : aliased struct_sched_param; ++ ++ function Get_Policy (Prio : System.Any_Priority) return Character; ++ pragma Import (C, Get_Policy, "__gnat_get_specific_dispatching"); ++ -- Get priority specific dispatching policy ++ ++ Priority_Specific_Policy : constant Character := Get_Policy (Prio); ++ -- Upper case first character of the policy name corresponding to the ++ -- task as set by a Priority_Specific_Dispatching pragma. ++ ++ begin ++ T.Common.Current_Priority := Prio; ++ ++ -- Priorities on Cygwin follow Win32 standards, we use the ++ -- MinGW conversion table. ++ ++ Param.sched_priority := Interfaces.C.int (Underlying_Priorities (Prio)); ++ ++ if Dispatching_Policy = 'R' ++ or else Priority_Specific_Policy = 'R' ++ or else Time_Slice_Val > 0 ++ then ++ Result := ++ pthread_setschedparam ++ (T.Common.LL.Thread, SCHED_RR, Param'Access); ++ ++ elsif Dispatching_Policy = 'F' ++ or else Priority_Specific_Policy = 'F' ++ or else Time_Slice_Val = 0 ++ then ++ Result := ++ pthread_setschedparam ++ (T.Common.LL.Thread, SCHED_FIFO, Param'Access); ++ ++ else ++ Param.sched_priority := 0; ++ Result := ++ pthread_setschedparam ++ (T.Common.LL.Thread, ++ SCHED_OTHER, Param'Access); ++ end if; ++ ++ pragma Assert (Result = 0 or else Result = EPERM); ++ end Set_Priority; ++ ++ ------------------ ++ -- Get_Priority -- ++ ------------------ ++ ++ function Get_Priority (T : Task_Id) return System.Any_Priority is ++ begin ++ return T.Common.Current_Priority; ++ end Get_Priority; ++ ++ -------------------------- ++ -- Get_Stack_Attributes -- ++ -------------------------- ++ ++ procedure Get_Stack_Attributes ++ (T : Task_Id; ++ ISP : out System.Address; ++ Size : out Storage_Offset) ++ is ++ function pthread_getattr_np ++ (thread : pthread_t; ++ attr : System.Address) return Interfaces.C.int; ++ pragma Import (C, pthread_getattr_np, "pthread_getattr_np"); ++ ++ function pthread_attr_getstack ++ (attr : System.Address; ++ base : System.Address; ++ size : System.Address) return Interfaces.C.int; ++ pragma Import (C, pthread_attr_getstack, "pthread_attr_getstack"); ++ ++ Result : Interfaces.C.int; ++ ++ Attributes : aliased pthread_attr_t; ++ Stack_Base : aliased System.Address; ++ Stack_Size : aliased Storage_Offset; ++ ++ begin ++ Result := ++ pthread_getattr_np ++ (T.Common.LL.Thread, Attributes'Address); ++ pragma Assert (Result = 0); ++ ++ Result := ++ pthread_attr_getstack ++ (Attributes'Address, Stack_Base'Address, Stack_Size'Address); ++ pragma Assert (Result = 0); ++ ++ Result := pthread_attr_destroy (Attributes'Access); ++ pragma Assert (Result = 0); ++ ++ ISP := Stack_Base + Stack_Size; ++ Size := Stack_Size; ++ end Get_Stack_Attributes; ++ ++ ---------------- ++ -- Enter_Task -- ++ ---------------- ++ ++ procedure Enter_Task (Self_ID : Task_Id) is ++ begin ++ if Self_ID.Common.Task_Info /= null ++ and then ++ Self_ID.Common.Task_Info.CPU_Affinity = No_CPU ++ then ++ raise Invalid_CPU_Number; ++ end if; ++ ++ Self_ID.Common.LL.Thread := pthread_self; ++ ++ Specific.Set (Self_ID); ++ ++ Lock_RTS; ++ ++ for J in Known_Tasks'Range loop ++ if Known_Tasks (J) = null then ++ Known_Tasks (J) := Self_ID; ++ Self_ID.Known_Tasks_Index := J; ++ exit; ++ end if; ++ end loop; ++ ++ Unlock_RTS; ++ ++ -- Determine where the task stack starts, how large it is, and let the ++ -- stack checking engine know about it. ++ ++ declare ++ Initial_SP : System.Address; ++ Stack_Size : Storage_Offset; ++ begin ++ Get_Stack_Attributes (Self_ID, Initial_SP, Stack_Size); ++ System.Stack_Checking.Operations.Notify_Stack_Attributes ++ (Initial_SP, Stack_Size); ++ end; ++ end Enter_Task; ++ ++ -------------- ++ -- New_ATCB -- ++ -------------- ++ ++ function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is ++ begin ++ return new Ada_Task_Control_Block (Entry_Num); ++ end New_ATCB; ++ ++ ------------------- ++ -- Is_Valid_Task -- ++ ------------------- ++ ++ function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task; ++ ++ ----------------------------- ++ -- Register_Foreign_Thread -- ++ ----------------------------- ++ ++ function Register_Foreign_Thread return Task_Id is ++ begin ++ if Is_Valid_Task then ++ return Self; ++ else ++ return Register_Foreign_Thread (pthread_self); ++ end if; ++ end Register_Foreign_Thread; ++ ++ -------------------- ++ -- Initialize_TCB -- ++ -------------------- ++ ++ procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is ++ Result : Interfaces.C.int; ++ ++ begin ++ -- Give the task a unique serial number ++ ++ Self_ID.Serial_Number := Next_Serial_Number; ++ Next_Serial_Number := Next_Serial_Number + 1; ++ pragma Assert (Next_Serial_Number /= 0); ++ ++ Self_ID.Common.LL.Thread := To_pthread_t (-1); ++ ++ if not Single_Lock then ++ Result := pthread_mutex_init (Self_ID.Common.LL.L'Access, ++ Mutex_Attr'Access); ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result /= 0 then ++ Succeeded := False; ++ return; ++ end if; ++ end if; ++ ++ Result := pthread_cond_init (Self_ID.Common.LL.CV'Access, ++ Cond_Attr'Access); ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result = 0 then ++ Succeeded := True; ++ else ++ if not Single_Lock then ++ Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access); ++ pragma Assert (Result = 0); ++ end if; ++ ++ Succeeded := False; ++ end if; ++ end Initialize_TCB; ++ ++ ----------------- ++ -- Create_Task -- ++ ----------------- ++ ++ procedure Create_Task ++ (T : Task_Id; ++ Wrapper : System.Address; ++ Stack_Size : System.Parameters.Size_Type; ++ Priority : System.Any_Priority; ++ Succeeded : out Boolean) ++ is ++ Attributes : aliased pthread_attr_t; ++ Result : Interfaces.C.int; ++ ++ begin ++ Result := pthread_attr_init (Attributes'Access); ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result /= 0 then ++ Succeeded := False; ++ return; ++ end if; ++ ++ Result := ++ pthread_attr_setstacksize ++ (Attributes'Access, Interfaces.C.size_t (Stack_Size)); ++ pragma Assert (Result = 0); ++ ++ Result := ++ pthread_attr_setdetachstate ++ (Attributes'Access, PTHREAD_CREATE_DETACHED); ++ pragma Assert (Result = 0); ++ ++ -- Since the initial signal mask of a thread is inherited from the ++ -- creator, and the Environment task has all its signals masked, we ++ -- do not need to manipulate caller's signal mask at this point. ++ -- All tasks in RTS will have All_Tasks_Mask initially. ++ ++ Result := pthread_create ++ (T.Common.LL.Thread'Access, ++ Attributes'Access, ++ Thread_Body_Access (Wrapper), ++ To_Address (T)); ++ pragma Assert (Result = 0 or else Result = EAGAIN); ++ ++ Succeeded := Result = 0; ++ ++ -- Handle Task_Info ++ ++ if T.Common.Task_Info /= null then ++ if T.Common.Task_Info.CPU_Affinity /= Task_Info.Any_CPU then ++ Result := ++ pthread_setaffinity_np ++ (T.Common.LL.Thread, ++ CPU_SETSIZE / 8, ++ T.Common.Task_Info.CPU_Affinity'Access); ++ pragma Assert (Result = 0); ++ end if; ++ end if; ++ ++ Result := pthread_attr_destroy (Attributes'Access); ++ pragma Assert (Result = 0); ++ ++ Set_Priority (T, Priority); ++ end Create_Task; ++ ++ ------------------ ++ -- Finalize_TCB -- ++ ------------------ ++ ++ procedure Finalize_TCB (T : Task_Id) is ++ Result : Interfaces.C.int; ++ Tmp : Task_Id := T; ++ Is_Self : constant Boolean := T = Self; ++ ++ procedure Free is new ++ Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); ++ ++ begin ++ if not Single_Lock then ++ Result := pthread_mutex_destroy (T.Common.LL.L'Access); ++ pragma Assert (Result = 0); ++ end if; ++ ++ Result := pthread_cond_destroy (T.Common.LL.CV'Access); ++ pragma Assert (Result = 0); ++ ++ if T.Known_Tasks_Index /= -1 then ++ Known_Tasks (T.Known_Tasks_Index) := null; ++ end if; ++ SC.Invalidate_Stack_Cache (T.Common.Compiler_Data.Pri_Stack_Info'Access); ++ Free (Tmp); ++ ++ if Is_Self then ++ Specific.Set (null); ++ end if; ++ end Finalize_TCB; ++ ++ --------------- ++ -- Exit_Task -- ++ --------------- ++ ++ procedure Exit_Task is ++ begin ++ Specific.Set (null); ++ end Exit_Task; ++ ++ ---------------- ++ -- Abort_Task -- ++ ---------------- ++ ++ procedure Abort_Task (T : Task_Id) is ++ Result : Interfaces.C.int; ++ begin ++ Result := ++ pthread_kill ++ (T.Common.LL.Thread, ++ Signal (System.Interrupt_Management.Abort_Task_Interrupt)); ++ pragma Assert (Result = 0); ++ end Abort_Task; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize (S : in out Suspension_Object) is ++ Result : Interfaces.C.int; ++ ++ begin ++ -- Initialize internal state (always to False (RM D.10(6))) ++ ++ S.State := False; ++ S.Waiting := False; ++ ++ -- Initialize internal mutex ++ ++ Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access); ++ ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result = ENOMEM then ++ raise Storage_Error; ++ end if; ++ ++ -- Initialize internal condition variable ++ ++ Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access); ++ ++ pragma Assert (Result = 0 or else Result = ENOMEM); ++ ++ if Result /= 0 then ++ Result := pthread_mutex_destroy (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ if Result = ENOMEM then ++ raise Storage_Error; ++ end if; ++ end if; ++ end Initialize; ++ ++ -------------- ++ -- Finalize -- ++ -------------- ++ ++ procedure Finalize (S : in out Suspension_Object) is ++ Result : Interfaces.C.int; ++ ++ begin ++ -- Destroy internal mutex ++ ++ Result := pthread_mutex_destroy (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ -- Destroy internal condition variable ++ ++ Result := pthread_cond_destroy (S.CV'Access); ++ pragma Assert (Result = 0); ++ end Finalize; ++ ++ ------------------- ++ -- Current_State -- ++ ------------------- ++ ++ function Current_State (S : Suspension_Object) return Boolean is ++ begin ++ -- We do not want to use lock on this read operation. State is marked ++ -- as Atomic so that we ensure that the value retrieved is correct. ++ ++ return S.State; ++ end Current_State; ++ ++ --------------- ++ -- Set_False -- ++ --------------- ++ ++ procedure Set_False (S : in out Suspension_Object) is ++ Result : Interfaces.C.int; ++ ++ begin ++ SSL.Abort_Defer.all; ++ ++ Result := pthread_mutex_lock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ S.State := False; ++ ++ Result := pthread_mutex_unlock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ SSL.Abort_Undefer.all; ++ end Set_False; ++ ++ -------------- ++ -- Set_True -- ++ -------------- ++ ++ procedure Set_True (S : in out Suspension_Object) is ++ Result : Interfaces.C.int; ++ ++ begin ++ SSL.Abort_Defer.all; ++ ++ Result := pthread_mutex_lock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ -- If there is already a task waiting on this suspension object then ++ -- we resume it, leaving the state of the suspension object to False, ++ -- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves ++ -- the state to True. ++ ++ if S.Waiting then ++ S.Waiting := False; ++ S.State := False; ++ ++ Result := pthread_cond_signal (S.CV'Access); ++ pragma Assert (Result = 0); ++ ++ else ++ S.State := True; ++ end if; ++ ++ Result := pthread_mutex_unlock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ SSL.Abort_Undefer.all; ++ end Set_True; ++ ++ ------------------------ ++ -- Suspend_Until_True -- ++ ------------------------ ++ ++ procedure Suspend_Until_True (S : in out Suspension_Object) is ++ Result : Interfaces.C.int; ++ ++ begin ++ SSL.Abort_Defer.all; ++ ++ Result := pthread_mutex_lock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ if S.Waiting then ++ ++ -- Program_Error must be raised upon calling Suspend_Until_True ++ -- if another task is already waiting on that suspension object ++ -- (RM D.10(10)). ++ ++ Result := pthread_mutex_unlock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ SSL.Abort_Undefer.all; ++ ++ raise Program_Error; ++ else ++ -- Suspend the task if the state is False. Otherwise, the task ++ -- continues its execution, and the state of the suspension object ++ -- is set to False (ARM D.10 par. 9). ++ ++ if S.State then ++ S.State := False; ++ else ++ S.Waiting := True; ++ Result := pthread_cond_wait (S.CV'Access, S.L'Access); ++ end if; ++ ++ Result := pthread_mutex_unlock (S.L'Access); ++ pragma Assert (Result = 0); ++ ++ SSL.Abort_Undefer.all; ++ end ++ if; ++ end Suspend_Until_True; ++ ++ ---------------- ++ -- Check_Exit -- ++ ---------------- ++ ++ -- Dummy version ++ ++ function Check_Exit (Self_ID : ST.Task_Id) return Boolean is ++ pragma Unreferenced (Self_ID); ++ begin ++ return True; ++ end Check_Exit; ++ ++ -------------------- ++ -- Check_No_Locks -- ++ -------------------- ++ ++ function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is ++ pragma Unreferenced (Self_ID); ++ begin ++ return True; ++ end Check_No_Locks; ++ ++ ---------------------- ++ -- Environment_Task -- ++ ---------------------- ++ ++ function Environment_Task return Task_Id is ++ begin ++ return Environment_Task_Id; ++ end Environment_Task; ++ ++ ------------------ ++ -- Suspend_Task -- ++ ------------------ ++ ++ function Suspend_Task ++ (T : ST.Task_Id; ++ Thread_Self : Thread_Id) return Boolean ++ is ++ begin ++ if T.Common.LL.Thread /= Thread_Self then ++ return pthread_kill (T.Common.LL.Thread, SIGSTOP) = 0; ++ else ++ return True; ++ end if; ++ end Suspend_Task; ++ ++ ----------------- ++ -- Resume_Task -- ++ ----------------- ++ ++ function Resume_Task ++ (T : ST.Task_Id; ++ Thread_Self : Thread_Id) return Boolean ++ is ++ begin ++ if T.Common.LL.Thread /= Thread_Self then ++ return pthread_kill (T.Common.LL.Thread, SIGCONT) = 0; ++ else ++ return True; ++ end if; ++ end Resume_Task; ++ ++ -------------------- ++ -- Stop_All_Tasks -- ++ -------------------- ++ ++ procedure Stop_All_Tasks is ++ begin ++ null; ++ end Stop_All_Tasks; ++ ++ --------------- ++ -- Stop_Task -- ++ --------------- ++ ++ function Stop_Task (T : ST.Task_Id) return Boolean is ++ pragma Unreferenced (T); ++ begin ++ return False; ++ end Stop_Task; ++ ++ ------------------- ++ -- Continue_Task -- ++ ------------------- ++ ++ function Continue_Task (T : ST.Task_Id) return Boolean is ++ pragma Unreferenced (T); ++ begin ++ return False; ++ end Continue_Task; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize (Environment_Task : Task_Id) is ++ act : aliased struct_sigaction; ++ old_act : aliased struct_sigaction; ++ Tmp_Set : aliased sigset_t; ++ Result : Interfaces.C.int; ++ ++ function State ++ (Int : System.Interrupt_Management.Interrupt_ID) return Character; ++ pragma Import (C, State, "__gnat_get_interrupt_state"); ++ -- Get interrupt state. Defined in a-init.c ++ -- The input argument is the interrupt number, ++ -- and the result is one of the following: ++ ++ Default : constant Character := 's'; ++ -- 'n' this interrupt not set by any Interrupt_State pragma ++ -- 'u' Interrupt_State pragma set state to User ++ -- 'r' Interrupt_State pragma set state to Runtime ++ -- 's' Interrupt_State pragma set state to System (use "default" ++ -- system handler) ++ ++ begin ++ Environment_Task_Id := Environment_Task; ++ ++ Interrupt_Management.Initialize; ++ ++ -- Prepare the set of signals that should be unblocked in all tasks ++ ++ Result := sigemptyset (Unblocked_Signal_Mask'Access); ++ pragma Assert (Result = 0); ++ ++ for J in Interrupt_Management.Interrupt_ID loop ++ if System.Interrupt_Management.Keep_Unmasked (J) then ++ Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J)); ++ pragma Assert (Result = 0); ++ end if; ++ end loop; ++ ++ Result := pthread_mutexattr_init (Mutex_Attr'Access); ++ pragma Assert (Result = 0); ++ ++ Result := pthread_condattr_init (Cond_Attr'Access); ++ pragma Assert (Result = 0); ++ ++ Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level); ++ ++ -- Initialize the global RTS lock ++ ++ Specific.Initialize (Environment_Task); ++ ++ Enter_Task (Environment_Task); ++ ++ -- Install the abort-signal handler ++ ++ if State ++ (System.Interrupt_Management.Abort_Task_Interrupt) /= Default ++ then ++ act.sa_flags := 0; ++ act.sa_handler := Abort_Handler'Address; ++ ++ Result := sigemptyset (Tmp_Set'Access); ++ pragma Assert (Result = 0); ++ act.sa_mask := Tmp_Set; ++ ++ Result := ++ sigaction ++ (Signal (Interrupt_Management.Abort_Task_Interrupt), ++ act'Unchecked_Access, ++ old_act'Unchecked_Access); ++ pragma Assert (Result = 0); ++ end if; ++ end Initialize; ++ ++end System.Task_Primitives.Operations; +--- origsrc/gcc-4.7.2/gcc/ada//sysdep.c 2012-11-02 15:16:50.062500000 +0000 ++++ src/gcc-4.7.2/gcc/ada//sysdep.c 2012-11-02 15:50:59.968750000 +0000 +@@ -311,7 +311,7 @@ getc_immediate_common (FILE *stream, + { + #if defined (linux) || defined (sun) || defined (sgi) \ + || (defined (__osf__) && ! defined (__alpha_vxworks)) \ +- || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ ++ || defined (__CYGWIN__) || defined (__MACHTEN__) || defined (__hpux__) \ + || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ + || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ + || defined (__GLIBC__) || defined (__APPLE__) +@@ -592,6 +592,18 @@ rts_get_nShowCmd (void) + } + + #endif /* WINNT */ ++ ++#ifdef __CYGWIN__ ++ ++#include ++ ++size_t _msize(void *memblock) ++{ ++ return (size_t) malloc_usable_size (memblock); ++} ++ ++#endif /* __CYGWIN__ */ ++ + #ifdef VMS + + /* This gets around a problem with using the old threads library on VMS 7.0. */ +--- origsrc/gcc-4.7.2/gcc/ada//system-cygwin.ads 1970-01-01 00:00:00.000000000 +0000 ++++ src/gcc-4.7.2/gcc/ada//system-cygwin.ads 2012-11-01 21:17:31.000000000 +0000 +@@ -0,0 +1,198 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (Cygwin Version) -- ++-- -- ++-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 2, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT 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 distributed with GNAT; see file COPYING. If not, write -- ++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- ++-- Boston, MA 02110-1301, USA. -- ++-- -- ++-- As a special exception, if other files instantiate generics from this -- ++-- unit, or you link this unit with other files to produce an executable, -- ++-- this unit does not by itself cause the resulting executable to be -- ++-- covered by the GNU General Public License. This exception does not -- ++-- however invalidate any other reasons why the executable file might be -- ++-- covered by the GNU Public License. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.01; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 32; ++ Memory_Size : constant := 2 ** 32; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := False; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_64_Bit_Divides : constant Boolean := True; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := True; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; ++ ++ --------------------------- ++ -- Underlying Priorities -- ++ --------------------------- ++ ++ -- Important note: this section of the file must come AFTER the ++ -- definition of the system implementation parameters to ensure ++ -- that the value of these parameters is available for analysis ++ -- of the declarations here (using Rtsfind at compile time). ++ ++ -- The underlying priorities table provides a generalized mechanism ++ -- for mapping from Ada priorities to system priorities. In some ++ -- cases a 1-1 mapping is not the convenient or optimal choice. ++ ++ type Priorities_Mapping is array (Any_Priority) of Integer; ++ pragma Suppress_Initialization (Priorities_Mapping); ++ -- Suppress initialization in case gnat.adc specifies Normalize_Scalars ++ ++ Underlying_Priorities : constant Priorities_Mapping := ++ (Priority'First .. ++ Default_Priority - 8 => -15, ++ Default_Priority - 7 => -7, ++ Default_Priority - 6 => -6, ++ Default_Priority - 5 => -5, ++ Default_Priority - 4 => -4, ++ Default_Priority - 3 => -3, ++ Default_Priority - 2 => -2, ++ Default_Priority - 1 => -1, ++ Default_Priority => 0, ++ Default_Priority + 1 => 1, ++ Default_Priority + 2 => 2, ++ Default_Priority + 3 => 3, ++ Default_Priority + 4 => 4, ++ Default_Priority + 5 => 5, ++ Default_Priority + 6 .. ++ Priority'Last => 6, ++ Interrupt_Priority => 15); ++ -- The default mapping preserves the standard 31 priorities of the Ada ++ -- model, but maps them using compression onto the 7 priority levels ++ -- available in NT and on the 16 priority levels available in 2000/XP. ++ ++ -- To replace the default values of the Underlying_Priorities mapping, ++ -- copy this source file into your build directory, edit the file to ++ -- reflect your desired behavior, and recompile using Makefile.adalib ++ -- which can be found under the adalib directory of your gnat installation ++ ++ pragma Linker_Options ("-Wl,--stack=0x2000000"); ++ -- This is used to change the default stack (32 MB) size for non tasking ++ -- programs. We change this value for GNAT on Windows here because the ++ -- binutils on this platform have switched to a too low value for Ada ++ -- programs. Note that we also set the stack size for tasking programs in ++ -- System.Task_Primitives.Operations. ++ ++end System; diff --git a/gcc47-boehm-gc-cygwin.patch b/gcc47-boehm-gc-cygwin.patch new file mode 100644 index 0000000..49f9ee0 --- /dev/null +++ b/gcc47-boehm-gc-cygwin.patch @@ -0,0 +1,57 @@ +--- origsrc/gcc-4.7.2/boehm-gc/win32_threads.c 2009-05-17 21:07:18.000000000 +0100 ++++ src/gcc-4.7.2/boehm-gc/win32_threads.c 2013-03-31 19:34:57.203125000 +0100 +@@ -707,6 +707,54 @@ void * GC_start_routine(void * arg) + return(result); + } + ++void GC_register_my_thread() ++{ ++ GC_thread me; ++ pthread_t my_pthread; ++ ++ my_pthread = pthread_self(); ++# if DEBUG_CYGWIN_THREADS ++ GC_printf1("Attaching thread 0x%lx\n", my_pthread); ++ GC_printf1("pid = %ld\n", (long) getpid()); ++# endif ++ ++ /* Check to ensure this thread isn't attached already. */ ++ LOCK(); ++ me = GC_lookup_thread (my_pthread); ++ UNLOCK(); ++ if (me != 0) ++ { ++# if DEBUG_CYGWIN_THREADS ++ GC_printf1("Attempt to re-attach known thread 0x%lx\n", my_pthread); ++# endif ++ return; ++ } ++ ++ LOCK(); ++ me = GC_new_thread(); ++ me -> flags |= DETACHED; ++ me -> pthread_id = pthread_self(); ++ UNLOCK(); ++} ++ ++void GC_unregister_my_thread() ++{ ++ pthread_t my_pthread; ++ GC_thread me; ++ ++ my_pthread = pthread_self(); ++ ++# if DEBUG_CYGWIN_THREADS ++ GC_printf1("Detaching thread 0x%lx\n", my_pthread); ++# endif ++ ++ LOCK(); ++ me = GC_lookup_thread(my_pthread); ++ UNLOCK(); ++ GC_thread_exit_proc ((void *)me); ++} ++ ++ + void GC_thread_exit_proc(void *arg) + { + GC_thread me = (GC_thread)arg; diff --git a/gcc47-cross-ecjx.patch b/gcc47-cross-ecjx.patch new file mode 100644 index 0000000..16179d1 --- /dev/null +++ b/gcc47-cross-ecjx.patch @@ -0,0 +1,52 @@ +--- a/libjava/configure.ac 2013-06-27 23:25:19.370920178 -0500 ++++ b/libjava/configure.ac 2013-06-27 23:25:44.904921607 -0500 +@@ -414,8 +414,8 @@ if test -n "${with_cross_host}"; then + # use ac_exeext, because that is for the target platform. + NATIVE=no + cross_host_exeext= +- GCJ_FOR_ECJX="${with_cross_host}-gcj" +- GCC_FOR_ECJX="${with_cross_host}-gcc" ++ GCJ_FOR_ECJX="gcj" ++ GCC_FOR_ECJX="gcc" + case "${with_cross_host}" in + *mingw* | *cygwin*) + cross_host_exeext=.exe +--- a/libjava/configure 2013-06-27 23:25:22.521920354 -0500 ++++ b/libjava/configure 2013-06-27 23:25:57.828922331 -0500 +@@ -6726,8 +6726,8 @@ if test -n "${with_cross_host}"; then + # use ac_exeext, because that is for the target platform. + NATIVE=no + cross_host_exeext= +- GCJ_FOR_ECJX="${with_cross_host}-gcj" +- GCC_FOR_ECJX="${with_cross_host}-gcc" ++ GCJ_FOR_ECJX="gcj" ++ GCC_FOR_ECJX="gcc" + case "${with_cross_host}" in + *mingw* | *cygwin*) + cross_host_exeext=.exe +--- a/libjava/Makefile.am 2011-08-05 09:37:48.000000000 -0500 ++++ b/libjava/Makefile.am 2012-06-12 02:57:16.508693300 -0500 +@@ -1167,7 +1167,11 @@ endif + else !NATIVE + + ecjx_LINK = $(GCJ_FOR_ECJX_LINK) $(ecjx_LDFLAGS) ++if INSTALL_ECJ_JAR + ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) ++else ++ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) ++endif + ecjx_LDADD = + ecjx_DEPENDENCIES = + ecjx.$(OBJEXT): ecjx.cc +--- a/libjava/Makefile.in 2012-06-12 03:04:48.185527700 -0500 ++++ b/libjava/Makefile.in 2012-03-22 02:37:39.000000000 -0500 +@@ -8445,7 +8445,8 @@ ECJX_BASE_FLAGS = -findirect-dispatch \ + @NATIVE_TRUE@ecjx_LINK = $(GCJLINK) $(ecjx_LDFLAGS) + @ENABLE_SHARED_FALSE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH) + @ENABLE_SHARED_TRUE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) +-@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) ++@INSTALL_ECJ_JAR_FALSE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR) ++@INSTALL_ECJ_JAR_TRUE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) + @NATIVE_FALSE@ecjx_LDADD = + @NATIVE_TRUE@ecjx_LDADD = -L$(here)/.libs $(extra_ldflags) \ + @NATIVE_TRUE@ $(am__append_28) diff --git a/gcc47-cross-jardir.patch b/gcc47-cross-jardir.patch new file mode 100644 index 0000000..899a273 --- /dev/null +++ b/gcc47-cross-jardir.patch @@ -0,0 +1,22 @@ +--- origsrc/gcc-4.7.0/libjava/Makefile.am 2011-08-05 09:37:48.000000000 -0500 ++++ src/gcc-4.7.0/libjava/Makefile.am 2012-06-12 02:57:16.508693300 -0500 +@@ -223,7 +223,7 @@ dbexec_LTLIBRARIES = libjvm.la + + pkgconfigdir = $(libdir)/pkgconfig + +-jardir = $(datadir)/java ++jardir = $(datadir)/gcc-$(gcc_version)/$(target_noncanonical)/java + jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar + if INSTALL_ECJ_JAR + jar_DATA += $(ECJ_BUILD_JAR) +--- origsrc/gcc-4.7.0/libjava/Makefile.in 2012-06-12 03:04:48.185527700 -0500 ++++ src/gcc-4.7.0/libjava/Makefile.in 2012-03-22 02:37:39.000000000 -0500 +@@ -938,7 +938,7 @@ CORE_PACKAGE_SOURCE_FILES_LO = $(filter- + @BUILD_SUBLIBS_TRUE@LIBJAVA_CORE_EXTRA = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@ + dbexec_LTLIBRARIES = libjvm.la + pkgconfigdir = $(libdir)/pkgconfig +-jardir = $(datadir)/java ++jardir = $(datadir)/gcc-$(gcc_version)/$(target_noncanonical)/java + jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar \ + $(am__append_5) + @JAVA_HOME_SET_FALSE@JAVA_HOME_DIR = $(prefix) diff --git a/gcc47-execstack.patch b/gcc47-execstack.patch new file mode 100644 index 0000000..abfe828 --- /dev/null +++ b/gcc47-execstack.patch @@ -0,0 +1,50 @@ +--- origsrc/gcc-4.7.2/gcc/config/i386//cygming.opt 2011-04-01 15:43:22.000000000 +0100 ++++ src/gcc-4.7.2/gcc/config/i386//cygming.opt 2012-11-01 20:56:56.406250000 +0000 +@@ -50,6 +50,10 @@ muse-libstdc-wrappers + Target Condition({defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)}) + Compile code that relies on Cygwin DLL wrappers to support C++ operator new/delete replacement + ++fset-stack-executable ++Common Report Var(flag_setstackexecutable) Init(1) Optimization ++For nested functions on stack executable permission is set. ++ + posix + Driver + +--- origsrc/gcc-4.7.2/gcc/config/i386//cygwin.h 2012-11-01 20:55:58.250000000 +0000 ++++ src/gcc-4.7.2/gcc/config/i386//cygwin.h 2012-11-01 20:11:22.000000000 +0000 +@@ -140,3 +140,11 @@ along with GCC; see the file COPYING3. + /* We should find a way to not have to update this manually. */ + #define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-13.dll" + ++/* Make stack executable to avoid DEP problems with trampolines. */ ++#define HAVE_ENABLE_EXECUTE_STACK ++#undef CHECK_EXECUTE_STACK_ENABLED ++#define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable ++ ++#ifdef IN_LIBGCC2 ++#include ++#endif +--- origsrc/gcc-4.7.2/gcc/config/i386//mingw.opt 2011-04-01 15:43:22.000000000 +0100 ++++ src/gcc-4.7.2/gcc/config/i386//mingw.opt 2012-11-01 20:57:00.296875000 +0000 +@@ -28,8 +28,4 @@ Wpedantic-ms-format + C ObjC C++ ObjC++ Var(warn_pedantic_ms_format) Init(1) Warning + Warn about none ISO msvcrt scanf/printf width extensions + +-fset-stack-executable +-Common Report Var(flag_setstackexecutable) Init(1) Optimization +-For nested functions on stack executable permission is set. +- + ; Need to retain blank line above. +--- origsrc/gcc-4.7.2/libgcc//config.host 2012-11-01 20:55:58.234375000 +0000 ++++ src/gcc-4.7.2/libgcc//config.host 2012-11-01 20:11:20.000000000 +0000 +@@ -273,6 +273,9 @@ case ${host} in + i[34567]86-*-mingw* | x86_64-*-mingw*) + enable_execute_stack=config/i386/enable-execute-stack-mingw32.c + ;; ++i[34567]86-*-cygwin* | x86_64-*-cygwin*) ++ enable_execute_stack=config/i386/enable-execute-stack-mingw32.c ++ ;; + *) + enable_execute_stack=enable-execute-stack-empty.c; + ;; diff --git a/gcc47-java-jni.patch b/gcc47-java-jni.patch new file mode 100644 index 0000000..327bd70 --- /dev/null +++ b/gcc47-java-jni.patch @@ -0,0 +1,56 @@ +--- origsrc/gcc-4.5.0/libjava/classpath/configure.ac 2009-02-05 17:26:08.000000000 -0600 ++++ src/gcc-4.5.0/libjava/classpath/configure.ac 2009-12-06 01:58:25.091013300 -0600 +@@ -26,7 +26,7 @@ case "$host_os" in + cp_module="" + ;; + *) +- cp_module="-module" ++ cp_module="-module -avoid-version" + ;; + esac + +--- origsrc/gcc-4.7.2/libjava/classpath/configure 2011-11-29 14:12:00.000000000 -0600 ++++ src/gcc-4.7.2/libjava/classpath/configure 2013-03-01 01:48:05.585762700 -0600 +@@ -3172,7 +3172,7 @@ case "$host_os" in + cp_module="" + ;; + *) +- cp_module="-module" ++ cp_module="-module -avoid-version" + ;; + esac + +--- origsrc/gcc-4.7.2/libjava/include/posix.h 2011-01-03 14:52:22.000000000 -0600 ++++ src/gcc-4.7.2/libjava/include/posix.h 2013-03-06 20:26:16.157459700 -0600 +@@ -47,11 +47,17 @@ details. */ + #include + + // Prefix and suffix for shared libraries. ++#ifdef __CYGWIN__ ++#define _Jv_platform_solib_prefix "cyg" ++#else + #define _Jv_platform_solib_prefix "lib" ++#endif + #if defined(__APPLE__) && defined(__MACH__) + #define _Jv_platform_solib_suffix ".dylib" + #elif defined(HPUX) && defined(HP_PA) + #define _Jv_platform_solib_suffix ".sl" ++#elif defined(__CYGWIN__) ++#define _Jv_platform_solib_suffix ".dll" + #else + #define _Jv_platform_solib_suffix ".so" + #endif +--- origsrc/gcc-4.7.2/libjava/java/net/natVMURLConnection.cc 2009-12-01 16:05:25.000000000 -0600 ++++ src/gcc-4.7.2/libjava/java/net/natVMURLConnection.cc 2013-03-06 20:20:42.202970700 -0600 +@@ -32,7 +32,11 @@ void + java::net::VMURLConnection::init () + { + #if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL) ++#ifdef __CYGWIN__ ++ lt_dlhandle handle = lt_dlopenext ("cygmagic-1.dll"); ++#else + lt_dlhandle handle = lt_dlopenext ("libmagic.so"); ++#endif + if (!handle) + return; + diff --git a/gcc47-libffi-noinst.patch b/gcc47-libffi-noinst.patch new file mode 100644 index 0000000..3ac66ea --- /dev/null +++ b/gcc47-libffi-noinst.patch @@ -0,0 +1,53 @@ +Only the convenience library is used in libjava, and the bundled version +is usually a few releases behind the standalone version. + +--- origsrc/gcc-4.7.2/Makefile.in 2012-08-06 09:34:27.000000000 -0500 ++++ src/gcc-4.7.2/Makefile.in 2013-03-10 21:27:05.825568600 -0500 +@@ -1573,7 +1573,6 @@ install-info-target: maybe-install-info- + install-info-target: maybe-install-info-target-libtermcap + install-info-target: maybe-install-info-target-winsup + install-info-target: maybe-install-info-target-libgloss +-install-info-target: maybe-install-info-target-libffi + install-info-target: maybe-install-info-target-libjava + install-info-target: maybe-install-info-target-zlib + install-info-target: maybe-install-info-target-boehm-gc +@@ -1651,7 +1650,6 @@ install-pdf-target: maybe-install-pdf-ta + install-pdf-target: maybe-install-pdf-target-libtermcap + install-pdf-target: maybe-install-pdf-target-winsup + install-pdf-target: maybe-install-pdf-target-libgloss +-install-pdf-target: maybe-install-pdf-target-libffi + install-pdf-target: maybe-install-pdf-target-libjava + install-pdf-target: maybe-install-pdf-target-zlib + install-pdf-target: maybe-install-pdf-target-boehm-gc +@@ -1729,7 +1727,6 @@ install-html-target: maybe-install-html- + install-html-target: maybe-install-html-target-libtermcap + install-html-target: maybe-install-html-target-winsup + install-html-target: maybe-install-html-target-libgloss +-install-html-target: maybe-install-html-target-libffi + install-html-target: maybe-install-html-target-libjava + install-html-target: maybe-install-html-target-zlib + install-html-target: maybe-install-html-target-boehm-gc +@@ -1807,7 +1804,6 @@ installcheck-target: maybe-installcheck- + installcheck-target: maybe-installcheck-target-libtermcap + installcheck-target: maybe-installcheck-target-winsup + installcheck-target: maybe-installcheck-target-libgloss +-installcheck-target: maybe-installcheck-target-libffi + installcheck-target: maybe-installcheck-target-libjava + installcheck-target: maybe-installcheck-target-zlib + installcheck-target: maybe-installcheck-target-boehm-gc +@@ -2402,7 +2398,6 @@ install-target: \ + maybe-install-target-libtermcap \ + maybe-install-target-winsup \ + maybe-install-target-libgloss \ +- maybe-install-target-libffi \ + maybe-install-target-libjava \ + maybe-install-target-zlib \ + maybe-install-target-boehm-gc \ +@@ -2500,7 +2495,6 @@ install-strip-target: \ + maybe-install-strip-target-libtermcap \ + maybe-install-strip-target-winsup \ + maybe-install-strip-target-libgloss \ +- maybe-install-strip-target-libffi \ + maybe-install-strip-target-libjava \ + maybe-install-strip-target-zlib \ + maybe-install-strip-target-boehm-gc \ diff --git a/gcc47-libstdc.patch b/gcc47-libstdc.patch new file mode 100644 index 0000000..45ff50e --- /dev/null +++ b/gcc47-libstdc.patch @@ -0,0 +1,671 @@ +--- origsrc/gcc-4.7.2/libstdc++-v3/config/os/mingw32/os_defines.h 2011-12-16 18:43:06.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/config/os/mingw32/os_defines.h 2012-10-31 16:49:35.703125000 +0000 +@@ -72,4 +72,10 @@ + #define _GLIBCXX_CDTOR_CALLABI __thiscall + #endif + ++#ifdef _DLL ++#define _GLIBCXX_IMPORT __attribute__((dllimport)) ++#else ++#define _GLIBCXX_IMPORT ++#endif ++ + #endif +--- origsrc/gcc-4.7.2/libstdc++-v3/config/os/newlib/os_defines.h 2011-01-03 20:52:22.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/config/os/newlib/os_defines.h 2012-10-31 16:49:35.734375000 +0000 +@@ -35,6 +35,8 @@ + + #ifdef __CYGWIN__ + #define _GLIBCXX_GTHREAD_USE_WEAK 0 ++#define __GXX_MERGED_TYPEINFO_NAMES 0 ++#define __GXX_TYPEINFO_EQUALITY_INLINE 0 + + #if defined (_GLIBCXX_DLL) + #define _GLIBCXX_PSEUDO_VISIBILITY_default __attribute__ ((__dllimport__)) +@@ -47,6 +49,13 @@ + + // See libstdc++/20806. + #define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1 ++ ++#ifdef _DLL ++#define _GLIBCXX_IMPORT __attribute__((dllimport)) ++#else ++#define _GLIBCXX_IMPORT ++#endif ++ + #endif + + #endif +--- origsrc/gcc-4.7.2/libstdc++-v3/include/backward/strstream 2011-02-01 01:31:42.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/backward/strstream 2012-10-31 16:49:37.468750000 +0000 +@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + // Class strstreambuf, a streambuf class that manages an array of char. + // Note that this class is not a template. +- class strstreambuf : public basic_streambuf > ++ class _GLIBCXX_IMPORT strstreambuf : public basic_streambuf > + { + public: + // Types. +@@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + // Class istrstream, an istream that manages a strstreambuf. +- class istrstream : public basic_istream ++ class _GLIBCXX_IMPORT istrstream : public basic_istream + { + public: + explicit istrstream(char*); +@@ -141,7 +141,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + // Class ostrstream +- class ostrstream : public basic_ostream ++ class _GLIBCXX_IMPORT ostrstream : public basic_ostream + { + public: + ostrstream(); +@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + // Class strstream +- class strstream : public basic_iostream ++ class _GLIBCXX_IMPORT strstream : public basic_iostream + { + public: + typedef char char_type; +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/basic_ios.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/basic_ios.tcc 2012-10-31 16:49:37.468750000 +0000 +@@ -176,10 +176,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_ios; ++ extern template class _GLIBCXX_IMPORT basic_ios; + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_ios; ++ extern template class _GLIBCXX_IMPORT basic_ios; + #endif + #endif + +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/c++config 2011-11-02 04:23:33.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/c++config 2012-10-31 16:54:57.125000000 +0000 +@@ -225,6 +225,9 @@ namespace __gnu_cxx + # define _GLIBCXX_END_NAMESPACE_VERSION + #endif + ++#ifndef _GLIBCXX_IMPORT ++#define _GLIBCXX_IMPORT ++#endif + + // Inline namespaces for special modes: debug, parallel, profile. + #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \ +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/codecvt.h 2011-10-14 01:12:40.000000000 +0100 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/codecvt.h 2012-10-31 16:49:37.484375000 +0000 +@@ -479,7 +479,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class codecvt_byname; ++ extern template class _GLIBCXX_IMPORT codecvt_byname; + + extern template + const codecvt& +@@ -490,7 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + has_facet >(const locale&); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class codecvt_byname; ++ extern template class _GLIBCXX_IMPORT codecvt_byname; + + extern template + const codecvt& +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/fstream.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/fstream.tcc 2012-10-31 16:49:37.484375000 +0000 +@@ -965,16 +965,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_filebuf; +- extern template class basic_ifstream; +- extern template class basic_ofstream; +- extern template class basic_fstream; ++ extern template class _GLIBCXX_IMPORT basic_filebuf; ++ extern template class _GLIBCXX_IMPORT basic_ifstream; ++ extern template class _GLIBCXX_IMPORT basic_ofstream; ++ extern template class _GLIBCXX_IMPORT basic_fstream; + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_filebuf; +- extern template class basic_ifstream; +- extern template class basic_ofstream; +- extern template class basic_fstream; ++ extern template class _GLIBCXX_IMPORT basic_filebuf; ++ extern template class _GLIBCXX_IMPORT basic_ifstream; ++ extern template class _GLIBCXX_IMPORT basic_ofstream; ++ extern template class _GLIBCXX_IMPORT basic_fstream; + #endif + #endif + +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/ios_base.h 2011-08-07 08:27:06.000000000 +0100 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/ios_base.h 2012-10-31 16:49:37.484375000 +0000 +@@ -198,7 +198,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * people will only see @c ios_base when they need to specify the full + * name of the various I/O flags (e.g., the openmodes). + */ +- class ios_base ++ class _GLIBCXX_IMPORT ios_base + { + public: + +@@ -208,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * + * 27.4.2.1.1 Class ios_base::failure + */ +- class failure : public exception ++ class _GLIBCXX_IMPORT failure : public exception + { + public: + // _GLIBCXX_RESOLVE_LIB_DEFECTS +@@ -532,7 +532,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Used to initialize standard streams. In theory, g++ could use + // -finit-priority to order this stuff correctly without going + // through these machinations. +- class Init ++ class _GLIBCXX_IMPORT Init + { + friend class ios_base; + public: +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/istream.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/istream.tcc 2012-10-31 16:49:37.484375000 +0000 +@@ -1039,7 +1039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_istream; ++ extern template class _GLIBCXX_IMPORT basic_istream; + extern template istream& ws(istream&); + extern template istream& operator>>(istream&, char&); + extern template istream& operator>>(istream&, char*); +@@ -1062,10 +1062,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + extern template istream& istream::_M_extract(long double&); + extern template istream& istream::_M_extract(void*&); + +- extern template class basic_iostream; ++ extern template class _GLIBCXX_IMPORT basic_iostream; + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_istream; ++ extern template class _GLIBCXX_IMPORT basic_istream; + extern template wistream& ws(wistream&); + extern template wistream& operator>>(wistream&, wchar_t&); + extern template wistream& operator>>(wistream&, wchar_t*); +@@ -1084,7 +1084,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + extern template wistream& wistream::_M_extract(long double&); + extern template wistream& wistream::_M_extract(void*&); + +- extern template class basic_iostream; ++ extern template class _GLIBCXX_IMPORT basic_iostream; + #endif + #endif + +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.h 2011-12-10 15:33:06.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.h 2012-10-31 16:49:37.484375000 +0000 +@@ -61,7 +61,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * This library supports efficient construction and copying of locales + * through a reference counting implementation of the locale class. + */ +- class locale ++ class _GLIBCXX_IMPORT locale + { + public: + // Types: +@@ -69,9 +69,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + typedef int category; + + // Forward decls and friends: +- class facet; +- class id; +- class _Impl; ++ class _GLIBCXX_IMPORT facet; ++ class _GLIBCXX_IMPORT id; ++ class _GLIBCXX_IMPORT _Impl; + + friend class facet; + friend class _Impl; +@@ -337,7 +337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * + * Facets may not be copied or assigned. + */ +- class locale::facet ++ class _GLIBCXX_IMPORT locale::facet + { + private: + friend class locale; +@@ -435,7 +435,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * cannot be used in a locale. The locale::id ensures that each class + * type gets a unique identifier. + */ +- class locale::id ++ class _GLIBCXX_IMPORT locale::id + { + private: + friend class locale; +@@ -474,7 +474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + + // Implementation object for locale. +- class locale::_Impl ++ class _GLIBCXX_IMPORT locale::_Impl + { + public: + // Friends. +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.tcc 2011-12-10 15:33:06.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.tcc 2012-10-31 16:49:37.500000000 +0000 +@@ -265,8 +265,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class collate; +- extern template class collate_byname; ++ extern template class _GLIBCXX_IMPORT collate; ++ extern template class _GLIBCXX_IMPORT collate_byname; + + extern template + const collate& +@@ -277,8 +277,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + has_facet >(const locale&); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class collate; +- extern template class collate_byname; ++ extern template class _GLIBCXX_IMPORT collate; ++ extern template class _GLIBCXX_IMPORT collate_byname; + + extern template + const collate& +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.h 2012-02-23 22:14:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.h 2012-10-31 16:49:37.500000000 +0000 +@@ -673,7 +673,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * optimizations as well. + */ + template<> +- class ctype : public locale::facet, public ctype_base ++ class _GLIBCXX_IMPORT ctype : public locale::facet, public ctype_base + { + public: + // Types: +@@ -1174,7 +1174,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * __ctype_abstract_base. + */ + template<> +- class ctype : public __ctype_abstract_base ++ class _GLIBCXX_IMPORT ctype : public __ctype_abstract_base + { + public: + // Types: +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.tcc 2012-10-31 17:00:42.531250000 +0000 +@@ -1277,11 +1277,11 @@ _GLIBCXX_END_NAMESPACE_LDBL + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class numpunct; +- extern template class numpunct_byname; +- extern template class _GLIBCXX_NAMESPACE_LDBL num_get; +- extern template class _GLIBCXX_NAMESPACE_LDBL num_put; +- extern template class ctype_byname; ++ extern template class _GLIBCXX_IMPORT numpunct; ++ extern template class _GLIBCXX_IMPORT numpunct_byname; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_get; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_put; ++ extern template class _GLIBCXX_IMPORT ctype_byname; + + extern template + const ctype& +@@ -1316,11 +1316,11 @@ _GLIBCXX_END_NAMESPACE_LDBL + has_facet >(const locale&); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class numpunct; +- extern template class numpunct_byname; +- extern template class _GLIBCXX_NAMESPACE_LDBL num_get; +- extern template class _GLIBCXX_NAMESPACE_LDBL num_put; +- extern template class ctype_byname; ++ extern template class _GLIBCXX_IMPORT numpunct; ++ extern template class _GLIBCXX_IMPORT numpunct_byname; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_get; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_put; ++ extern template class _GLIBCXX_IMPORT ctype_byname; + + extern template + const ctype& +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2012-10-31 17:00:42.546875000 +0000 +@@ -1216,19 +1216,19 @@ _GLIBCXX_END_NAMESPACE_LDBL + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class moneypunct; +- extern template class moneypunct; +- extern template class moneypunct_byname; +- extern template class moneypunct_byname; +- extern template class _GLIBCXX_NAMESPACE_LDBL money_get; +- extern template class _GLIBCXX_NAMESPACE_LDBL money_put; +- extern template class __timepunct; +- extern template class time_put; +- extern template class time_put_byname; +- extern template class time_get; +- extern template class time_get_byname; +- extern template class messages; +- extern template class messages_byname; ++ extern template class _GLIBCXX_IMPORT moneypunct; ++ extern template class _GLIBCXX_IMPORT moneypunct; ++ extern template class _GLIBCXX_IMPORT moneypunct_byname; ++ extern template class _GLIBCXX_IMPORT moneypunct_byname; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_get; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_put; ++ extern template class _GLIBCXX_IMPORT __timepunct; ++ extern template class _GLIBCXX_IMPORT time_put; ++ extern template class _GLIBCXX_IMPORT time_put_byname; ++ extern template class _GLIBCXX_IMPORT time_get; ++ extern template class _GLIBCXX_IMPORT time_get_byname; ++ extern template class _GLIBCXX_IMPORT messages; ++ extern template class _GLIBCXX_IMPORT messages_byname; + + extern template + const moneypunct& +@@ -1291,19 +1291,19 @@ _GLIBCXX_END_NAMESPACE_LDBL + has_facet >(const locale&); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class moneypunct; +- extern template class moneypunct; +- extern template class moneypunct_byname; +- extern template class moneypunct_byname; +- extern template class _GLIBCXX_NAMESPACE_LDBL money_get; +- extern template class _GLIBCXX_NAMESPACE_LDBL money_put; +- extern template class __timepunct; +- extern template class time_put; +- extern template class time_put_byname; +- extern template class time_get; +- extern template class time_get_byname; +- extern template class messages; +- extern template class messages_byname; ++ extern template class _GLIBCXX_IMPORT moneypunct; ++ extern template class _GLIBCXX_IMPORT moneypunct; ++ extern template class _GLIBCXX_IMPORT moneypunct_byname; ++ extern template class _GLIBCXX_IMPORT moneypunct_byname; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_get; ++ extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_put; ++ extern template class _GLIBCXX_IMPORT __timepunct; ++ extern template class _GLIBCXX_IMPORT time_put; ++ extern template class _GLIBCXX_IMPORT time_put_byname; ++ extern template class _GLIBCXX_IMPORT time_get; ++ extern template class _GLIBCXX_IMPORT time_get_byname; ++ extern template class _GLIBCXX_IMPORT messages; ++ extern template class _GLIBCXX_IMPORT messages_byname; + + extern template + const moneypunct& +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/ostream.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/ostream.tcc 2012-10-31 16:49:37.515625000 +0000 +@@ -358,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_ostream; ++ extern template class _GLIBCXX_IMPORT basic_ostream; + extern template ostream& endl(ostream&); + extern template ostream& ends(ostream&); + extern template ostream& flush(ostream&); +@@ -381,7 +381,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + extern template ostream& ostream::_M_insert(const void*); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_ostream; ++ extern template class _GLIBCXX_IMPORT basic_ostream; + extern template wostream& endl(wostream&); + extern template wostream& ends(wostream&); + extern template wostream& flush(wostream&); +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/sstream.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/sstream.tcc 2012-10-31 16:49:37.515625000 +0000 +@@ -271,16 +271,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_stringbuf; +- extern template class basic_istringstream; +- extern template class basic_ostringstream; +- extern template class basic_stringstream; ++ extern template class _GLIBCXX_IMPORT basic_stringbuf; ++ extern template class _GLIBCXX_IMPORT basic_istringstream; ++ extern template class _GLIBCXX_IMPORT basic_ostringstream; ++ extern template class _GLIBCXX_IMPORT basic_stringstream; + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_stringbuf; +- extern template class basic_istringstream; +- extern template class basic_ostringstream; +- extern template class basic_stringstream; ++ extern template class _GLIBCXX_IMPORT basic_stringbuf; ++ extern template class _GLIBCXX_IMPORT basic_istringstream; ++ extern template class _GLIBCXX_IMPORT basic_ostringstream; ++ extern template class _GLIBCXX_IMPORT basic_stringstream; + #endif + #endif + +--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/streambuf.tcc 2011-03-04 21:51:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/bits/streambuf.tcc 2012-10-31 16:49:37.515625000 +0000 +@@ -147,7 +147,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + #if _GLIBCXX_EXTERN_TEMPLATE +- extern template class basic_streambuf; ++ extern template class _GLIBCXX_IMPORT basic_streambuf; + extern template + streamsize + __copy_streambufs(basic_streambuf*, +@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + basic_streambuf*, bool&); + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern template class basic_streambuf; ++ extern template class _GLIBCXX_IMPORT basic_streambuf; + extern template + streamsize + __copy_streambufs(basic_streambuf*, +--- origsrc/gcc-4.7.2/libstdc++-v3/include/ext/concurrence.h 2012-07-16 23:34:13.000000000 +0100 ++++ src/gcc-4.7.2/libstdc++-v3/include/ext/concurrence.h 2012-10-31 16:49:37.515625000 +0000 +@@ -65,7 +65,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + // NB: As this is used in libsupc++, need to only depend on + // exception. No stdexception classes, no use of std::string. +- class __concurrence_lock_error : public std::exception ++ class _GLIBCXX_IMPORT __concurrence_lock_error : public std::exception + { + public: + virtual char const* +@@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + { return "__gnu_cxx::__concurrence_lock_error"; } + }; + +- class __concurrence_unlock_error : public std::exception ++ class _GLIBCXX_IMPORT __concurrence_unlock_error : public std::exception + { + public: + virtual char const* +--- origsrc/gcc-4.7.2/libstdc++-v3/include/std/iostream 2011-01-30 22:39:36.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/std/iostream 2012-10-31 16:53:39.078125000 +0000 +@@ -58,16 +58,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * linked to above. + */ + //@{ +- extern istream cin; /// Linked to standard input +- extern ostream cout; /// Linked to standard output +- extern ostream cerr; /// Linked to standard error (unbuffered) +- extern ostream clog; /// Linked to standard error (buffered) ++ extern _GLIBCXX_IMPORT istream cin; /// Linked to standard input ++ extern _GLIBCXX_IMPORT ostream cout; /// Linked to standard output ++ extern _GLIBCXX_IMPORT ostream cerr; /// Linked to standard error (unbuffered) ++ extern _GLIBCXX_IMPORT ostream clog; /// Linked to standard error (buffered) + + #ifdef _GLIBCXX_USE_WCHAR_T +- extern wistream wcin; /// Linked to standard input +- extern wostream wcout; /// Linked to standard output +- extern wostream wcerr; /// Linked to standard error (unbuffered) +- extern wostream wclog; /// Linked to standard error (buffered) ++ extern _GLIBCXX_IMPORT wistream wcin; /// Linked to standard input ++ extern _GLIBCXX_IMPORT wostream wcout; /// Linked to standard output ++ extern _GLIBCXX_IMPORT wostream wcerr; /// Linked to standard error (unbuffered) ++ extern _GLIBCXX_IMPORT wostream wclog; /// Linked to standard error (buffered) + #endif + //@} + +--- origsrc/gcc-4.7.2/libstdc++-v3/include/std/stdexcept 2011-12-06 20:03:25.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/include/std/stdexcept 2012-10-31 17:02:54.890625000 +0000 +@@ -53,7 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * program runs (e.g., violations of class invariants). + * @brief One of two subclasses of exception. + */ +- class logic_error : public exception ++ class _GLIBCXX_IMPORT logic_error : public exception + { + string _M_msg; + +@@ -72,7 +72,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** Thrown by the library, or by you, to report domain errors (domain in + * the mathematical sense). */ +- class domain_error : public logic_error ++ class _GLIBCXX_IMPORT domain_error : public logic_error + { + public: + explicit domain_error(const string& __arg); +@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + /** Thrown to report invalid arguments to functions. */ +- class invalid_argument : public logic_error ++ class _GLIBCXX_IMPORT invalid_argument : public logic_error + { + public: + explicit invalid_argument(const string& __arg); +@@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** Thrown when an object is constructed that would exceed its maximum + * permitted size (e.g., a basic_string instance). */ +- class length_error : public logic_error ++ class _GLIBCXX_IMPORT length_error : public logic_error + { + public: + explicit length_error(const string& __arg); +@@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** This represents an argument whose value is not within the expected + * range (e.g., boundary checks in basic_string). */ +- class out_of_range : public logic_error ++ class _GLIBCXX_IMPORT out_of_range : public logic_error + { + public: + explicit out_of_range(const string& __arg); +@@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + * the program executes. + * @brief One of two subclasses of exception. + */ +- class runtime_error : public exception ++ class _GLIBCXX_IMPORT runtime_error : public exception + { + string _M_msg; + +@@ -128,7 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + /** Thrown to indicate range errors in internal computations. */ +- class range_error : public runtime_error ++ class _GLIBCXX_IMPORT range_error : public runtime_error + { + public: + explicit range_error(const string& __arg); +@@ -144,7 +144,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + + /** Thrown to indicate arithmetic underflow. */ +- class underflow_error : public runtime_error ++ class _GLIBCXX_IMPORT underflow_error : public runtime_error + { + public: + explicit underflow_error(const string& __arg); +--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/exception 2011-12-07 04:03:25.000000000 +0800 ++++ src/gcc-4.7.2/libstdc++-v3/libsupc++/exception 2013-02-26 19:27:32.575916600 +0800 +@@ -59,7 +59,7 @@ namespace std + * your own %exception classes, or use a different hierarchy, or to + * throw non-class data (e.g., fundamental types). + */ +- class exception ++ class _GLIBCXX_IMPORT exception + { + public: + exception() _GLIBCXX_USE_NOEXCEPT { } +@@ -72,7 +72,7 @@ namespace std + + /** If an %exception is thrown which is not listed in a function's + * %exception specification, one of these may be thrown. */ +- class bad_exception : public exception ++ class _GLIBCXX_IMPORT bad_exception : public exception + { + public: + bad_exception() _GLIBCXX_USE_NOEXCEPT { } +--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/new 2011-10-12 19:40:58.000000000 +0100 ++++ src/gcc-4.7.2/libstdc++-v3/libsupc++/new 2012-10-31 16:49:37.578125000 +0000 +@@ -53,7 +53,7 @@ namespace std + * + * @c bad_alloc (or classes derived from it) is used to report allocation + * errors from the throwing forms of @c new. */ +- class bad_alloc : public exception ++ class _GLIBCXX_IMPORT bad_alloc : public exception + { + public: + bad_alloc() throw() { } +--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/typeinfo 2012-01-27 19:38:56.000000000 +0000 ++++ src/gcc-4.7.2/libstdc++-v3/libsupc++/typeinfo 2012-10-31 17:07:07.796875000 +0000 +@@ -87,7 +87,7 @@ namespace std + * The @c type_info class describes type information generated by + * an implementation. + */ +- class type_info ++ class _GLIBCXX_IMPORT type_info + { + public: + /** Destructor first. Being the first non-inline virtual function, this +@@ -186,7 +186,7 @@ namespace std + * + * If you attempt an invalid @c dynamic_cast expression, an instance of + * this class (or something derived from this class) is thrown. */ +- class bad_cast : public exception ++ class _GLIBCXX_IMPORT bad_cast : public exception + { + public: + bad_cast() _GLIBCXX_USE_NOEXCEPT { } +@@ -203,7 +203,7 @@ namespace std + * @brief Thrown when a NULL pointer in a @c typeid expression is used. + * @ingroup exceptions + */ +- class bad_typeid : public exception ++ class _GLIBCXX_IMPORT bad_typeid : public exception + { + public: + bad_typeid () _GLIBCXX_USE_NOEXCEPT { } +--- origsrc/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp 2012-08-06 22:34:27.000000000 +0800 ++++ src/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp 2013-02-26 19:31:07.934763700 +0800 +@@ -146,6 +146,9 @@ proc libstdc++_init { testfile } { + set gccdir [file dirname $gccdir] + append ld_library_path_tmp ":${gccdir}" + } ++ if { [string match "*-*-cygwin*" $target_triplet] } { ++ append ld_library_path_tmp ":${blddir}/../libgcc" ++ } + v3track gccdir 3 + + # Locate libgomp. This is only required for parallel mode. diff --git a/gcc47-misc-core.patch b/gcc47-misc-core.patch new file mode 100644 index 0000000..0c66eb0 --- /dev/null +++ b/gcc47-misc-core.patch @@ -0,0 +1,27 @@ +--- origsrc/gcc-4.7.2/gcc/cppdefault.c 2012-01-06 08:14:32.000000000 +0800 ++++ src/gcc-4.7.2/gcc/cppdefault.c 2013-02-26 19:32:22.836275000 +0800 +@@ -35,6 +35,8 @@ + # undef NATIVE_SYSTEM_HEADER_DIR + #else + # undef CROSS_INCLUDE_DIR ++# undef CROSS_INCLUDE_DIR_1 ++# undef CROSS_INCLUDE_DIR_2 + #endif + + const struct default_include cpp_include_defaults[] +@@ -84,6 +86,14 @@ const struct default_include cpp_include + /* One place the target system's headers might be. */ + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, + #endif ++#ifdef CROSS_INCLUDE_DIR_1 ++ /* One more place the target system's headers might be. */ ++ { CROSS_INCLUDE_DIR_1, "GCC", 0, 0, 0, 0 }, ++#endif ++#ifdef CROSS_INCLUDE_DIR_2 ++ /* One more place the target system's headers might be. */ ++ { CROSS_INCLUDE_DIR_2, "GCC", 0, 0, 0, 0 }, ++#endif + #ifdef TOOL_INCLUDE_DIR + /* Another place the target system's headers might be. */ + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, + diff --git a/gcc47-specs.patch b/gcc47-specs.patch new file mode 100644 index 0000000..8b82f3d --- /dev/null +++ b/gcc47-specs.patch @@ -0,0 +1,87 @@ +Accept -pthread and -rdynamic for compatibility with Linux. +Add --large-address-aware, and use --tsaware, only with EXEs. + +--- origsrc/gcc-4.7.2/gcc/config.gcc 2012-09-12 04:03:54.000000000 -0500 ++++ src/gcc-4.7.2/gcc/config.gcc 2013-03-11 03:41:03.674656700 -0500 +@@ -1417,7 +1417,7 @@ i[34567]86-*-cygwin*) + xm_file=i386/xm-cygwin.h + tmake_file="${tmake_file} i386/t-cygming t-slibgcc" + target_gtfiles="\$(srcdir)/config/i386/winnt.c" +- extra_options="${extra_options} i386/cygming.opt" ++ extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt" + extra_objs="winnt.o winnt-stubs.o" + c_target_objs="${c_target_objs} msformat-c.o" + cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" +--- origsrc/gcc-4.7.2/gcc/config/i386/cygwin.h 2012-02-13 15:46:38.000000000 -0600 ++++ src/gcc-4.7.2/gcc/config/i386/cygwin.h 2013-03-06 00:13:25.986558800 -0600 +@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. + #define EXTRA_OS_CPP_BUILTINS() /* Nothing. */ + + #undef CPP_SPEC +-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ ++#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread: } \ + -D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix \ + %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \ + %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\ +@@ -49,11 +49,7 @@ along with GCC; see the file COPYING3. + %{static|static-libgcc:-lgcc -lgcc_eh} \ + %{!static: \ + %{!static-libgcc: \ +- %{!shared: \ +- %{!shared-libgcc:-lgcc -lgcc_eh} \ +- %{shared-libgcc:-lgcc_s -lgcc} \ +- } \ +- %{shared:-lgcc_s -lgcc} \ ++ -lgcc_s -lgcc \ + } \ + } " + #else +@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. + #undef LIB_SPEC + #define LIB_SPEC "\ + %{pg:-lgmon} \ ++ %{pthread: } \ + -lcygwin \ + %{mwindows:-lgdi32 -lcomdlg32} \ + -ladvapi32 -lshell32 -luser32 -lkernel32" +@@ -115,7 +116,9 @@ along with GCC; see the file COPYING3. + %{shared: --shared} %{mdll:--dll} \ + %{static:-Bstatic} %{!static:-Bdynamic} \ + %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \ +- --dll-search-prefix=cyg -tsaware" ++ --dll-search-prefix=cyg \ ++ %{rdynamic: --export-all-symbols} \ ++ %{!shared: %{!mdll: --large-address-aware --tsaware}}" + + /* Binutils does not handle weak symbols from dlls correctly. For now, + do not use them unnecessarily in gthr-posix.h. */ +--- origsrc/gcc-4.7.2/gcc/config/i386/cygwin.opt 1969-12-31 18:00:00.000000000 -0600 ++++ src/gcc-4.7.2/gcc/config/i386/cygwin.opt 2013-03-11 03:36:36.556378400 -0500 +@@ -0,0 +1,27 @@ ++; Cygwin-specific options. ++ ++; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. ++; ++; This file is part of GCC. ++; ++; GCC 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, or (at your option) any later ++; version. ++; ++; GCC 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 GCC; see the file COPYING3. If not see ++; . ++ ++pthread ++Driver ++ ++rdynamic ++Driver ++ ++; Retain blank line above diff --git a/gcc48-lto-plugin-soname.patch b/gcc48-lto-plugin-soname.patch new file mode 100644 index 0000000..2ca18db --- /dev/null +++ b/gcc48-lto-plugin-soname.patch @@ -0,0 +1,50 @@ +--- origsrc/gcc-4.8-20130310/gcc/config.host 2013-03-17 02:15:46.575313400 -0500 ++++ src/gcc-4.8-20130310/gcc/config.host 2013-03-17 03:10:31.035640300 -0500 +@@ -219,14 +219,14 @@ case ${host} in + out_host_hook_obj=host-cygwin.o + host_xmake_file="${host_xmake_file} i386/x-cygwin" + host_exeext=.exe +- host_lto_plugin_soname=cyglto_plugin-0.dll ++ host_lto_plugin_soname=cyglto_plugin.dll + ;; + i[34567]86-*-mingw32*) + host_xm_file=i386/xm-mingw32.h + host_xmake_file="${host_xmake_file} i386/x-mingw32" + host_exeext=.exe + out_host_hook_obj=host-mingw32.o +- host_lto_plugin_soname=liblto_plugin-0.dll ++ host_lto_plugin_soname=liblto_plugin.dll + ;; + x86_64-*-mingw*) + use_long_long_for_widest_fast_int=yes +@@ -234,7 +234,7 @@ case ${host} in + host_xmake_file="${host_xmake_file} i386/x-mingw32" + host_exeext=.exe + out_host_hook_obj=host-mingw32.o +- host_lto_plugin_soname=liblto_plugin-0.dll ++ host_lto_plugin_soname=liblto_plugin.dll + ;; + i[34567]86-*-uwin*) + echo "*** UWIN may not be used as a host platform because" +--- origsrc/gcc-4.8-20130310/lto-plugin/Makefile.am 2011-08-10 03:48:37.000000000 -0500 ++++ src/gcc-4.8-20130310/lto-plugin/Makefile.am 2013-03-17 03:11:08.995692600 -0500 +@@ -22,7 +22,7 @@ liblto_plugin_la_SOURCES = lto-plugin.c + liblto_plugin_la_LIBADD = \ + $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,) + # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS +-liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \ ++liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \ + $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) + liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ + ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) +--- origsrc/gcc-4.8-20130310/lto-plugin/Makefile.in 2011-08-10 03:48:37.000000000 -0500 ++++ src/gcc-4.8-20130310/lto-plugin/Makefile.in 2013-03-17 03:12:11.625779100 -0500 +@@ -242,7 +242,7 @@ liblto_plugin_la_LIBADD = \ + $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,) + + # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS +-liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \ ++liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \ + $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) + + liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ diff --git a/sources b/sources index 1e11f67..26ae819 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8e0b5c12212e185f3e4383106bfa9cc6 gcc-4.5.3.tar.bz2 +86f428a30379bdee0224e353ee2f999e gcc-4.7.3.tar.bz2 -- cgit