osdir.com
mailing list archive

Subject: Hints for 64bitall (PPC!) Darwin perl - msg#00071

List: lang.perl.macosx

Date: Prev Next Index Thread: Prev Next Index
From the "la la la la, life goes on" department:

Here's a preliminary patch against perl patchlevel 24717 to make 64bitall perl build on Mac OS 10.4.x (Darwin 8.x):

--- perl-current-64bitall/hints/darwin.sh-as-received 2005-05-11 12:09:35.000000000 +0200
+++ perl-current-64bitall/hints/darwin.sh 2005-06-07 10:25:45.000000000 +0200
@@ -152,7 +152,12 @@
;;
esac
-cccdlflags=' '; # space, not empty, because otherwise we get -fpic
+case "$ccdlflags" in # If passed in from command line, presume user knows best
+'')
+ cccdlflags=' '; # space, not empty, because otherwise we get -fpic
+;;
+esac
+
# Perl bundles do not expect two-level namespace, added in Darwin 1.4.
# But starting from perl 5.8.1/Darwin 7 the default is the two-level.
case "$osvers" in
@@ -190,6 +195,42 @@
esac
EOCBU
+# 64-bit addressing support. Currently strictly experimental. DFD 2005-06-06
+if [ "$use64bitall" ]
+then
+case "$osvers" in
+[1-7].*)
+ cat <<EOM >&4
+
+
+
+*** 64-bit addressing is not supported for Mac OS X versions
+*** below 10.4 ("Tiger") or Darwin versions below 8. Please try
+*** again without -D64bitall. (-D64bitint will work, however.)
+
+EOM
+ exit 1
+ ;;
+*)
+ cat <<EOM >&4
+
+
+
+*** Perl 64-bit addressing support is experimental for Mac OS X
+*** 10.4 ("Tiger") and Darwin version 8. Expect a number of test
+*** failures:
+*** ext/IO/io_* ext/IPC/sysV/t/* lib/Net/Ping/t/450_service
+*** Any test that uses sdbm
+
+EOM
+ for var in ccflags cppflags ld ldflags
+ do
+ eval $var="\$${var}\ -arch\ ppc64"
+ done
+ ;;
+esac
+fi
+
##
# System libraries
##

To build, use Configure -de -Doptimize=-g -Duse64bitall -Dusedevel or similar.

The hints should abort configuration if -Duse64bitall is given on a pre 10.4 Mac OS X.

As a suddenly-topical side issue I had vaguely considered working out from here to try to build fat XSs.
However, the first thing to do is address the list of outstanding issues for the single-architecture build, which is quite long. This list includes only stuff which I see on a 64-bit build, but not on a 32-:

1.
perl.c: In function 'perl_construct':
perl.c:371: warning: format '%ld' expects type 'long int', but argument 3 has type 'I32'
...

Aha! The recently-added printf format checking for gcc pays a dividend. Any amount of this stuff results from many source files which call out macros containing debugging printf()s when using - Doptimize=-g. There are a few non-debugging ones too, particularly from reg*.c. The problem is that the PPC64 architecture has 64-bit long ints, which require %Ld or %lld formats for printing. It seems that Configure is trying to address this issue, but gets the wrong answer:

Checking how to print 64-bit integers...
We will use %ld.

What's more, much of the debugging code does not use the corresponding definition, IVdf, from config.h. For example, from cop.h:

#define PUSHBLOCK(cx,t,sp) CXINC, cx = &cxstack [cxstack_ix], \
cx->cx_type = t, \
...
DEBUG_l( PerlIO_printf(Perl_debug_log, "Entering block %ld, type %s\n", \
(long)cxstack_ix, PL_block_type[CxTYPE(cx)]); )

2.
regcomp.c: In function 'S_regclass':
regcomp.c:4859: warning: field width should have type 'int', but argument 3 has type 'long int'
... (3 more)

To be investigated. Appears not to result in any test failures.

3.
In file included from ../../perl.h:3970,
from SDBM_File.xs:3:
../../proto.h:48: warning: 'Perl_malloc' attribute directive ignored
... (many more of the same warning)

I don't know what's going on here. While SDBM::File builds, it fails in subsequent tests -- see point 6 below.

4.
ext/IO/t/io_multihomed....................Protocol not supported at ../ext/IO/t/io_multihomed.t line 87.
FAILED--expected 8 tests, saw 0

ext/IO/t/io_sock..........................Use of uninitialized value $type in socket at ../lib/IO/Socket.pm line 80.
Protocol not supported at ../ext/IO/t/io_sock.t line 43.
FAILED--expected 26 tests, saw 0

ext/IO/t/io_udp...........................Protocol not supported (maybe your system does not have a localhost at all, 'localhost' or 127.0.0.1) at ../ext/IO/t/io_udp.t line 60.
FAILED--expected 7 tests, saw 0

lib/Net/Ping/t/450_service................bind: Protocol not supported at ../lib/Net/Ping/t/450_service.t line 29.
# Failed test 2 in ../lib/Net/Ping/t/450_service.t at line 36
# ../lib/Net/Ping/t/450_service.t line 36 is: ok !!$sock1;
bind: Protocol not supported at ../lib/Net/Ping/t/450_service.t line 39.
FAILED at test 2

My networking set-up's OK, honest: these tests all pass with a 32-bit build. Problem in Apple's library? To be investigated.

5.

ext/IPC/SysV/t/ipcsysv....................FAILED at test 10
ext/IPC/SysV/t/msg........................FAILED at test 4
ext/IPC/SysV/t/sem........................FAILED at test 3

Again, my first thought is that Apple's System V IPC library functions crocked for 64-bit apps. This would not surprise me, but further investigation is needed: the problem could equally be either perl itself or the tests.

8.
ext/SDBM_File/t/sdbm......................dyld: lazy symbol binding failed: Symbol not found: _sdbm_open
Referenced from: ../lib/auto/SDBM_File/SDBM_File.bundle
Expected in: dynamic lookup
... (1 more)
FAILED--no leader found

lib/DBM_Filter/t/01error..................dyld: lazy symbol binding failed: Symbol not found: _sdbm_open
Referenced from: ../lib/auto/SDBM_File/SDBM_File.bundle
Expected in: dynamic lookup
... (1 more)
FAILED--expected 21 tests, saw 3
... (same for all lib/DBM_Filter/*)

lib/Memoize/t/errors......................dyld: lazy symbol binding failed: Symbol not found: _sdbm_open
Referenced from: ../lib/auto/SDBM_File/SDBM_File.bundle
Expected in: dynamic lookup
... (1 more)
FAILED--expected 11 tests, saw 5

lib/Memoize/t/tie_sdbm....................dyld: lazy symbol binding failed: Symbol not found: _sdbm_open
Referenced from: ../lib/auto/SDBM_File/SDBM_File.bundle
Expected in: dynamic lookup
... (1 more)
FAILED--no leader found

These all stem from whatever it was that went wrong in building SDBM_File.

I'll be fighting my way through these over the next few days. But if anybody wants to beat me to it, be my guest.
--
Dominic Dunlop




Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: CGI script running as a given user?

On 2005.6.7, at 11:51 PM, Rich Morin wrote: I've got a Perl CGI script that acts as a "system browser". For example, it can look at files and directories and say interesting things about them. This works fine, as long as the files are world-readable, but fails (because Apache runs as 'www') as soon as the user wanders into "private" areas. One answer to this is to launch a small-footprint web server that runs as the current user. The CGI would run under that server and all would be nifty and cool (well, not really, but OK :-). I'm wondering if I've overlooked a way to get Personal Web Sharing (aka Apache) to handle this for me. Something like "have the user authenticate via https, then launch a given CGI script with that user's uid". There's an apache module that does exactly that. I think it's called suexec or something like that. But you want to read the documentation carefully, because it has a lot of security issues that you have to understand.

Next Message by Date: click to view message preview

OT: no shine (Re: CamelBones on Intel? Maybe not.)

On 2005.6.7, at 05:47 PM, Sherm Pendley wrote: On Jun 6, 2005, at 6:18 PM, Joel Rees wrote: For me, the computer industry just lost its last little bit of shine. For me, it lost that shine years ago. When I began learning to program, everything was new. Every week, it seemed, someone was finding a new use for these gadgets. Games could be written by one person in two months. My heroes were people like Jobs, Wozniak, Nolan Bushnell, Eugene Jarvis, Richard Garriott, Sid Meier, and Roberta Williams - pioneers in every sense of the word. Shigeru Miyamoto deserves a place on that list too, but I didn't know his name back then, even though I greatly admired his work, without having a clue whose it was. These days, there's very little true innovation is going on. I hit that point with MSW3. The first tarnish was in realizing how few other people saw the magic I saw in FORTH. But it was MSW3 that opened my eyes to the fact that there really were a lot of people who really did want Bill Gates or somebody to do their thinking for them. Most of the effort is put into squeezing a few more pennies from the bottom line. Games are designed and produced by the same committee-driven process that has reduced Hollywood and the music industry to mockeries of their former selves. Things have changed, and the Almighty Buck is king now. Pragmatically, that's a good thing; it's a sign of progress towards a mature, stable industry. In another way, I can't help feeling that something valuable has been lost along the way. Any general purpose computers I buy will run AMD since I doubt I'll be able to afford PPC hardware, and I'll be scratching Mac OS X from this old iBook this weekend. Not sure if I'll load Linux or openBSD on it, since it's my server. Jobs is insane. I'm not sure I'd go quite that far. Monoculture. The only successful alternative OSses that run on x86 yet are entirely free (as in speech) and run on multiple platforms. Even FreeBSD is not just x86. I would not be going rabid if Steve had said, "Okay, due to popular request, we're going to add an architecture." or something similar. Apple has the resources to sell to multiple architectures, although it would likely mean that they would need to open up quite a bit of the userland beyond the command line. There's a good business case to be made for switching, from Apple's perspective. Only if they have blinders and and don't notice anything wrong with the picture being dangled in front of their face. It will help the supply-side problems they've been having, and broaden the appeal of their products. Oh, sure. What is this thing about iNTEL having some sort of appeal? That''s a strawman, and the people who have been arguing it will not be buying it. IBM made a few too many forward looking statements without knowing how much the fancy non-RISC address modes (etc.) were going to cost in heat and timing. But, except for certain server software where the context switch overhead (FreeBSD's giant lock, the way I read it) drags the system down, the speed is close enough when you put Macs side-by-side with x86 boxes. The server speed problems will not be fixed with iNTEL, because it's from the OS's context switching overhead. Pentium D looks good in the lab, but I'm not going to let it eat _my_ lunch in the real world. And I do not want monoculture buffer overflows killing my servers. And Cell should not be a bad option, particularly if Apple's looking at a re-compile anyway. To most developers using Cocoa or Carbon, building a "fat" binary is painless - it's a matter of checking the right box in Xcode. The problem I'm facing is that for CamelBones, because of the way Perl builds its modules, the transition will be far more painful than it will be for most apps. It's going to be painful basically for everybody who isn't already compiling cross-platform, and, as you point out about Python, painful even with some that are compiling cross-platform. I'm not seriously considering a switch to Windows or Linux, or anything along those lines. I doubt I'll ever truly and completely abandon CamelBones, either. Basically what I'm considering right now is whether I can continue making CamelBones my primary focus, or whether I should shift it to the back burner for a while and focus on something more likely to help me either find a job or make a living on my own. Well, after all the rant, I have to admit that I hope you can get CamelBones moved onto the new platform okay. Just because I'm convinced it's going to crash and burn doesn't mean everybody should give up on it. -- Joel Rees (A FORTH dreamer imprisoned in a Java world)

Previous Message by Thread: click to view message preview

CGI script running as a given user?

I've got a Perl CGI script that acts as a "system browser". For example, it can look at files and directories and say interesting things about them. This works fine, as long as the files are world-readable, but fails (because Apache runs as 'www') as soon as the user wanders into "private" areas. One answer to this is to launch a small-footprint web server that runs as the current user. The CGI would run under that server and all would be nifty and cool (well, not really, but OK :-). I'm wondering if I've overlooked a way to get Personal Web Sharing (aka Apache) to handle this for me. Something like "have the user authenticate via https, then launch a given CGI script with that user's uid". Help? -r -- email: rdm@xxxxxxxx; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.

Next Message by Thread: click to view message preview

Re: Hints for 64bitall (PPC!) Darwin perl

On 7 Jun 2005, at 17:01, I wrote: Here's a preliminary patch against perl patchlevel 24717 to make 64bitall perl build on Mac OS 10.4.x (Darwin 8.x): Two additional test failures to add to the list when built with the new compiler in just-released XCode Tools 2.1: < lib/Benchmark.............................ok --- > lib/Benchmark.............................# Failed test (../ lib/Benchmark.t at line 80) > FAILED at test 13 But runs fine every time under harness or harness -v. I notice this test has given "dubious" results in a few smokes, so I guess I'm seeing the same thing. (Test 13 fails if an estimated run time diverges too far from a measured run time.) < lib/Tie/File/t/29_downcopy................ok --- > lib/Tie/File/t/29_downcopy................FAILED at test 33 But ... $ ./perl harness ../lib/Tie/File/t/29_downcopy.t ../lib/Tie/File/t/29_downcopy....ok All tests successful. Files=1, Tests=718, 7 wallclock secs ( 1.30 cusr + 0.68 csys = 1.98 CPU) $ ./perl harness -v ../lib/Tie/File/t/29_downcopy.t ... FAILED tests 5, 7-8 Failed 3/718 tests, 99.58% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------ ------- ../lib/Tie/File/t/29_downcopy.t 718 3 0.42% 5 7-8 $ ./perl harness -v ../lib/Tie/File/t/29_downcopy.t FAILED tests 5, 7-8, 47 Failed 4/718 tests, 99.44% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------ ------- ../lib/Tie/File/t/29_downcopy.t 718 4 0.56% 5 7-8 47 Failed 1/1 test scripts, 0.00% okay. 4/718 subtests failed, 99.44% okay. $ ./perl harness -v ../lib/Tie/File/t/29_downcopy.t All tests successful. Files=1, Tests=718, 8 wallclock secs ( 1.29 cusr + 0.69 csys = 1.98 CPU) Weird. Apart from anything else, why does 29a_upcopy work consistently when downcopy fails randomly? -- Dominic Dunlop
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by