Build system issues on x86-64
I recently did a bootstrap of GHC 6.4.2 on x86-64 linux, with glibc 2.2, gcc 3.2, using a 64-bit x86 system as the host for building the HC files. I had to work out three problems to get the build to work:
- Ticket #841 (closed)
- In ghc/rts/Makefile, there is the line
WAYS=$(GhcLibWays) $(GhcRTSWays). Later, WAYS is tested against the empty string. This test does not succeed because WAYS gets the value " "; then, in code guarded by this test, syntax errors occur because WAYS is expected to contain more than whitespace. The solution was to change the line to
WAYS=$(strip $(GhcLibWays) $(GhcRTSWays)).
- The linker on ia64 will fail with "relocation truncated to fit" messages if the offset of a relative address instruction's immediate operand is too big. This happens when linking the compiler. If given the '--relax' flag, the linker will fix things up. (I'm not quite sure how it works.) I added the following to the "C compiler" section of mk/config.mk.in:
ifeq "$(HOSTPLATFORM)" "ia64-unknown-linux" # needed for generating proper relocation in large binaries SRC_CC_OPTS += -Wl,--relax SRC_HC_OPTS += -optl-Wl,--relax endif
This works, but it also produces annoying warnings that the flag is ignored when compiling .c or .hc files to .o files. Also, it should probably be a test of the architecture, not the platform.