In Haskell FFI, "ccall" is actually an interface to C ABI rather than
C API. That is, GHC generates direct references to the symbol even if
it's actually defined as a cpp macro or something like that, because
GHC knows nothing about those macros in foreign headers.
I will later send these patches to the upstream.
The problem only occurs when $(WhatGccIsCalled) is an absolute path to
the "real" gcc (e.g. "/usr/bin/gcc"), which happens if we run
${WRKSRC}/configure with an option something like
"--with-gcc=/usr/bin/gcc". As long as we use "--with-gcc" with a
command name (i.e. ${CC}, not ${CCPATH}), everything works fine
without any problems.
This is because dtrace(1) executes cpp in a rather weird way: it calls
execvp("/usr/bin/gcc", argv) with argv set to {"gcc", "-E", "-xc",
...}, not {"/usr/bin/gcc", "-E", "-xc", ...}.
When GCC is called that way, it needs to find platform-specific
subprograms by walking through ${PATH}. And if it sees an executable
named "gcc" which in fact isn't actually gcc, it gets confused and
dies with an error:
% cat dtrace-emu.c
#include <unistd.h>
#include <stdio.h>
int main() {
char *argv[] = {"gcc", "-E", NULL};
execvp("/usr/bin/gcc", argv);
return 0;
}
% gcc dtrace-emu.c -o /tmp/gcc
% /tmp/gcc
powerpc-apple-darwin9-gcc-4.0.1: no input files
% PATH=/tmp/gcc /tmp/gcc
gcc: installation problem, cannot exec '/tmp/powerpc-apple-darwin9-gcc-4.0.1':
No such file or directory
And even if the problem should really be addressed, it should be done
in the wrapper framework because dtrace(1) is actually a part of
compiler toolchain.
The installed GHC has already been working without the ld hack. These
changes should only affect the package build so revbump isn't needed.
Makefile (CONFIGURE_ENV):
Refactored with no semantic changes.
Makefile (post-patch):
${WRKSRC}/libraries/base/configure.ac is patched too.
Makefile (CHECK_SHLIBS_SUPPORTED):
Removed the variable as the package now supports it.
Makefile (CHECK_SHLIBS_SKIP):
Added to skip checks for dynamic Haskell libraries. See the comment
for details.
bootstrap.mk (pre-configure):
Use ${CONFIGURE_ENV} when configuring the stage-0 compiler. See the
comment for details.
patches/patch-libraries_base_configure.ac:
Added to prevent {CPP,LD}FLAGS from being clobbered. See the comment
for details. I will send the patch to the upstream in a few days or
weeks (or even months, depending on my busyness).
* Install the libffi libtool archive. Whilst it is unused, it allows
us to automatically determine the shared library suffix.
* Switch the i386 SunOS bootstrap to .xz.
* Use PKG_CC to build lndir to help environments where the compiler is
not in $PATH.
* Apply patch from Alain O'Dea to fix issues with files residing on
read-only file systems.
* Support shared libraries on 64-bit SunOS.
* Fix typo in patches/patch-rts_Linker.c.
Fixes build on SunOS. Bump PKGREVISION.
Based on wip/ghc, mostly worked by phonohawk, with patches from jperkin@.
And some modifications and buit of Bootstrap binaries for 7.6.3 by me.
GHC: The Glasgow Haskell Compiler.
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler for the functional programming language Haskell 98
(http://www.haskell.org). GHC compiles Haskell to either native code
or C. It implements numerous experimental language extensions to
Haskell, including concurrency, a foreign language interface, several
type-system extensions, exceptions, and so on. GHC comes with a
generational garbage collector, a space and time profiler, and a
comprehensive set of libraries.