This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 4.5.0 Released


On Thu, Apr 22, 2010 at 12:44:42AM +0200, Paolo Bonzini wrote:
> On Thu, Apr 22, 2010 at 00:35, Andreas Schwab <schwab@linux-m68k.org> wrote:
> > Paolo Bonzini <bonzini@gnu.org> writes:
> >
> >> I'm not sure if "nm -g" would work under Linux, since
> >>
> >> $ nm -g /usr/lib64/libsqlite3.so
> >> nm: /usr/lib64/libsqlite3.so: no symbols
> >>
> >> $ objdump -T /usr/lib64/libsqlite3.so|head -5
> >
> > The equivalent of "objdump -T" is "nm -D".
> 
> ... but I'm not sure nm -D would work under Darwin, either. ;-)
> 
> Paolo

Paolo,
   We don't have -D in our nm. How about the following change to
configure.ac?
            Jack

Index: configure.ac
===================================================================
--- configure.ac        (revision 158487)
+++ configure.ac        (working copy)
@@ -4456,15 +4456,27 @@
 pluginlibs=
 if test x"$enable_plugin" = x"yes"; then
 
+  if test -z "$gcc_cv_objdump"; then
+    case "${host}" in
+      *-*-darwin*)
+        export_sym_check="$gcc_cv_nm -g"
+      ;;
+      *)
+        export_sym_check="$gcc_cv_nm -D"
+      ;;
+    esac
+  else
+    export_sym_check="$gcc_cv_objdump -T"
+  fi  
   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
@@ -4484,7 +4496,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;],


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]