Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,262
    • Issues 4,262
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 418
    • Merge Requests 418
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4068

Closed
Open
Opened May 13, 2010 by thorkilnaur@trac-thorkilnaur

GHC 6.12.2 on Mac OS X from GHC-6.12.2-i386.pkg fails with "Undefined symbols: "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.2.0.1.a(iconv.o) ..."

With

$ 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
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.2
$

installed from http://haskell.org/ghc/dist/6.12.2/GHC-6.12.2-i386.pkg:

$ cat t1.hs 
import System.IO
main
  = putStrLn "Hello GHC-6.12.2 2010-May-13 13.30"
$ ghc --make t1.hs
[1 of 1] Compiling Main             ( t1.hs, t1.o )
Linking t1 ...
Undefined symbols:
  "_iconv_close", referenced from:
      _hs_iconv_close in libHSbase-4.2.0.1.a(iconv.o)
  "_iconv", referenced from:
      _hs_iconv in libHSbase-4.2.0.1.a(iconv.o)
  "_iconv_open", referenced from:
      _hs_iconv_open in libHSbase-4.2.0.1.a(iconv.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
$ 

Looking at the installed libiconv:

$ nm /opt/local/lib/libiconv.a | grep iconv
/opt/local/lib/libiconv.a(iconv.o):
00018c60 D __libiconv_version
00018920 T _iconv_canonicalize
00015f20 T _libiconv
00015f80 T _libiconv_close
00017930 T _libiconv_open
00018150 T _libiconv_open_into
00015fa0 T _libiconvctl
000161e0 T _libiconvlist
/opt/local/lib/libiconv.a(localcharset.o):
/opt/local/lib/libiconv.a(relocatable.o):
000000f0 T _libiconv_relocate
00000000 T _libiconv_set_relocation_prefix
$ 

Further, in /opt/local/include/iconv.h:

#ifndef LIBICONV_PLUG
#define iconv_open libiconv_open
#endif
extern iconv_t iconv_open (const char* tocode, const char* fromcode);

So there is some trickery going on with respect to the names of functions from libiconv, but it is not clear to me how to resolve this.

Best regards Thorkil

Trac metadata
Trac field Value
Version 6.12.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.12.3
Milestone
6.12.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4068