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]

Patch to fix warning in solaris2 libgcc2.c L_trampoline


With the following fix:
http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01609.html

it's now possible to include <sys/mman.h> and guard it appropriately
so that only solaris2 gets it even though other targets share sol2.h.
This fixes the following warnings compiling libgcc2.c L_trampoline on
solaris2.7:

 > libgcc2.c:1539: warning: implicit declaration of function `mprotect'
 > libgcc2.c:1539: warning: implicit declaration of function `mprotect'

Bootstrapped on sparc-sun-solaris2.7, along with the aforementioned
patch.  No regressions.

Ok for mainline, along with the previous patch?

		Thanks,
		--Kaveh


2003-11-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* config/sol2.h: Include <sys/mman.h> when appropriate.

diff -rup orig/egcc-CVS20031104/gcc/config/sol2.h egcc-CVS20031104/gcc/config/sol2.h
--- orig/egcc-CVS20031104/gcc/config/sol2.h	Wed Sep  3 20:01:07 2003
+++ egcc-CVS20031104/gcc/config/sol2.h	Wed Nov  5 08:21:15 2003
@@ -169,6 +169,12 @@ Boston, MA 02111-1307, USA.  */
  *
  */
 
+/* This declares `mprotect' (used by TRANSFER_FROM_TRAMPOLINE in
+   libgcc2.c).  */
+#if defined (L_trampoline) && defined (__sun__)
+#include <sys/mman.h>
+#endif
+
 /* sys/mman.h is not present on some non-Solaris configurations
    that use sol2.h, so TRANSFER_FROM_TRAMPOLINE must use a magic
    number instead of the appropriate PROT_* flags.  */


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