a few proposed patches
Ken Raeburn <raeburn <at> raeburn.org>
2012-05-21 05:45:50 GMT
After reading the "dynamic ffi and C struct" thread this weekend, I started thinking, "I wonder if that's
really done so as to handle X and Y and Z, and if we're actually testing it well enough", and got the urge to do
another Mac build, which I hadn't done in a while. After installing libgc 7.2 to get around flaky failures,
and fighting with the build system a bit (I have gmp installed via Macports, and that tree also has libgc
7.1…), and waiting hours for builds to finish and looking into why, I have a few patches to propose. I've
uploaded them to the branch wip-raeburn-misc for review, since I'm not sure you'll want to address the
issues the same way.
* Eliminate use of GC_PTR. Looks like it's a holdover from earlier versions of libgc. Some versions don't
define it, so we do. Apparently the 7.2 release defines it, too, which resulted in bug #11500. It turns out,
too, that some of the casts weren't quite right (casting to GC_PTR when GC_PTR* was needed), and only
worked because GC_PTR is void* and thus can be converted to the correct type; I've tried to fix up those
cases. The change discards some minor abstraction of the pointer interface to libgc, but I don't think we
really need an abstract name for void* anyways.
* Don't use addresses of code labels with LLVM, even if the compiler supports them. At least with the version
of LLVM GCC on my Mac ("gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)"), the
performance seems to be quite poor; "guild compile" was showing about a 4x penalty in CPU time. (For
psyntax-pp.go, it was 10 minutes of CPU time vs 46 minutes.) Later/future versions may do better, so we can
update it with version-number checks, unless we want to build performance tests into the configure
script, which doesn't sound like a great idea to me. Related to this, I made two more changes: Always define
statement labels in the VM code anyway, because vm-i-scheme.c uses some of them unconditionally (which
makes me wonder if any non-GCC configs are getting tested); and report the time taken for each "guild
compile" command during the build.
* Require libgc 7.2 or better. Too often the fix to flaky problems seems to be "try updating to the latest
libgc and see if that fixes it", so let's just require it. Or is 7.1 really *that* consistently reliable for
our use cases on some platforms? I decided to go with a test in the C code because I was having problems with
include directory ordering for a while on my system, with both 7.1 and 7.2 installed. A configure-time
check would work fine in addition, but the C check takes effect after the various include directories for
(Continue reading)