Skip to content

MacOSX powerpc gcc 3.3/4.0 and unknown symbol `_printf$LDBLStub'

There are problems with linking on MacOSX 10.4.8 when selected gcc 3.3. Following session demonstrates problem:

gracjan$ sudo gcc_select 3.3
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1819)
gracjan$ ghc --make x.hs
[1 of 1] Compiling Main             ( x.hs, x.o )
Linking x ...
ld: Undefined symbols:
_sprintf$LDBLStub
_fprintf$LDBLStub
_vfprintf$LDBLStub
gracjan$ sudo gcc_select 4.0
Default compiler has been set to:
gcc version 4.0.1 (Apple Computer, Inc. build 5363)
gracjan$ ghc --make x.hs
Linking x ...
gracjan$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.6

Linking manually with -lSystemStubs fixes the problem. Seems to be connected with Ticket #1018 (closed), where the solution is to only add -lSystemStubs when build evironment says so. Probably adding it always could be a solution.

Affected: ghc-6.6-ppc-apple-darwin.tar.gz from http://haskell.org/ghc/download_ghc_66.html, also macports:

gracjan$ port info ghc
ghc 6.6, Revision 2, lang/ghc (Variants: darwin_6, darwin_7_powerpc, darwin_8_powerpc, darwin_8_i386, noopengl)
http://www.haskell.org/ghc
Library Dependencies: readline, gmp
Runtime Dependencies: perl5.8
Platforms: darwin
Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information