darcs patch: Unbreak the GHC build with older versions of gcc

Thu Aug 28 16:27:43 CEST 2008 kili@outback.escape.de * Unbreak the GHC build with older versions of gcc Stg.h must be included before HsBase.h, because the latter contains function definitions causing older versions of gcc (3.3.5 in my case) to bail out with "error: global register variable follows a function definition" on Regs.h, which is included by Stg.h.

On Thu, Aug 28, 2008 at 09:50:19PM +0200, kili@outback.escape.de wrote:
Thu Aug 28 16:27:43 CEST 2008 kili@outback.escape.de * Unbreak the GHC build with older versions of gcc
Stg.h must be included before HsBase.h, because the latter contains function definitions causing older versions of gcc (3.3.5 in my case) to bail out with "error: global register variable follows a function definition" on Regs.h, which is included by Stg.h.
hunk ./cbits/PrelIOUtils.c 8 -#include "HsBase.h" hunk ./cbits/PrelIOUtils.c 9 +#include "HsBase.h"
This breaks the build for me: Building ghc-bin-6.9... [1 of 1] Compiling Main ( Main.hs, dist-stage2/build/ghc/ghc-tmp/Main.o ) Linking dist-stage2/build/ghc/ghc ... /home/ian/ghc/darcs/ghc/libraries/base/dist/build/libHSbase-4.0.a(Internals.o):(.text+0x24): undefined reference to `__hscore_s_issock' /home/ian/ghc/darcs/ghc/libraries/base/dist/build/libHSbase-4.0.a(Internals.o): In function `s3qd_info': (.text+0x2435): undefined reference to `__hscore_s_issock' /home/ian/ghc/darcs/ghc/libraries/base/dist/build/libHSbase-4.0.a(Internals.o): In function `s3qB_info': (.text+0x26c8): undefined reference to `__hscore_s_issock' /home/ian/ghc/darcs/ghc/libraries/base/dist/build/libHSbase-4.0.a(Internals.o): In function `s3uh_info': (.text+0x61e6): undefined reference to `__hscore_s_issock' collect2: ld returned 1 exit status I haven't looked at why yet. Thanks Ian

On Sun, Aug 31, 2008 at 08:19:54PM +0100, Ian Lynagh wrote:
On Thu, Aug 28, 2008 at 09:50:19PM +0200, kili@outback.escape.de wrote:
Thu Aug 28 16:27:43 CEST 2008 kili@outback.escape.de * Unbreak the GHC build with older versions of gcc
Stg.h must be included before HsBase.h, because the latter contains function definitions causing older versions of gcc (3.3.5 in my case) to bail out with "error: global register variable follows a function definition" on Regs.h, which is included by Stg.h.
hunk ./cbits/PrelIOUtils.c 8 -#include "HsBase.h" hunk ./cbits/PrelIOUtils.c 9 +#include "HsBase.h"
This breaks the build for me:
I haven't looked at why yet.
It turned out that something in Stg.h, perhaps _ISOC99_SOURCE, meant S_ISSOCK wasn't being defined. I defined _BSD_SOURCE too, and now it's happy, so I've applied your patch (well, actually a new patch that does the same thing, because yours now conflicts with more recent changes). Thanks Ian
participants (2)
-
Ian Lynagh
-
kili@outback.escape.de