Subject: pkg/18330: [Zoularis on Solaris] perl build faild
To: None <gnats-bugs@gnats.netbsd.org>
From: None <manuel.vacelet@st.com>
List: netbsd-bugs
Date: 09/18/2002 04:09:58
>Number:         18330
>Category:       pkg
>Synopsis:       [Zoularis on Solaris] perl build faild
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 18 04:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Manuel VACELET
>Release:        Zoularis on Solaris 7 pkgsrc 2002 08 17
>Organization:
STMicroelectronics
>Environment:
SunOS crx1103 5.7 Generic_106541-19 sun4u sparc SUNW,Ultra-5_10

>Description:
Perl build fail because of Sun ld args contains -E which is reserved to GNU ld.
When perl Configure try to detect the default linker, it build a small c program:
cat << EOF >try.c
#include <stdio.h>
int main(){return 0;}
EOF
and compile it : gcc -v try.c.
The output contains the linker and the default linker on Solaris is /usr/ccs/bin/ld. But in some case the output of gcc -v only show :
ld: Solaris Link Editors: 5.7-1.272
Configure doesn't find ld and set the default value : GNU ld
>How-To-Repeat:

>Fix:
patch perl Makefile :
*** /project/sds/delivery/zoularis/pkg/pkgsrc/20020817/pkgsrc/lang/perl5/Makefile	Thu Jan 31 14:46:13 2002
--- pkgsrc-modif-20020817/lang/perl5/Makefile	Wed Sep 18 11:57:20 2002
***************
*** 89,94 ****
--- 89,100 ----
  PERL5_SITEARCH=		${PREFIX}/lib/perl5/site_perl/${PERL5_DIST_VERS}/${MACHINE_ARCH}-${LOWER_OPSYS}
  PERL5_PACKLIST=		${PERL5_ARCHLIB}/.packlist
  
+ pre-patch:
+ 	hintdir="${WRKSRC}/hints";					\
+ 	for hints in $${hintdir}/*.sh; do				\
+ 		${CHMOD} +w $${hints};					\
+ 	done
+ 
  # It's tough to guess which hints file will be used, so add our modifications
  # to all of them:
  #

patch-ai :
--- hints/solaris_2.sh.orig	Tue Sep 17 15:50:45 2002
+++ hints/solaris_2.sh	Tue Sep 17 16:14:32 2002
@@ -246,11 +246,16 @@
 	    # (This may all depend on local configurations too.)
 
 	    myld=`echo $verbose| grep ld | awk '/\/ld/ {print $1}'`
+	    case $myld in
+	    "") myld=`which ld`;;
+	    esac
+
 	    # This assumes that gcc's output will not change, and that
 	    # /full/path/to/ld will be the first word of the output.
 	    # Thus myld is something like opt/gnu/sparc-sun-solaris2.5/bin/ld
 
-	    if $myld -V 2>&1 | grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
+	    if [ `$myld -V 2>&1 | grep "ld: Software Generation Utilities" >/dev/null 2>&1` -o \
+	         `$myld -V 2>&1 | grep "ld: Solaris Link Editors" >/dev/null 2>&1` ]; then
 		# Ok, /usr/ccs/bin/ld eventually does get called.
 		:
 	    else

>Release-Note:
>Audit-Trail:
>Unformatted: