public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1
@ 2010-06-25  6:50 Jack Howarth
  2010-06-25  8:33 ` Mike Stump
  2010-06-25 11:53 ` Rainer Orth
  0 siblings, 2 replies; 3+ messages in thread
From: Jack Howarth @ 2010-06-25  6:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: mikestump, iains

The attached patch backports r158747 and r158748 from gcc
trunk to gcc 4.5.1 to solve PR 43715 so that plugin support
is built on darwin. Tested on x86_64-apple-darwin10. Okay
for gcc trunk?

2010-06-24  Jack Howarth  <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-04-21  Jack Howarth <howarth@bromo.med.uc.edu>

	PR 43715
	* testsuite/lib/plugin-support.exp: Use "-undefined
	dynamic_lookup" on darwin.

2010-06-24  Jack Howarth  <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-04-21  Jack Howarth <howarth@bromo.med.uc.edu>

	PR 43715
	* gcc/configure.ac: Use "$gcc_cv_nm -g" on darwin
	instead of "$gcc_cv_objdump -T".
	Use "-undefined dynamic_lookup" on darwin.
	* gcc/configure: Regenerate.


Index: gcc/testsuite/lib/plugin-support.exp
===================================================================
--- gcc/testsuite/lib/plugin-support.exp	(revision 161355)
+++ gcc/testsuite/lib/plugin-support.exp	(working copy)
@@ -88,6 +88,10 @@
 
     set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
 
+    if { [ ishost *-*-darwin* ] } {
+        set optstr [concat $optstr "-undefined dynamic_lookup"]
+    }
+
     # Temporarily switch to the environment for the plugin compiler.
     restore_ld_library_path_env_vars
     set status [remote_exec build "$PLUGINCC $PLUGINCFLAGS $plugin_src $optstr -o $plugin_lib"]
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 161355)
+++ gcc/configure.ac	(working copy)
@@ -4544,15 +4544,23 @@
 pluginlibs=
 if test x"$enable_plugin" = x"yes"; then
 
+  case "${host}" in
+    *-*-darwin*)
+      export_sym_check="$gcc_cv_nm -g"
+    ;;
+    *)
+      export_sym_check="$gcc_cv_objdump -T"
+    ;;
+  esac
   AC_MSG_CHECKING([for exported symbols])
   echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
   ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1
-  if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
+  if $export_sym_check conftest | grep foobar > /dev/null; then
     : # No need to use a flag
   else
     AC_MSG_CHECKING([for -rdynamic])
     ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1
-    if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
+    if $export_sym_check conftest | grep foobar > /dev/null; then
       plugin_rdynamic=yes
       pluginlibs="-rdynamic"
     else
@@ -4572,7 +4580,14 @@
 
   # Check that we can build shared objects with -fPIC -shared
   saved_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS -fPIC -shared"
+  case "${host}" in
+    *-*-darwin*)
+      LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
+    ;;
+    *)
+      LDFLAGS="$LDFLAGS -fPIC -shared"
+    ;;
+  esac
   AC_MSG_CHECKING([for -fPIC -shared])
   AC_TRY_LINK(
     [extern int X;],[return X == 0;],

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1
  2010-06-25  6:50 [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1 Jack Howarth
@ 2010-06-25  8:33 ` Mike Stump
  2010-06-25 11:53 ` Rainer Orth
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Stump @ 2010-06-25  8:33 UTC (permalink / raw)
  To: Jack Howarth; +Cc: gcc-patches, iains

On Jun 24, 2010, at 8:35 PM, Jack Howarth wrote:
> The attached patch backports r158747 and r158748 from gcc
> trunk to gcc 4.5.1 to solve PR 43715 so that plugin support
> is built on darwin. Tested on x86_64-apple-darwin10. Okay
> for gcc trunk?

Ok.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1
  2010-06-25  6:50 [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1 Jack Howarth
  2010-06-25  8:33 ` Mike Stump
@ 2010-06-25 11:53 ` Rainer Orth
  1 sibling, 0 replies; 3+ messages in thread
From: Rainer Orth @ 2010-06-25 11:53 UTC (permalink / raw)
  To: Jack Howarth; +Cc: gcc-patches, mikestump, iains

Jack Howarth <howarth@bromo.med.uc.edu> writes:

> 2010-06-24  Jack Howarth  <howarth@bromo.med.uc.edu>
>
> 	Backport from mainline
> 	2010-04-21  Jack Howarth <howarth@bromo.med.uc.edu>
>
> 	PR 43715

I've seen this several times in your ChangeLog entries: please use e.g. PR
target/43715 instead.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-25 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25  6:50 [PATCH] Backport PR 43715 fix for darwin to gcc 4.5.1 Jack Howarth
2010-06-25  8:33 ` Mike Stump
2010-06-25 11:53 ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).