Author: chromatic
Date: Fri Jun  1 13:04:47 2007
New Revision: 18724

Modified:
   trunk/config/auto/gcc.pm
   trunk/config/init/hints/linux.pm

Log:
[Configure] Move the visibility hints into the GCC hints and enable it only for 
GCC 4.x and later.  This makes it work other places than Linux and fixes the 
compilation for earlier GCC versions.

Modified: trunk/config/auto/gcc.pm
==============================================================================
--- trunk/config/auto/gcc.pm    (original)
+++ trunk/config/auto/gcc.pm    Fri Jun  1 13:04:47 2007
@@ -132,6 +132,7 @@
             # We shouldn't be using __packed__, but I doubt -Wpacked will harm
             # us -Wpadded may prove interesting, or even noisy.
             # -Wunreachable-code might be useful in a non debugging version
+            4.0 => "-fvisibility=hidden",
         );
         my @cage_opt_and_vers = (
             0 =>
@@ -265,6 +266,9 @@
         HAS_aligned_funcptr => 1
     );
 
+    $conf->data->set( sym_export => '__attribute__ ((visibility("default")))' )
+        if $gccversion > 4.0;
+
     $conf->data->set( HAS_aligned_funcptr => 0 )
         if $^O eq 'hpux';
 

Modified: trunk/config/init/hints/linux.pm
==============================================================================
--- trunk/config/init/hints/linux.pm    (original)
+++ trunk/config/init/hints/linux.pm    Fri Jun  1 13:04:47 2007
@@ -52,9 +52,6 @@
         }
     }
     else {
-        # hide non-exported symbols
-        $cflags .= ' -fvisibility=hidden';
-
         if ( $ld_share_flags !~ /-fPIC/ ) {
             $ld_share_flags .= ' -fPIC';
         }
@@ -90,7 +87,6 @@
         libparrot_shared       => 'libparrot$(SHARE_EXT).$(SOVERSION)',
         libparrot_shared_alias => 'libparrot$(SHARE_EXT)',
         libparrot_soname       => 
'-Wl,-soname=libparrot$(SHARE_EXT).$(SOVERSION)',
-        sym_export             => '__attribute__ ((visibility("default")))',
     );
 
     if ( ( split( '-', $Config{archname} ) )[0] eq 'ia64' ) {

Reply via email to