[perl #66604] 64bit compilation Problem on Solaris x86_64
authorH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Fri, 10 May 2013 12:20:36 +0000 (14:20 +0200)
committerH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Fri, 10 May 2013 12:20:36 +0000 (14:20 +0200)
U/perl/dlsrc.U

index ae39796..c98f862 100644 (file)
@@ -19,7 +19,7 @@
 ?MAKE:usedl ld dlsrc cccdlflags lddlflags ccdlflags bin_ELF ld_can_script: \
        rm_try Getfile Myread test osname sed i_dld d_dlopen Findhdr Setvar \
        src run cc ccflags ldflags optimize ls gccversion cat rsrc i_stdlib \
-       i_unistd
+       i_unistd osvers
 ?MAKE: -pick add $@ %<
 ?Y:BOTTOM
 ?S:usedl:
@@ -237,7 +237,21 @@ EOM
                              ;;
                        linux|irix*|gnu*)  dflt="-shared $optimize" ;;
                        next)  dflt='none' ;;
-                       solaris) dflt='-G' ;;
+                       solaris) # See [perl #66604].
+                               # On Solaris 11, gcc -m64 on amd64 
+                               # appears not to understand -G.  gcc versions at
+                               # least as old as 3.4.3 support -shared, so just
+                               # use that with Solaris 11 and later, but keep
+                               # the old behavior for older Solaris versions.
+                               case "$gccversion" in
+                                       '') dflt='-G' ;;
+                                       *)      case "$osvers" in
+                                                       2.?|2.10) dflt='-G' ;;
+                                                       *) dflt='-shared' ;;
+                                               esac
+                                               ;;
+                               esac
+                               ;;
                        sunos) dflt='-assert nodefinitions' ;;
                        svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
                *)     dflt='none' ;;