patch-gcc_config_openbsd_h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. $OpenBSD: patch-gcc_config_openbsd_h,v 1.3 2012/10/07 20:09:45 landry Exp $
  2. --- gcc/config/openbsd.h.orig Wed Dec 22 13:06:01 2010
  3. +++ gcc/config/openbsd.h Sat Oct 6 12:11:38 2012
  4. @@ -109,9 +109,9 @@ while (0)
  5. This two-stage defines makes it easy to pick that for targets that
  6. have subspecs. */
  7. #ifdef CPP_CPU_SPEC
  8. -#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
  9. +#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
  10. #else
  11. -#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
  12. +#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
  13. #endif
  14. #undef LIB_SPEC
  15. @@ -295,6 +295,16 @@ __enable_execute_stack (void *addr) \
  16. if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
  17. perror ("mprotect of trampoline code"); \
  18. }
  19. +
  20. +/*
  21. + * Disable the use of unsafe builtin functions, (strcat, strcpy, stpcpy),
  22. + * making them easier to spot in the object files.
  23. + */
  24. +#define NO_UNSAFE_BUILTINS
  25. +
  26. +/* The system headers on OpenBSD are C++-aware. */
  27. +#undef NO_IMPLICIT_EXTERN_C
  28. +#define NO_IMPLICIT_EXTERN_C
  29. #include <sys/types.h>
  30. #include <sys/mman.h>