On Tue, 20 Mar 2007, chromatic wrote:
> On Tuesday 20 March 2007 12:25, Andrew Dougherty wrote:
>
> > On Mon, 19 Mar 2007, chromatic wrote:
>
> > > I realize this patch precludes cross-compilation at the moment, but does
> > > it work better for you, Andy?
> >
> > Alas, no. Here's what I get (again with --verbose=2). I don't know why
> > it's reporting that the compiler is failling, and I don't know how to
> > coax Configure to give me any more information (short of sprinking
> > printf()s throughout).
> >
> > I can definitely compile that test program with the indicated flags. I
> > don't have time to look at this further, however.
>
> Alright, I'll work on a better patch. We've pulled the previous one from the
> upcoming release.
Ok. I've figured out what was going wrong:
+ unless ( eval { cc_build(); 1 } ) {
+ warn "Compilation failed with '$cc'\n";
+ exit 1;
+ }
This has two problems. First, it ignores the return value of cc_build().
That's understandable at the moment since cc_build doesn't seem to have a
documented return value. It should, of course.
The second problem is that this construct doesn't check for other errors
in the eval. Putting in C< warn $@ if $@;> reveals the problem:
Determining what C compiler and linker to use...Unknown open() mode '>&'
at lib/Parrot/Configure/Step.pm line 437.
Configure/Step.pm is apparently using a 3-arg open construct not
understood by my perl-5.6.2 version. But according to README:
You'll also need Perl 5.6.1 or above to run various configure and
build scripts.
The README is also consistent with this line in Configure.pl:
use 5.006_001;
So all that needs to be straightened out somehow, either by changing the
3-arg opens or by upping the perl version requirement.
Moving on:
+ unless ( eval { cc_run(); 1 } ) {
+ warn $@ if $@;
+ exit 1;
+ }
This also has the same ignoring-error return problem, but it's more
serious. If the program runs but fails (e.g. segfaults, or returns a
non-zero status) this bit of code happily continues on. I think it
probably shouldn't under such circumstances.
Of course, even after fixing those things, it still doesn't even come
close to working. More about that tomorrow as I try to sort out all the
other problems. Sigh.
--
Andy Dougherty [EMAIL PROTECTED]