in the meantime, i've been building on hpux with -Accflags=+Z which works
fine. (also required for 5.6.1)
from the cc manpage...
+z,+Z Both of these options cause the compiler to
generate position independent code (PIC) for use in
building shared libraries. +Z is the default in
64-bit mode. The -G and -p options are ignored if
+z or +Z is used. Normally, +z should be used to
generate PIC; however, when certain limits are
exceeded, +Z is required to generate PIC. The ld
linker issues the error indicating when +Z is
required. If both +z and +Z are specified, only the
last one encountered applies.
passes all tests:
Summary of my perl5 (revision 5.0 version 7 subversion 3 patch 16749) configuration:
Platform:
osname=hpux, osvers=11.00, archname=PA-RISC2.0-thread-multi
uname='hp-ux horace b.11.00 a 9000785 2010607443 two-user license '
config_args='-des -Dprefix=/local0/tmp/dougm/perl -Accflags=+Z -Dusedevel -Doptimize=-g -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags =' -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DDEBUGGING -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',
optimize='-g',
cppflags='-Aa -D__STDC_EXT__ -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DDEBUGGING -I/usr/local/include'
ccversion='B.11.11.02', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='/usr/bin/ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lnsl -lnm -lndbm -lmalloc -ldld -lm -lpthread -lc -lndir -lcrypt -lsec
perllibs=-lnsl -lnm -lmalloc -ldld -lm -lpthread -lc -lndir -lcrypt -lsec
libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='+Z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
DEVEL16734
Built under hpux
Compiled at May 22 2002 18:43:02
@INC:
/local0/tmp/dougm/perl/lib/5.7.3/PA-RISC2.0-thread-multi
/local0/tmp/dougm/perl/lib/5.7.3
/local0/tmp/dougm/perl/lib/site_perl/5.7.3/PA-RISC2.0-thread-multi
/local0/tmp/dougm/perl/lib/site_perl/5.7.3
/local0/tmp/dougm/perl/lib/site_perl
.
But +Z *is* default when using HP's C compiler, and it is set in line 394
cccdlflags='+Z'
Though I personally would not object in promoting this flag to ccflags, since
it does not /harm/ static builds.
Any objections?
> in the meantime, i've been building on hpux with -Accflags=+Z which works
> fine. (also required for 5.6.1)
Does converting libperl.a to libperl.sl work?
# mkdir tmp
# cd tmp
# ar x ../libperl.a
# ld -b -o libperl.sl *.o
# mv libperl.sl ..
# cd ..
# rm -rf tmp
/If/ all objects were created with +Z, this should work
--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.7.3 & 631 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11. Smoking perl CORE: smo...@perl.org
http://archives.develooper.com/daily...@perl.org/ per...@perl.org
send smoke reports to: smokers...@perl.org, QA: http://qa.perl.org
Go ahead (with a patch).
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
I *think* this would be OK, but I'm not sure about removing the +Z from ...
Any implications? I think ... is always used together with $ccflags, so I'm
safe here. Second pair of eyes please
All tests successful.
u=3.03 s=1.18 cu=241.85 cs=17.75 scripts=658 tests=64177
--- hints/hpux.sh 2002-05-16 16:51:26.000000000 +0200
+++ hints/hpux.sh 2002-05-23 13:39:28.000000000 +0200
@@ -137,7 +137,12 @@ case `$cc -v 2>&1`"" in
ccversion=`which cc | xargs what | awk '/Compiler/{print $2}'`
case "$ccflags" in
"-Ae "*) ;;
- *) ccflags="-Ae $cc_cppflags -Wl,+vnocompatwarnings" ;;
+ *) ccflags="-Ae $cc_cppflags -Wl,+vnocompatwarnings" ;;
+ esac
+ case "$ccflags" in
+ *"+Z"*) ;;
+ *"+z"*) ccflags=`echo "$ccflags" | sed -e 's/\+z/+Z/'` ;;
+ *) ccflags="$ccflags +Z" ;;
esac
# Needed because cpp does only support -Aa (not -Ae)
cpplast='-'
@@ -391,7 +396,7 @@ case "$ccisgcc" in
;;
esac
ld=/usr/bin/ld
- cccdlflags='+Z'
+ cccdlflags=''
lddlflags='-b +vnocompatwarnings'
;;
esac
> But +Z *is* default when using HP's C compiler, and it is set in line 394
>
> cccdlflags='+Z'
that does not get applied to sources in libperl.a, maybe it should?
just noticed this comment in the main Makefile:
# Static targets are ordinarily built without CCCDLFLAGS. However,
# if building a shared libperl.so that might later be linked into
# another application, then it might be appropriate to also build static
# extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
# for GNU cc). This is handled by ext/util/make_ext.
libperl.a should be considered the same way as DynaLoader.a, that might
get linked into another app.
was about to see if -fPIC is applied on solaris, perl-current chokes here:
make: *** No rule to make target `wince.h', needed by `perl.h'. Stop.
puzzling.
really puzzling. Why did you noticed wince.h at all?
Even wince's elder brother Win32 should not depend on WinCE in any way.
Which line? Which extension?
Vadim.
> On Thu, 23 May 2002, H.Merijn Brand wrote:
>
> > But +Z *is* default when using HP's C compiler, and it is set in line 394
> >
> > cccdlflags='+Z'
>
> that does not get applied to sources in libperl.a, maybe it should?
>
> just noticed this comment in the main Makefile:
> # Static targets are ordinarily built without CCCDLFLAGS. However,
> # if building a shared libperl.so that might later be linked into
> # another application, then it might be appropriate to also build static
> # extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
> # for GNU cc). This is handled by ext/util/make_ext.
>
> libperl.a should be considered the same way as DynaLoader.a, that might
> get linked into another app.
But libperl.a is not a shared library (it would be libperl.sl on HP/UX, I
think).
There is (or at least there was when I tested it some years ago) a
potentially significant performance penalty involved in building libperl.a
with PIC code. If you weren't going to link libperl into another app,
then it seemed inappropriate to pay the penalty.
I think that -fPIC (or +Z or whatever) ought to be invoked only if needed.
Or, alternatively, it ought not to be invoked when not needed.
Phrased differently, I would object on performance grounds to adding in
-fPIC all the time even when I definitely don't want it. However, a patch
to make building a shared libperl.sl the default (overrideable by
-Uuseshrplib or some such) might be reasonable.
> was about to see if -fPIC is applied on solaris, perl-current chokes here:
> make: *** No rule to make target `wince.h', needed by `perl.h'. Stop.
I've seen that before. It's usually some sort of half-complete build or
timestamp weirdness (esp. on NFS with drifting clocks). Restarting with a
clean distribution (or fixing up time stamps) probably will make it go
away.
--
Andy Dougherty doug...@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
DynaLoader.a is not a shared library either, but the comment seemed to
imply cccdlflags are applied to it. i see that is not the case now, at
least i don't see it happening on hpux.
> There is (or at least there was when I tested it some years ago) a
> potentially significant performance penalty involved in building libperl.a
> with PIC code. If you weren't going to link libperl into another app,
> then it seemed inappropriate to pay the penalty.
>
> I think that -fPIC (or +Z or whatever) ought to be invoked only if needed.
> Or, alternatively, it ought not to be invoked when not needed.
fair enough. modperl's Makefile.PL has a check tells the use to rebuild
with -Accflags=+Z if needed. would be interesting to see modern day
benchmarks with and without +Z.
> I've seen that before. It's usually some sort of half-complete build or
> timestamp weirdness (esp. on NFS with drifting clocks). Restarting with a
> clean distribution (or fixing up time stamps) probably will make it go
> away.
that did the trick, thanks.
HP 9000/A500 (rp2450) / 1Gb / HP-UX 11.00 / HPc B.11.11.04
All objects +Z (+Z in ccflags):
All tests successful.
u=3.03 s=1.18 cu=241.85 cs=17.75 scripts=658 tests=64177
Previous (current) situation:
All tests successful.
u=2.79 s=1.04 cu=232.08 cs=16.62 scripts=658 tests=64177
speed loss of 3-9%
Jarkko: Don't apply
> I think that -fPIC (or +Z or whatever) ought to be invoked only if needed.
> Or, alternatively, it ought not to be invoked when not needed.
This is a valid argument.
> Phrased differently, I would object on performance grounds to adding in
convinced
> -fPIC all the time even when I definitely don't want it. However, a patch
> to make building a shared libperl.sl the default (overrideable by
> -Uuseshrplib or some such) might be reasonable.
Sounds OK. But if performance *is/was* an issue, I'd make the static build the
default.
top-level 'make', that's all i get:
make: *** No rule to make target `wince.h', needed by `perl.h'. Stop.
nothing else. starting over with a fresh tree as andy suggests cured the
problem.
> On Thu, 23 May 2002, Andy Dougherty wrote:
>
> > But libperl.a is not a shared library (it would be libperl.sl on HP/UX, I
> > think).
>
> DynaLoader.a is not a shared library either, but the comment seemed to
> imply cccdlflags are applied to it. i see that is not the case now, at
> least i don't see it happening on hpux.
cccdlflags are applied to DynaLoader.a only if the user is building a
shared libperl. (That is, static_target=static_pic only if $useshrplib
is true. This is handled earlier in Makefile.SH.)
And yes, it's an obscure inelegant way to set (or not set) -fPIC (or
equivalent) but I stared at it off and on for 2 days and didn't think of
anything more elegant. :-(
> fair enough. modperl's Makefile.PL has a check tells the use to rebuild
> with -Accflags=+Z if needed. would be interesting to see modern day
> benchmarks with and without +Z.
"Modern day"? The same hardware I did those old benchmarks on is still my
main system!
--
Andy Dougherty doug...@lafayette.edu
I seem to have been using the attached patch for a while now.
HTH,
Sarathy
gs...@ActiveState.com
-----------------------------------8<-----------------------------------
--- perl/ext/util/make_ext Thu Apr 5 22:25:53 2001
+++ ./ext/util/make_ext Mon Jun 4 17:49:32 2001
@@ -88,7 +88,12 @@
# check link type and do any preliminaries
case "$target" in
# convert 'static' or 'dynamic' into 'all LINKTYPE=XXX'
-static) makeargs="LINKTYPE=static CCCDLFLAGS="
+static) case "$mname" in
+ # For Apache, DynaLoader needs the CCCDLFLAGS variable
+ # (+z/+Z/-fpic/-fPIC) to stick around
+ *DynaLoader*) makeargs="LINKTYPE=static" ;;
+ *) makeargs="LINKTYPE=static CCCDLFLAGS=" ;;
+ esac
target=all
;;
dynamic) makeargs="LINKTYPE=dynamic";
End of Patch.
> I seem to have been using the attached patch for a while now.
[omitted]
That's almost always fine, but my patch [16356] avoids adding the -fPIC if
you're not building a shared libperl (in which case DynaLoader is probably
the least of your problems -- hence the origin of this thread) and also
correctly adds the -fPIC to all static extensions (though usually that's
just DynaLoader).
As I recall, I needed the patch to make mod_perl build its *.so's
properly (because mod_perl links with libperl.a and DynaLoader.a?).
I was not building a shared libperl per se.
>(in which case DynaLoader is probably
>the least of your problems -- hence the origin of this thread) and also
>correctly adds the -fPIC to all static extensions (though usually that's
>just DynaLoader).
Sarathy
gs...@ActiveState.com