This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug boehm-gc/52179] boehm-gc incompatible with aslr on darwin11
- From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Feb 2012 15:07:17 +0000
- Subject: [Bug boehm-gc/52179] boehm-gc incompatible with aslr on darwin11
- Auto-submitted: auto-generated
- References: <bug-52179-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52179
--- Comment #12 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-02-23 15:07:17 UTC ---
(In reply to comment #11)
> Ah, the better way to do that would be to have:
>
> AC_CHECK_FUNCS([pthread_get_stackaddr_np])
>
> in configure.ac, and then just have
>
> #ifdef HAVE_PTHREAD_GET_STACKADDR_NP
> #define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self())
> #endif
>
> This should cover all the issues with NO_PTHREAD...
Where do you want the second change made? Should I place that in
include/gc_config.h.in (which only contains #undefs right now) or in
include/gc_config_macros.h or in os_dep.c? I notice that
HAVE_PTHREAD_GETATTR_NP is only used in pthread_support.c. The rest of the
patch looks like...
Index: configure.ac
===================================================================
--- configure.ac (revision 184508)
+++ configure.ac (working copy)
@@ -380,6 +380,7 @@ esac
oldLIBS="$LIBS"
LIBS="$LIBS $THREADLIBS"
AC_CHECK_FUNCS([pthread_getattr_np])
+AC_CHECK_FUNCS([pthread_get_stackaddr_np])
LIBS="$oldLIBS"
# Configuration of machine-dependent code
Index: include/gc_config.h.in
===================================================================
--- include/gc_config.h.in (revision 184508)
+++ include/gc_config.h.in (working copy)
@@ -87,6 +87,9 @@
/* Define to 1 if you have the `pthread_getattr_np' function. */
#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. */
#undef HAVE_STDINT_H
Index: configure
===================================================================
--- configure (revision 184508)
+++ configure (working copy)
@@ -15141,6 +15141,17 @@ _ACEOF
fi
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"
# Configuration of machine-dependent code