Patch to fix warning in solaris2 libgcc2.c L_trampoline
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sat Nov 22 01:56:00 GMT 2003
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. */
More information about the Gcc-patches
mailing list