pkgsrc/lang/ghc-bootstrap/patches/patch-ar
dholland beed0c4b0d Add a ghc-bootstrap package for making ghc binary bootstrap kits.
This is a ghc 6.8.3 package based on lang/ghc.

As of ghc 7.something, the old system of bootstrapping ghc from
generated C sources has been deprecated. While in theory we could move
pkgsrc up to that point using C bootstrap kits like the one currently
used by lang/ghc, there are several reasons not to: (1) it's a dead
end; (2) there is no available infrastructure for building such kits,
as in the past it was done by hand by the package maintainer; (3)
building ghc from C sources wasn't ever really fully supported anyway
and usually requires fiddling to make it work.

For this reason, by the power invested in me as one of the few people
who actually uses ghc for something nontrivial (much as I perhaps
regret doing so)... we will switch to binary bootstrap kits now.

The bootstrap kits generated here are just installable ghc packages
under a different name. This package depends on lang/ghc and uses the
installed ghc to build another copy; then that copy becomes the
bootstrap kit. That is, the bootstrap kit is the pkgsrc package you
get by doing 'make package' in this directory.

I have a (tested and working) patch to switch lang/ghc to use a new
bootstrap kit generated here, but I am intentionally holding off on
committing it until after 2013q4 is branched. That way anyone who
wants a bootstrap kit for a platform currently supported by lang/ghc
can get one by checking out 2013q4, building ghc, and then building
ghc-bootstrap.

Note that these bootstrap kits cannot be used with the wip/ghc
package; it uses a built but not installed ghc source tree as the
bootstrap kit. You can capture one of these from here if you really
want to by doing 'make' and then tarring up work/ghc-6.8.3... I think.
I haven't tested that, and for now it won't work anyway as wip/ghc is
too many versions ahead for such a build to be supported.

Because ghc can only be built with a recent ghc, updating lang/ghc to
a recent version will require a ping/pong process with ghc and
ghc-bootstrap. This is the chief reason to have a separate
ghc-bootstrap package; it should be perfectly possible to build
lang/ghc with a lang/ghc package as the bootstrap too.
2013-12-15 02:00:07 +00:00

22 lines
577 B
Text

$NetBSD: patch-ar,v 1.1 2013/12/15 02:00:07 dholland Exp $
--- rts/Linker.c.orig 2008-07-19 19:54:17.000000000 +0200
+++ rts/Linker.c 2008-07-19 19:55:39.000000000 +0200
@@ -2612,10 +2612,16 @@
#define Elf_Sym Elf64_Sym
#define Elf_Rel Elf64_Rel
#define Elf_Rela Elf64_Rela
-#if !defined(freebsd_HOST_OS)
+#ifndef ELF_ST_TYPE
#define ELF_ST_TYPE ELF64_ST_TYPE
+#endif
+#ifndef ELF_ST_BIND
#define ELF_ST_BIND ELF64_ST_BIND
+#endif
+#ifndef ELF_R_TYPE
#define ELF_R_TYPE ELF64_R_TYPE
+#endif
+#ifndef ELF_R_SYM
#define ELF_R_SYM ELF64_R_SYM
#endif
#else