This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: x86 backend: Add default-manifest to Cygwin/MinGW links


Hi Guys,

  Please could I have permission to apply the patch below ?  Ideally for
  both mainline and the 4.9 branch.

  The patch adds a file called "default-manifest.o" to the end of a
  final link command line for the Cygwin and MinGW targets.  The file is
  only added if it can be found in the library search path(s), so the
  patch will have no effect if the file does not exist.

  The default manifest file contains a resource section (.rsrc) holding
  information necessary for the binary to be run under Windows 8.  It is
  placed last on the linker command line so that a user provided
  manifest, if there is one, will take precedence over the default
  manifest.

  The manifest used to be automatically added by the linker, but this
  proved to be problematic as the linker is not good at selectively
  inserting binaries.  The manifest itself is provided by a separate
  project which will have to become a new dependency for the Cygwin and
  MinGW projects.

Cheers
  Nick

gcc/ChangeLog
2014-04-23  Nick Clifton  <nickc@redhat.com>

	* config/i386/cygwin.h (ENDFILE_SPEC): Include
	default-manifest.o if it can be found in the search path.
	* config/i386/mingw32.h (ENDFILE_SPEC): Likewise.

Index: gcc/config/i386/cygwin.h
===================================================================
--- gcc/config/i386/cygwin.h	(revision 209670)
+++ gcc/config/i386/cygwin.h	(working copy)
@@ -45,6 +45,7 @@
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}\
+   %{!shared:%:if-exists(default-manifest.o%s)}\
    crtend.o%s"
 
 /* Normally, -lgcc is not needed since everything in it is in the DLL, but we
Index: gcc/config/i386/mingw32.h
===================================================================
--- gcc/config/i386/mingw32.h	(revision 209670)
+++ gcc/config/i386/mingw32.h	(working copy)
@@ -148,6 +148,7 @@
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{!shared:%:if-exists(default-manifest.o%s)}\
   crtend.o%s"
 
 /* Override startfile prefix defaults.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]