Re: Solaris x86 has no SPARC libraries!
[p5sagit/p5-mst-13.2.git] / hints / solaris_2.sh
1 # hints/solaris_2.sh
2 # Last modified: Friday, 2000-09-01
3 # Lupe Christoph <lupe@lupe-christoph.de>
4 # Based on version by:
5 # Andy Dougherty  <doughera@lafayette.edu>
6 # Which was based on input from lots of folks, especially
7 # Dean Roehrich <roehrich@ironwood-fddi.cray.com>
8 # Additional input from Alan Burlison, Jarkko Hietaniemi,
9 # and Richard Soderberg.
10
11 # For consistency with gcc, we do not adopt Sun Marketing's
12 # removal of the '2.' prefix from the Solaris version number.
13 # (Configure tries to detect an old fixincludes and needs
14 # this information.)
15
16 # If perl fails tests that involve dynamic loading of extensions, and
17 # you are using gcc, be sure that you are NOT using GNU as and ld.  One
18 # way to do that is to invoke Configure with
19
20 #     sh Configure -Dcc='gcc -B/usr/ccs/bin/'
21 #
22 #  (Note that the trailing slash is *required*.)
23 #  gcc will occasionally emit warnings about "unused prefix", but
24 #  these ought to be harmless.  See below for more details.
25  
26 # See man vfork.
27 usevfork=false
28
29 d_suidsafe=define
30
31 # Avoid all libraries in /usr/ucblib.
32 set `echo $glibpth | sed -e 's@/usr/ucblib@@'`
33 glibpth="$*"
34
35 # Remove unwanted libraries.  -lucb contains incompatible routines.
36 # -lld and -lsec don't do anything useful. -lcrypt does not
37 # really provide anything we need over -lc, so we droip it, too.
38 # -lmalloc can cause a problem with GNU CC & Solaris.  Specifically,
39 # libmalloc.a may allocate memory that is only 4 byte aligned, but
40 # GNU CC on the Sparc assumes that doubles are 8 byte aligned.
41 # Thanks to  Hallvard B. Furuseth <h.b.furuseth@usit.uio.no>
42 set `echo " $libswanted " | sed -e 's@ ld @ @' -e 's@ malloc @ @' -e 's@ ucb @ @' -e 's@ sec @ @' -e 's@ crypt @ @'` 
43 libswanted="$*"
44
45 # Look for architecture name.  We want to suggest a useful default.
46 case "$archname" in
47 '')
48     if test -f /usr/bin/arch; then
49         archname=`/usr/bin/arch`
50         archname="${archname}-${osname}"
51     elif test -f /usr/ucb/arch; then
52         archname=`/usr/ucb/arch`
53         archname="${archname}-${osname}"
54     fi
55     ;;
56 esac
57
58 ccversion="`${cc:-cc} -V 2>&1|sed 's/^cc: //'`"
59 case "$ccversion" in
60 *WorkShop*) ccname=workshop ;;
61 *) ccversion='' ;;
62 esac
63
64 if test `uname -p` = "sparc"; then
65     # This is only needed for SPARC V9
66     cat >UU/workshoplibpth.cbu<<'EOCBU'
67 case "$workshoplibpth_done" in
68     '') case "$use64bitall" in
69         "$define"|true|[yY]*)
70             loclibpth="$loclibpth /usr/lib/sparcv9"
71             if test -n "$workshoplibs"; then
72                 loclibpth=`echo $loclibpth | sed -e "s% $workshoplibs%%" `
73                 for lib in $workshoplibs; do
74                     # Logically, it should be sparcv9.
75                     # But the reality fights back, it's v9.
76                     loclibpth="$loclibpth $lib/sparcv9 $lib/v9"
77                 done
78             fi 
79             ;;
80         *)  loclibpth="$loclibpth $workshoplibs"  
81             ;;
82         esac
83         workshoplibpth_done="$define"
84         ;;
85 esac
86 EOCBU
87 fi
88
89 case "$ccname" in
90 workshop)
91         cat >try.c <<EOF
92 #include <sunmath.h>
93 int main() { return(0); }
94 EOF
95         workshoplibs=`cc -### try.c -lsunmath -o try 2>&1|grep " -Y "|sed 's%.* -Y "P,\(.*\)".*%\1%'|tr ':' '\n'|grep '/SUNWspro/'`
96         . ./UU/workshoplibpth.cbu
97         ;;
98 esac
99
100 ######################################################
101 # General sanity testing.  See below for excerpts from the Solaris FAQ.
102 #
103 # From roehrich@ironwood-fddi.cray.com Wed Sep 27 12:51:46 1995
104 # Date: Thu, 7 Sep 1995 16:31:40 -0500
105 # From: Dean Roehrich <roehrich@ironwood-fddi.cray.com>
106 # To: perl5-porters@africa.nicoh.com
107 # Subject: Re: On perl5/solaris/gcc
108 #
109 # Here's another draft of the perl5/solaris/gcc sanity-checker. 
110
111 case `type ${cc:-cc}` in
112 */usr/ucb/cc*) cat <<END >&4
113
114 NOTE:  Some people have reported problems with /usr/ucb/cc.  
115 If you have difficulties, please make sure the directory
116 containing your C compiler is before /usr/ucb in your PATH.
117
118 END
119 ;;
120 esac
121
122
123 # Check that /dev/fd is mounted.  If it is not mounted, let the
124 # user know that suid scripts may not work.
125 /usr/bin/df /dev/fd 2>&1 > /dev/null
126 case $? in
127 0) ;;
128 *)
129         cat <<END >&4
130
131 NOTE: Your system does not have /dev/fd mounted.  If you want to
132 be able to use set-uid scripts you must ask your system administrator
133 to mount /dev/fd.
134
135 END
136         ;;
137 esac
138
139
140 # See if libucb can be found in /usr/lib.  If it is, warn the user
141 # that this may cause problems while building Perl extensions.
142 /usr/bin/ls /usr/lib/libucb* >/dev/null 2>&1
143 case $? in
144 0)
145         cat <<END >&4
146
147 NOTE: libucb has been found in /usr/lib.  libucb should reside in
148 /usr/ucblib.  You may have trouble while building Perl extensions.
149
150 END
151 ;;
152 esac
153
154 # Use shell built-in 'type' command instead of /usr/bin/which to
155 # avoid possible csh start-up problems and also to use the same shell
156 # we'll be using to Configure and make perl.
157 # The path name is the last field in the output, but the type command
158 # has an annoying array of possible outputs, e.g.:
159 #       make is hashed (/opt/gnu/bin/make)
160 #       cc is /usr/ucb/cc
161 #       foo not found
162 # use a command like type make | awk '{print $NF}' | sed 's/[()]//g'
163
164 # See if make(1) is GNU make(1).
165 # If it is, make sure the setgid bit is not set.
166 make -v > make.vers 2>&1
167 if grep GNU make.vers > /dev/null 2>&1; then
168     tmp=`type make | awk '{print $NF}' | sed 's/[()]//g'`
169     case "`/usr/bin/ls -lL $tmp`" in
170     ??????s*)
171             cat <<END >&2
172         
173 NOTE: Your PATH points to GNU make, and your GNU make has the set-group-id
174 bit set.  You must either rearrange your PATH to put /usr/ccs/bin before the
175 GNU utilities or you must ask your system administrator to disable the
176 set-group-id bit on GNU make.
177
178 END
179             ;;
180     esac
181 fi
182 rm -f make.vers
183
184 # XXX EXPERIMENTAL  A.D.  2/27/1998
185 # XXX This script UU/cc.cbu will get 'called-back' by Configure after it
186 # XXX has prompted the user for the C compiler to use.
187 cat > UU/cc.cbu <<'EOSH'
188 # If the C compiler is gcc:
189 #   - check the fixed-includes
190 #   - check as(1) and ld(1), they should not be GNU
191 #       (GNU as and ld 2.8.1 and later are reportedly ok, however.)
192 # If the C compiler is not gcc:
193 #   - check as(1) and ld(1), they should not be GNU
194 #       (GNU as and ld 2.8.1 and later are reportedly ok, however.)
195 #
196 # Watch out in case they have not set $cc.
197
198 # Perl compiled with some combinations of GNU as and ld may not 
199 # be able to perform dynamic loading of extensions.  If you have a
200 # problem with dynamic loading, be sure that you are using the Solaris
201 # /usr/ccs/bin/as and /usr/ccs/bin/ld.  You can do that with
202 #               sh Configure -Dcc='gcc -B/usr/ccs/bin/'
203 # (note the trailing slash is required). 
204 # Combinations that are known to work with the following hints:
205 #
206 #  gcc-2.7.2, GNU as 2.7, GNU ld 2.7
207 #  egcs-1.0.3, GNU as 2.9.1 and GNU ld 2.9.1
208 #       --Andy Dougherty  <doughera@lafayette.edu>  
209 #       Tue Apr 13 17:19:43 EDT 1999
210
211 # Get gcc to share its secrets.
212 echo 'main() { return 0; }' > try.c
213         # Indent to avoid propagation to config.sh
214         verbose=`${cc:-cc} -v -o try try.c 2>&1`
215
216 if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
217         #
218         # Using gcc.
219         #
220
221         tmp=`echo "$verbose" | grep '^Reading' |
222                 awk '{print $NF}'  | sed 's/specs$/include/'`
223
224         # Determine if the fixed-includes look like they'll work.
225         # Doesn't work anymore for gcc-2.7.2.
226
227         # See if as(1) is GNU as(1).  GNU as(1) might not work for this job.
228         if echo "$verbose" | grep ' /usr/ccs/bin/as ' >/dev/null 2>&1; then
229             :
230         else
231             cat <<END >&2
232
233 NOTE: You are using GNU as(1).  GNU as(1) might not build Perl.  If you
234 have trouble, you can use /usr/ccs/bin/as by including -B/usr/ccs/bin/
235 in your ${cc:-cc} command.  (Note that the trailing "/" is required.)
236
237 END
238             # Apparently not needed, at least for as 2.7 and later.
239             # cc="${cc:-cc} -B/usr/ccs/bin/"
240         fi
241
242         # See if ld(1) is GNU ld(1).  GNU ld(1) might not work for this job.
243         # Recompute $verbose since we may have just changed $cc.
244         verbose=`${cc:-cc} -v -o try try.c 2>&1 | grep ld 2>&1`
245
246         if echo "$verbose" | grep ' /usr/ccs/bin/ld ' >/dev/null 2>&1; then
247             # Ok, gcc directly calls the Solaris /usr/ccs/bin/ld.
248             :
249         elif echo "$verbose" | grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
250             # Hmm.  gcc doesn't call /usr/ccs/bin/ld directly, but it
251             # does appear to be using it eventually.  egcs-1.0.3's ld
252             # wrapper does this.
253             # All Solaris versions of ld I've seen contain the magic
254             # string used in the grep.
255             :
256         else
257             # No evidence yet of /usr/ccs/bin/ld.  Some versions
258             # of egcs's ld wrapper call /usr/ccs/bin/ld in turn but
259             # apparently don't reveal that unless you pass in -V.
260             # (This may all depend on local configurations too.)
261
262             myld=`echo $verbose| grep ld | awk '/\/ld/ {print $1}'`
263             # This assumes that gcc's output will not change, and that
264             # /full/path/to/ld will be the first word of the output.
265             # Thus myld is something like opt/gnu/sparc-sun-solaris2.5/bin/ld
266
267             if $myld -V 2>&1 | grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
268                 # Ok, /usr/ccs/bin/ld eventually does get called.
269                 :
270             else
271                 cat <<END >&2
272
273 NOTE: You are using GNU ld(1).  GNU ld(1) might not build Perl.  If you
274 have trouble, you can use /usr/ccs/bin/ld by including -B/usr/ccs/bin/
275 in your ${cc:-cc} command.  (Note that the trailing "/" is required.)
276
277 I will try to use GNU ld by passing in the -Wl,-E flag, but if that
278 doesn't work, you should use -B/usr/ccs/bin/ instead.
279
280 END
281                 ccdlflags="$ccdlflags -Wl,-E"
282                 lddlflags="$lddlflags -W,l-E -G"
283             fi
284         fi
285
286 else
287         #
288         # Not using gcc.
289         #
290
291         # See if as(1) is GNU as(1).  GNU might not work for this job.
292         case `as --version < /dev/null 2>&1` in
293         *GNU*)
294                 cat <<END >&2
295
296 NOTE: You are using GNU as(1).  GNU as(1) might not build Perl.
297 You must arrange to use /usr/ccs/bin/as, perhaps by adding /usr/ccs/bin
298 to the beginning of your PATH.
299
300 END
301                 ;;
302         esac
303
304         # See if ld(1) is GNU ld(1).  GNU ld(1) might not work for this job.
305         # ld --version doesn't properly report itself as a GNU tool,
306         # as of ld version 2.6, so we need to be more strict. TWP 9/5/96
307         gnu_ld=false
308         case `ld --version < /dev/null 2>&1` in
309         *GNU*|ld\ version\ 2*)
310                 gnu_ld=true ;;
311         *) ;;
312         esac
313         if $gnu_ld ; then :
314         else
315                 # Try to guess from path
316                 case `type ld | awk '{print $NF}'` in
317                 *gnu*|*GNU*|*FSF*)
318                         gnu_ld=true ;;
319                 esac
320         fi
321         if $gnu_ld ; then
322                 cat <<END >&2
323
324 NOTE: You are apparently using GNU ld(1).  GNU ld(1) might not build Perl.
325 You should arrange to use /usr/ccs/bin/ld, perhaps by adding /usr/ccs/bin
326 to the beginning of your PATH.
327
328 END
329         fi
330
331 fi
332
333 # as --version or ld --version might dump core.
334 rm -f try try.c
335 rm -f core
336
337 # XXX
338 EOSH
339
340 cat > UU/usethreads.cbu <<'EOCBU'
341 # This script UU/usethreads.cbu will get 'called-back' by Configure 
342 # after it has prompted the user for whether to use threads.
343 case "$usethreads" in
344 $define|true|[yY]*)
345         ccflags="-D_REENTRANT $ccflags"
346
347         # sched_yield is in -lposix4 up to Solaris 2.6, in -lrt starting with Solaris 7
348         case `uname -r` in
349         5.[0-6] | 5.5.1) sched_yield_lib="posix4" ;;
350         *) sched_yield_lib="rt";
351         esac
352         set `echo X "$libswanted "| sed -e "s/ c / $sched_yield_lib pthread c /"`
353         shift
354         libswanted="$*"
355
356         # On Solaris 2.6 x86 there is a bug with sigsetjmp() and siglongjmp()
357         # when linked with the threads library, such that whatever positive
358         # value you pass to siglongjmp(), sigsetjmp() returns 1.
359         # Thanks to Simon Parsons <S.Parsons@ftel.co.uk> for this report.
360         # Sun BugID is 4117946, "sigsetjmp always returns 1 when called by
361         # siglongjmp in a MT program". As of 19980622, there is no patch
362         # available.
363         cat >try.c <<'EOM'
364         /* Test for sig(set|long)jmp bug. */
365         #include <setjmp.h>
366          
367         main()
368         {
369             sigjmp_buf env;
370             int ret;
371         
372             ret = sigsetjmp(env, 1);
373             if (ret) { return ret == 2; }
374             siglongjmp(env, 2);
375         }
376 EOM
377         if test "`arch`" = i86pc -a `uname -r` = 5.6 && \
378            ${cc:-cc} try.c -lpthread >/dev/null 2>&1 && ./a.out; then
379             d_sigsetjmp=$undef
380             cat << 'EOM' >&2
381
382 You will see a *** WHOA THERE!!! ***  message from Configure for
383 d_sigsetjmp.  Keep the recommended value.  See hints/solaris_2.sh
384 for more information.
385
386 EOM
387         fi
388         ;;
389 esac
390 EOCBU
391
392 cat > UU/uselargefiles.cbu <<'EOCBU'
393 # This script UU/uselargefiles.cbu will get 'called-back' by Configure 
394 # after it has prompted the user for whether to use large files.
395 case "$uselargefiles" in
396 ''|$define|true|[yY]*)
397
398 # Keep these in the left margin.
399 ccflags_uselargefiles="`getconf LFS_CFLAGS 2>/dev/null`"
400 ldflags_uselargefiles="`getconf LFS_LDFLAGS 2>/dev/null`"
401 libswanted_uselargefiles="`getconf LFS_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
402
403     ccflags="$ccflags $ccflags_uselargefiles"
404     ldflags="$ldflags $ldflags_uselargefiles"
405     libswanted="$libswanted $libswanted_uselargefiles"
406     ;;
407 esac
408 EOCBU
409
410 # This is truly a mess.
411 case "$usemorebits" in
412 "$define"|true|[yY]*)
413         use64bitint="$define"    
414         uselongdouble="$define"    
415         ;;
416 esac
417
418 if test `uname -p` = "sparc"; then
419     cat > UU/use64bitint.cbu <<'EOCBU'
420 # This script UU/use64bitint.cbu will get 'called-back' by Configure 
421 # after it has prompted the user for whether to use 64 bit integers.
422 case "$use64bitint" in
423 "$define"|true|[yY]*)
424             case "`uname -r`" in
425             5.[0-4])
426                 cat >&4 <<EOM
427 Solaris `uname -r|sed -e 's/^5\./2./'` does not support 64-bit integers.
428 You should upgrade to at least Solaris 2.5.
429 EOM
430                 exit 1
431                 ;;
432             esac
433             ;;
434 esac
435 EOCBU
436
437     cat > UU/use64bitall.cbu <<'EOCBU'
438 # This script UU/use64bitall.cbu will get 'called-back' by Configure 
439 # after it has prompted the user for whether to be maximally 64 bitty.
440 case "$use64bitall-$use64bitall_done" in
441 "$define-"|true-|[yY]*-)
442             case "`uname -r`" in
443             5.[0-6])
444                 cat >&4 <<EOM
445 Solaris `uname -r|sed -e 's/^5\./2./'` does not support 64-bit pointers.
446 You should upgrade to at least Solaris 2.7.
447 EOM
448                 exit 1
449                 ;;
450             esac
451             libc='/usr/lib/sparcv9/libc.so'
452             if test ! -f $libc; then
453                 cat >&4 <<EOM
454
455 I do not see the 64-bit libc, $libc.
456 Cannot continue, aborting.
457
458 EOM
459                 exit 1
460             fi 
461             . ./workshoplibpth.cbu
462             case "$cc -v 2>/dev/null" in
463             *gcc*)
464                 echo 'main() { return 0; }' > try.c
465                 case "`${cc:-cc} -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in
466                 *"m64 is not supported"*)
467                     cat >&4 <<EOM
468
469 Full 64-bit build not supported by this gcc configuration.
470 Cannot continue, aborting.
471
472 EOM
473                     exit 1
474                     ;;
475                 esac    
476                 ccflags="$ccflags -mcpu=v9 -m64"
477                 if test X`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null` != X; then
478                     ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
479                 fi
480                 # no changes to ld flags, as (according to man ld):
481                 #
482                 # There is no specific option that tells ld to link 64-bit
483                 # objects; the class of the first object that gets processed
484                 # by ld determines whether it is to perform a 32-bit or a
485                 # 64-bit link edit.
486                 ;;
487             *)
488                 ccflags="$ccflags `getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
489                 ldflags="$ldflags `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
490                 lddlflags="$lddlflags -G `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
491                 ;;
492             esac        
493             libscheck='case "`/usr/bin/file $xxx`" in
494 *64-bit*|*SPARCV9*) ;;
495 *) xxx=/no/64-bit$xxx ;;
496 esac'
497             use64bitall_done=yes
498             ;;
499 esac
500 EOCBU
501
502     # Actually, we want to run this already now, if so requested,
503     # because we need to fix up things right now.
504     case "$use64bitall" in
505     "$define"|true|[yY]*)
506         . ./UU/use64bitall.cbu
507         ;;
508     esac
509 fi
510
511 cat > UU/uselongdouble.cbu <<'EOCBU'
512 # This script UU/uselongdouble.cbu will get 'called-back' by Configure 
513 # after it has prompted the user for whether to use long doubles.
514 case "$uselongdouble-$uselongdouble_done" in
515 "$define-"|true-|[yY]*-)
516         case "$ccname" in
517         workshop)
518                 libswanted="$libswanted sunmath"
519                 loclibpth="$loclibpth /opt/SUNWspro/lib"
520                 ;;
521         *)      cat >&4 <<EOM
522
523 The Sun Workshop compiler is not being used; therefore I do not see
524 the libsunmath; therefore I do not know how to do long doubles, sorry.
525 I'm disabling the use of long doubles.
526 EOM
527                 uselongdouble="$undef"
528                 ;;
529         esac
530         uselongdouble_done=yes
531         ;;
532 esac
533 EOCBU
534
535 # Actually, we want to run this already now, if so requested,
536 # because we need to fix up things right now.
537 case "$uselongdouble" in
538 "$define"|true|[yY]*)
539         . ./UU/uselongdouble.cbu
540         ;;
541 esac
542
543 rm -f try.c try.o try
544
545 # This is just a trick to include some useful notes.
546 cat > /dev/null <<'End_of_Solaris_Notes'
547
548 Here are some notes kindly contributed by Dean Roehrich.
549
550 -----
551 Generic notes about building Perl5 on Solaris:
552 - Use /usr/ccs/bin/make.
553 - If you use GNU make, remove its setgid bit.
554 - Remove all instances of *ucb* from your path.
555 - Make sure libucb is not in /usr/lib (it should be in /usr/ucblib).
556 - Do not use GNU as or GNU ld, or any of GNU binutils or GNU libc.
557 - Do not use /usr/ucb/cc.
558 - Do not change Configure's default answers, except for the path names.
559 - Do not use -lmalloc.
560 - Do not build on SunOS 4 and expect it to work properly on SunOS 5.
561 - /dev/fd must be mounted if you want set-uid scripts to work.
562
563
564 Here are the gcc-related questions and answers from the Solaris 2 FAQ.  Note
565 the themes:
566         - run fixincludes
567         - run fixincludes correctly
568         - don't use GNU as or GNU ld
569
570 Question 5.7 covers the __builtin_va_alist problem people are always seeing.
571 Question 6.1.3 covers the GNU as and GNU ld issues which are always biting
572 people.
573 Question 6.9 is for those who are still trying to compile Perl4.
574
575 The latest Solaris 2 FAQ can be found in the following locations:
576         rtfm.mit.edu:/pub/usenet-by-group/comp.sys.sun.admin
577         ftp.fwi.uva.nl:/pub/solaris
578
579 Perl5 comes with a script in the top-level directory called "myconfig" which
580 will print a summary of the configuration in your config.sh.  My summary for
581 Solaris 2.4 and gcc 2.6.3 follows.  I have also built with gcc 2.7.0 and the
582 results are identical.  This configuration was generated with Configure's -d
583 option (take all defaults, don't bother prompting me).  All tests pass for
584 Perl5.001, patch.1m.
585
586 Summary of my perl5 (patchlevel 1) configuration:
587   Platform:
588     osname=solaris, osver=2.4, archname=sun4-solaris
589     uname='sunos poplar 5.4 generic_101945-27 sun4d sparc '
590     hint=recommended
591   Compiler:
592     cc='gcc', optimize='-O', ld='gcc'
593     cppflags=''
594     ccflags =''
595     ldflags =''
596     stdchar='unsigned char', d_stdstdio=define, usevfork=false
597     voidflags=15, castflags=0, d_casti32=define, d_castneg=define
598     intsize=4, alignbytes=8, usemymalloc=y, randbits=15
599   Libraries:
600     so=so
601     libpth=/lib /usr/lib /usr/ccs/lib /usr/local/lib
602     libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
603     libc=/usr/lib/libc.so
604   Dynamic Linking:
605     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef
606     cccdlflags='-fpic', ccdlflags=' ', lddlflags='-G'
607
608
609 Dean
610 roehrich@cray.com
611 9/7/95
612
613 -----------
614
615 Archive-name: Solaris2/FAQ
616 Version: 1.70
617 Last-Modified: 2000/07/06 10:01:14
618 Maintained-by: Casper Dik <Casper.Dik@Holland.Sun.COM>
619
620 5.9) Why do I get __builtin_va_alist or __builtin_va_arg_incr undefined? 
621
622     You're using gcc without properly installing the gcc fixed
623     include files. Or you ran fixincludes after installing gcc
624     w/o moving the gcc supplied varargs.h and stdarg.h files out
625     of the way and moving them back again later. This often
626     happens when people install gcc from a binary
627     distribution. If there's a tmp directory in gcc's include
628     directory, fixincludes didn't complete. You should have run
629     "just-fixinc" instead.
630
631     Another possible cause is that you're using ``gcc -I/usr/include.''
632
633     Reinstall gcc or upgrade to gcc 2.8.0 or later, which
634     doesn't require a reinstallation after every OS upgrade, if
635     you run Solaris 2.5 or later.
636
637 6.1) Where is the C compiler or where can I get one?
638
639     [...]
640
641     4) Gcc. 
642
643     Gcc is available from the GNU archives in source form. You
644     need gcc 2.3.3 or later, and you should prefer gcc 2.8.0 or
645     later as it works better with Solaris 2.x include files. You
646     should not use GNU as or GNU ld. Make sure you run
647     just-fixinc if you use a binary distribution. Better is to
648     get a binary version and use that to bootstrap gcc from
649     source.
650
651     GNU software is available from: 
652
653     prep.ai.mit.edu:/pub/gnu
654     gatekeeper.dec.com:/pub/GNU
655     ftp.uu.net:/systems/gnu
656     wuarchive.wustl.edu:/mirrors/gnu
657     nic.funet.fi:/pub/gnu
658
659     When you install gcc, don't make the mistake of installing
660     GNU binutils or GNU libc, they are not as capable as their
661     counterparts you get with Solaris 2.x.
662
663 6.11) I can't get perl 4.036 to compile or run. 
664
665     Run Configure, and use the solaris_2_0 hints, don't use the
666     solaris_2_1 hints and don't use the config.sh you may
667     already have. First you must make sure Configure and make
668     don't find /usr/ucb/cc. (It must use gcc or the native C
669     compiler: /opt/SUNWspro/bin/cc)
670
671     Some questions need a special answer. 
672
673     Are your system (especially dbm) libraries compiled with
674     gcc? [y] y
675
676     yes: gcc 2.3.3 or later uses the standard calling
677     conventions, same as Sun's C.
678
679     Any additional cc flags? [ -traditional -Dvolatile=__volatile__
680     -I/usr/ucbinclude] -traditional -Dvolatile=__volatile__
681
682     Remove /usr/ucbinclude. 
683
684     Any additional libraries? [-lsocket -lnsl -ldbm -lmalloc -lm
685     -lucb] -lsocket -lnsl  -lm
686
687     Don't include -ldbm, -lmalloc and -lucb. 
688
689     Perl 5 compiles out of the box. 
690
691 ----------------------------------------------------------------
692
693 64-bitness, from Alan Burlison (added by jhi 2000-02-21)
694
695   You need a machine running Solaris 2.7 or above.
696
697   Here's some rules:
698   
699   1. Solaris 2.7 and above will run in either 32 bit or 64 bit mode,
700      via a reboot.
701   2. You can build 64 bit apps whilst running 32 bit mode and vice-versa.
702   3. 32 bit apps will run under Solaris running in either 32 or 64 bit mode.
703   4. 64 bit apps require Solaris to be running 64 bit mode
704   5. It is possible to select the appropriate 32 or 64 bit version of an
705      app at run-time using isaexec(3).
706   6. You can detect the OS mode using "isainfo -v", e.g.
707       fubar$ isainfo -v   # Ultra 30 in 64 bit mode
708       64-bit sparcv9 applications
709       32-bit sparc applications
710   7. To compile 64 bit you need to use the flag "-xarch=v9".
711      getconf(1) will tell you this, e.g.
712       fubar$ getconf -a | grep v9
713       XBS5_LP64_OFF64_CFLAGS:         -xarch=v9
714       XBS5_LP64_OFF64_LDFLAGS:        -xarch=v9
715       XBS5_LP64_OFF64_LINTFLAGS:      -xarch=v9
716       XBS5_LPBIG_OFFBIG_CFLAGS:       -xarch=v9
717       XBS5_LPBIG_OFFBIG_LDFLAGS:      -xarch=v9
718       XBS5_LPBIG_OFFBIG_LINTFLAGS:    -xarch=v9
719       _XBS5_LP64_OFF64_CFLAGS:        -xarch=v9
720       _XBS5_LP64_OFF64_LDFLAGS:       -xarch=v9
721       _XBS5_LP64_OFF64_LINTFLAGS:     -xarch=v9
722       _XBS5_LPBIG_OFFBIG_CFLAGS:      -xarch=v9
723       _XBS5_LPBIG_OFFBIG_LDFLAGS:     -xarch=v9
724       _XBS5_LPBIG_OFFBIG_LINTFLAGS:   -xarch=v9
725
726   > > Now, what should we do, then?  Should -Duse64bits in a v9 box cause
727   > > Perl to compiled in v9 mode?  Or should we for compatibility stick
728   > > with 32 bit builds and let the people in the know to add the -xarch=v9
729   > > to ccflags (and ldflags?)?
730
731   > I think the second (explicit) mechanism should be the default.  Unless
732   > you want to allocate more than ~ 4Gb of memory inside Perl, you don't
733   > need Perl to be a 64-bit app.  Put it this way, on a machine running
734   > Solaris 8, there are 463 executables under /usr/bin, but only 15 of
735   > those require 64 bit versions - mainly because they invade the kernel
736   > address space, e.g. adb, kgmon etc.  Certainly we don't recommend users
737   > to build 64 bit apps unless they need the address space.
738
739 End_of_Solaris_Notes