Opened 5 years ago

Closed 5 years ago

#5543 closed bug (fixed)

Building on OS X 10.5 with XCode 3.4.1 runs into "ld: unknown option: -no_compact_unwind"

Reported by: thorkilnaur Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.3
Keywords: Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


On the tn23 build slave, which is OS X 10.5, and

$ uname -a
Darwin thorkil-naurs-intel-mac-mini.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
$ xcodebuild -version
Xcode 3.1.4
Component versions: DevToolsCore-1204.0; DevToolsSupport-1186.0
BuildVersion: 9M2809
$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-85.2.1

the build of a recent GHC HEAD fails with:

"inplace/bin/ghc-stage1" -o ghc/stage2/build/tmp/ghc-stage2 -H32m -O -hide-all-packages -i -ighc/. -ighc/stage2/build -ighc/stage2/build/autogen -Ighc/stage2/build -Ighc/stage2/build/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/autogen/cabal_macros.h -package array- -package base- -package bytestring- -package directory- -package filepath- -package ghc-7.3.20111009 -package haskeline- -package mtl- -package process- -package unix- -fno-warn-name-shadowing -Wall -XHaskell98 -XForeignFunctionInterface -XUnboxedTuples -XFlexibleInstances -XMagicHash -XNondecreasingIndentation -XCPP -XPatternGuards -O2 -threaded -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/InteractiveUI.o ghc/stage2/build/GhciMonad.o ghc/stage2/build/GhciTags.o ghc/stage2/build/hschooks.o
ld: unknown option: -no_compact_unwind
collect2: ld returned 1 exit status
make[1]: *** [ghc/stage2/build/tmp/ghc-stage2] Error 1
make: *** [all] Error 2

See for example

Best regards Thorkil

Attachments (1)

0001-FIX-BUILD-on-OS-X-10.5-Check-whether-ld-understands-.patch (4.1 KB) - added by thorkilnaur 5 years ago.
FIX BUILD on OS X 10.5: Check whether ld understands -no_compact_unwind

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by thorkilnaur

FIX BUILD on OS X 10.5: Check whether ld understands -no_compact_unwind

comment:1 Changed 5 years ago by thorkilnaur

Status: newpatch

Uploaded patch for suggested solution to this problem: Validated on Mac OS X 10.5 and Linux. Interestingly, on Linux:

checking whether ld understands -no_compact_unwind... yes

Although not ideal, this is currently harmless, at least given the conditions on -no_compact_unwind use in compiler/main/DriverPipeline.hs. And please note: I have not had the opportunity to test this under circumstances where -no_compact_unwind actually should be used.

Best regards Thorkil

comment:2 Changed 5 years ago by igloo

Resolution: fixed
Status: patchclosed

That's great; thanks Thorkil! Applied.

Note: See TracTickets for help on using tickets.