re PR boehm-gc/52179 (boehm-gc incompatible with aslr on darwin11)

2012-02-23  Patrick Marlier  <patrick.marlier@gmail.com>
	    Jack Howarth  <howarth@bromo.med.uc.edu>

boehm-gc/

	PR boehm-gc/52179
	* include/gc_config.h.in: Undefine HAVE_PTHREAD_GET_STACKADDR_NP.
	* include/private/gcconfig.h (DARWIN): Define STACKBOTTOM with
	pthread_get_stackaddr_np when available.
	* configure.ac (THREADS): Check availability of pthread_get_stackaddr_np.
	* configure: Regenerate.

libjava/

	PR target/49461
	* configure.ac (SYSTEMSPEC): No longer pass -no_pie for darwin11.
	* configure: Regenerate.


Co-Authored-By: Jack Howarth <howarth@bromo.med.uc.edu>

From-SVN: r184555
This commit is contained in:
Patrick Marlier 2012-02-24 15:21:12 +00:00 committed by Patrick Marlier
parent b9af73fca3
commit e00db51142
8 changed files with 44 additions and 14 deletions

View File

@ -1,3 +1,13 @@
2012-02-23 Patrick Marlier <patrick.marlier@gmail.com>
Jack Howarth <howarth@bromo.med.uc.edu>
PR boehm-gc/52179
* include/gc_config.h.in: Undefine HAVE_PTHREAD_GET_STACKADDR_NP.
* include/private/gcconfig.h (DARWIN): Define STACKBOTTOM with
pthread_get_stackaddr_np when available.
* configure.ac (THREADS): Check availability of pthread_get_stackaddr_np.
* configure: Regenerate.
2012-02-10 Kai Tietz <ktietz@redhat.com> 2012-02-10 Kai Tietz <ktietz@redhat.com>
PR boehm-gc/48514 PR boehm-gc/48514

11
boehm-gc/configure vendored
View File

@ -15141,6 +15141,17 @@ _ACEOF
fi fi
done done
for ac_func in pthread_get_stackaddr_np
do :
ac_fn_c_check_func "$LINENO" "pthread_get_stackaddr_np" "ac_cv_func_pthread_get_stackaddr_np"
if test "x$ac_cv_func_pthread_get_stackaddr_np" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PTHREAD_GET_STACKADDR_NP 1
_ACEOF
fi
done
LIBS="$oldLIBS" LIBS="$oldLIBS"
# Configuration of machine-dependent code # Configuration of machine-dependent code

View File

@ -380,6 +380,7 @@ esac
oldLIBS="$LIBS" oldLIBS="$LIBS"
LIBS="$LIBS $THREADLIBS" LIBS="$LIBS $THREADLIBS"
AC_CHECK_FUNCS([pthread_getattr_np]) AC_CHECK_FUNCS([pthread_getattr_np])
AC_CHECK_FUNCS([pthread_get_stackaddr_np])
LIBS="$oldLIBS" LIBS="$oldLIBS"
# Configuration of machine-dependent code # Configuration of machine-dependent code

View File

@ -87,6 +87,9 @@
/* Define to 1 if you have the `pthread_getattr_np' function. */ /* Define to 1 if you have the `pthread_getattr_np' function. */
#undef HAVE_PTHREAD_GETATTR_NP #undef HAVE_PTHREAD_GETATTR_NP
/* Define to 1 if you have the `pthread_get_stackaddr_np_np' function. */
#undef HAVE_PTHREAD_GET_STACKADDR_NP
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H #undef HAVE_STDINT_H

View File

@ -1331,7 +1331,11 @@
These aren't used when dyld support is enabled (it is by default) */ These aren't used when dyld support is enabled (it is by default) */
# define DATASTART ((ptr_t) get_etext()) # define DATASTART ((ptr_t) get_etext())
# define DATAEND ((ptr_t) get_end()) # define DATAEND ((ptr_t) get_end())
# define STACKBOTTOM ((ptr_t) 0xc0000000) # ifdef HAVE_PTHREAD_GET_STACKADDR_NP
# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self())
# else
# define STACKBOTTOM ((ptr_t) 0xc0000000)
# endif
# define USE_MMAP # define USE_MMAP
# define USE_MMAP_ANON # define USE_MMAP_ANON
# define USE_ASM_PUSH_REGS # define USE_ASM_PUSH_REGS
@ -2014,7 +2018,11 @@
These aren't used when dyld support is enabled (it is by default) */ These aren't used when dyld support is enabled (it is by default) */
# define DATASTART ((ptr_t) get_etext()) # define DATASTART ((ptr_t) get_etext())
# define DATAEND ((ptr_t) get_end()) # define DATAEND ((ptr_t) get_end())
# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000) # ifdef HAVE_PTHREAD_GET_STACKADDR_NP
# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self())
# else
# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
# endif
# define USE_MMAP # define USE_MMAP
# define USE_MMAP_ANON # define USE_MMAP_ANON
# ifdef GC_DARWIN_THREADS # ifdef GC_DARWIN_THREADS

View File

@ -1,3 +1,10 @@
2012-02-23 Patrick Marlier <patrick.marlier@gmail.com>
Jack Howarth <howarth@bromo.med.uc.edu>
PR target/49461
* configure.ac (SYSTEMSPEC): No longer pass -no_pie for darwin11.
* configure: Regenerate.
2012-02-02 Kai Tietz <ktietz@redhat.com> 2012-02-02 Kai Tietz <ktietz@redhat.com>
PR libjava/48512 PR libjava/48512

7
libjava/configure vendored
View File

@ -19788,14 +19788,9 @@ case "${host}" in
SYSTEMSPEC="-lunicows $SYSTEMSPEC" SYSTEMSPEC="-lunicows $SYSTEMSPEC"
fi fi
;; ;;
*-*-darwin9*) *-*-darwin[912]*)
SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;; ;;
*-*-darwin[12]*)
# Something is incompatible with pie, would be nice to fix it and
# remove -no_pie. PR49461
SYSTEMSPEC="-no_pie %{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;;
*) *)
SYSTEMSPEC= SYSTEMSPEC=
;; ;;

View File

@ -898,14 +898,9 @@ case "${host}" in
SYSTEMSPEC="-lunicows $SYSTEMSPEC" SYSTEMSPEC="-lunicows $SYSTEMSPEC"
fi fi
;; ;;
*-*-darwin9*) *-*-darwin[[912]]*)
SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;; ;;
*-*-darwin[[12]]*)
# Something is incompatible with pie, would be nice to fix it and
# remove -no_pie. PR49461
SYSTEMSPEC="-no_pie %{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;;
*) *)
SYSTEMSPEC= SYSTEMSPEC=
;; ;;