Ticket #3642 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

GHC does not build using the Haskell Platform on Windows

Reported by: simonmar Owned by: igloo
Priority: high Milestone: 6.12.2
Component: Build System Version: 6.10.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

We still have issues with paths containing spaces in the build system. I have fixed some of them, but there are more (that are not easy to fix). The current bug I ran into is in rules/distdir-way-opts.mk where we make the HSC2HS_OPTS by prepending --cflag/--lflag to the beginning of CC_OPTS and LD_OPTS respectively, that doesn't know where the word breaks in CC_OPTS/LD_OPTS are supposed to be.

Change History

Changed 4 years ago by simonmar

Some fixes have been committed:

Wed Nov  4 08:43:43 PST 2009  Simon Marlow <marlowsd@gmail.com>
  * Fix some bugs to do with tools in paths containing spaces

Thu Nov  5 06:13:10 PST 2009  Simon Marlow <marlowsd@gmail.com>
  * Fix #3642: m GHC builds using the Haskell Platform

I still have a build failure when using -split-objs, which I'm trying to track down.

Changed 4 years ago by igloo

I've merged those two to 6.12.

Changed 3 years ago by igloo

  • owner set to igloo
  • failure set to None/Unknown

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

I've just built the HEAD with the Haskell Platform on Windows, with no problems encountered.

Changed 3 years ago by simonmar

With -split-objs?

Changed 3 years ago by igloo

  • status changed from closed to reopened
  • resolution fixed deleted

Ah, that breaks with a load of

ghc\stage2\build\Main.o:fake:(.text+0x2f01): undefined reference to `base_GHCziBase_zzeroInt_closure'
ghc\stage2\build\Main.o:fake:(.text+0x20d): undefined reference to `base_GHCziBase_unpackCStringzh_info'

when running

"inplace/bin/ghc-stage1.exe" -o ghc/stage2/build/tmp/ghc-stage2.exe   -H32m -O -Wall -Werror -H64m -O0     -i -ighc/. -ighc/stage2/build -ighc/stage2/build/autogen -Ighc/stage2/build -Ighc/stage2/build/autogen        -O2 -O -DGHCI -threaded -package ghc-6.13.20100321 -package haskeline -XCPP -XPatternGuards -XForeignFunctionInterface -XUnboxedTuples -XFlexibleInstances -XMagicHash -no-user-package-conf -rtsopts     -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -hisuf hi -osuf  o -hcsuf hc  ghc/stage2/build/Main.o ghc/stage2/build/GhciMonad.o ghc/stage2/build/GhciTags.o ghc/stage2/build/InteractiveUI.o ghc/stage2/build/hschooks.o

Changed 3 years ago by igloo

Looks like this problem is caused by ar replacing object files in libraries, which happens when xargs adds them in different ar invocations:

$ AR="c:/Program Files/Haskell Platform/2009.2.0.2/bin/ar"
$ rm z.a
$ "$AR" clqs z.a Data/ByteString/Char8_o_split/Char8__11.o Data/ByteString/Lazy/Char8_o_split/Char8__11.o
$ ls -l z.a
-rwxr-xr-x 1 ian None 3548 2010-03-23 20:01 z.a
$ nm z.a | grep bytestringzm0zi9zi1zi5_DataziByteStringziChar8_readFile1_closure
00000014 D _bytestringzm0zi9zi1zi5_DataziByteStringziChar8_readFile1_closure
$ rm z.a
$ "$AR" clqs z.a Data/ByteString/Char8_o_split/Char8__11.o
$ "$AR" clqs z.a Data/ByteString/Lazy/Char8_o_split/Char8__11.o
$ ls -l z.a
-rwxr-xr-x 1 ian None 678 2010-03-23 20:01 z.a
$ nm z.a | grep bytestringzm0zi9zi1zi5_DataziByteStringziChar8_readFile1_closure

The same thing happens with all these ar's:

$ "c:/Program Files/Haskell Platform/2009.2.0.2/bin/ar" --version
GNU ar 2.17.50 20060824
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

$ "../../../../inplace/mingw/bin/ar" --version
GNU ar (GNU Binutils) 2.19.1
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

$ "/usr/bin/ar" --version
GNU ar (GNU Binutils) 2.19.51.20090704
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

Changed 3 years ago by simonmar

Is this something specific to the Haskell platform, or is -split-objs generally broken on Windows right now?

Changed 3 years ago by igloo

It's not HP-specific. I've got a fix for it; just trying to make it work on OS X too.

I've also got a patch to strip out '\r's in hsc2hs, now that we open files in binary mode.

Changed 3 years ago by igloo

  • status changed from reopened to closed
  • resolution set to fixed

The above is now fixed in 6.12 and HEAD:

Tue Mar 23 15:13:25 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Tweak the Makefile code for making .a libs; fixes trac #3642
  The main change is that, rather than using "xargs ar" we now put
  all the filenames into a file, and do "ar @file". This means that
  ar adds all the files at once, which works around a problem where
  files with the same basename in a later invocation were overwriting
  the existing file in the .a archive.

Wed Mar 24 06:29:07 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Fix the build for non-GNU-ar

Wed Mar 24 09:20:43 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Quote the ar path in configure

Tue Mar 23 17:06:55 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Strip out ^M characters to stop gcc getting confused
Note: See TracTickets for help on using tickets.