linking problems after switching from GHC5 to GHC6
Volker Wysk
post at volker-wysk.de
Wed Jan 28 14:18:18 EST 2004
> > I can't link with a library any longer, after switching from ghc5 to
> > ghc6.2. I've recompiled the library with the new compiler version, so
> > that's not the problem.
>
> [snip]
>
> > ghc -o build/test0 build/test0.o -odir build
> > `src/lib/hsunix-config --local --libs`
> > build/test0.o(.text+0x25): In function `__stginit_Main_':
> > : undefined reference to `__stginit_HsUnix_'
> > build/test0.o(.text+0xec): In function `Main_main_srt':
> > : undefined reference to `HsUnix_mainwrapper_closure'
> > build/test0.o(.text+0x151): In function `Main_main_entry':
> > : undefined reference to `HsUnix_mainwrapper_closure'
> > collect2: ld returned 1 exit status
> > make: *** [build/test0] Error 1
> > rm build/test0.o
>
> Strange. Could you send us the output from -v?
Okay:
Glasgow Haskell Compiler, Version 6.2, for Haskell 98, compiled by GHC version 6.2
Using package config file: /usr/lib/ghc-6.2/package.conf
==================== Packages ====================
Package
{name = "data",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/data"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSdata"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["haskell98", "lang", "util"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "lang",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/lang"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSlang"],
extra_libraries = ["HSlang_cbits"],
include_dirs = [],
c_includes = ["HsLang.h"],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "base",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSbase"],
extra_libraries = ["HSbase_cbits"],
include_dirs = [],
c_includes = ["HsBase.h"],
package_deps = ["rts"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "rts",
auto = False,
import_dirs = [],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSrts"],
extra_libraries = ["m", "gmp", "dl"],
include_dirs = ["/usr/lib/ghc-6.2/include"],
c_includes = ["Stg.h"],
package_deps = [],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts =
["-u",
"GHCziBase_Izh_static_info",
"-u",
"GHCziBase_Czh_static_info",
"-u",
"GHCziFloat_Fzh_static_info",
"-u",
"GHCziFloat_Dzh_static_info",
"-u",
"GHCziPtr_Ptr_static_info",
"-u",
"GHCziWord_Wzh_static_info",
"-u",
"GHCziInt_I8zh_static_info",
"-u",
"GHCziInt_I16zh_static_info",
"-u",
"GHCziInt_I32zh_static_info",
"-u",
"GHCziInt_I64zh_static_info",
"-u",
"GHCziWord_W8zh_static_info",
"-u",
"GHCziWord_W16zh_static_info",
"-u",
"GHCziWord_W32zh_static_info",
"-u",
"GHCziWord_W64zh_static_info",
"-u",
"GHCziStable_StablePtr_static_info",
"-u",
"GHCziBase_Izh_con_info",
"-u",
"GHCziBase_Czh_con_info",
"-u",
"GHCziFloat_Fzh_con_info",
"-u",
"GHCziFloat_Dzh_con_info",
"-u",
"GHCziPtr_Ptr_con_info",
"-u",
"GHCziPtr_FunPtr_con_info",
"-u",
"GHCziStable_StablePtr_con_info",
"-u",
"GHCziBase_False_closure",
"-u",
"GHCziBase_True_closure",
"-u",
"GHCziPack_unpackCString_closure",
"-u",
"GHCziIOBase_stackOverflow_closure",
"-u",
"GHCziIOBase_heapOverflow_closure",
"-u",
"GHCziIOBase_NonTermination_closure",
"-u",
"GHCziIOBase_BlockedOnDeadMVar_closure",
"-u",
"GHCziIOBase_Deadlock_closure",
"-u",
"GHCziWeak_runFinalizzerBatch_closure",
"-u",
"__stginit_Prelude"],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "haskell98",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HShaskell98"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "haskell-src",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HShaskell-src"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base", "haskell98"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "network",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSnetwork"],
extra_libraries = [],
include_dirs = [],
c_includes = ["HsNet.h"],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "parsec",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSparsec"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "QuickCheck",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSQuickCheck"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "readline",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSreadline"],
extra_libraries = ["readline", "ncurses"],
include_dirs = [],
c_includes = ["HsReadline.h"],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "OpenGL",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSOpenGL"],
extra_libraries = ["HSOpenGL_cbits"],
include_dirs = [],
c_includes = ["HsOpenGL.h"],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = ["-I/usr/X11R6/include"],
extra_ld_opts =
["-lGLU",
"-lGL",
"-L/usr/X11R6/lib",
"-lSM",
"-lICE",
"-lXext",
"-lX11",
"-lm"],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "GLUT",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSGLUT"],
extra_libraries = ["HSGLUT_cbits"],
include_dirs = [],
c_includes = ["HsGLUT.h"],
package_deps = ["base", "OpenGL"],
extra_ghc_opts = [],
extra_cc_opts = ["-I/usr/X11R6/include"],
extra_ld_opts =
["-lglut",
"-lGLU",
"-lGL",
"-L/usr/X11R6/lib",
"-lSM",
"-lICE",
"-lXmu",
"-lXt",
"-lXi",
"-lXext",
"-lX11",
"-lm"],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "unix",
auto = True,
import_dirs = ["/usr/lib/ghc-6.2/imports"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSunix"],
extra_libraries = ["HSunix_cbits", "dl"],
include_dirs = [],
c_includes = ["HsUnix.h"],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "concurrent",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/concurrent"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSconcurrent"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "posix",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/posix"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSposix"],
extra_libraries = ["HSposix_cbits", "dl"],
include_dirs = [],
c_includes = ["HsPosix.h"],
package_deps = ["lang", "unix"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "util",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/util"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSutil"],
extra_libraries = ["HSutil_cbits"],
include_dirs = [],
c_includes = ["HsUtil.h"],
package_deps =
["lang", "concurrent", "QuickCheck", "readline", "posix"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "text",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/text"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HStext"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["lang", "parsec"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "net",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/net"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HSnet"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["network"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Package
{name = "hssource",
auto = False,
import_dirs = ["/usr/lib/ghc-6.2/hslibs-imports/hssource"],
source_dirs = [],
library_dirs = ["/usr/lib/ghc-6.2"],
hs_libraries = ["HShssource"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["haskell-src"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}
Hsc static flags: -static
*** Linker
gcc -v -o build/test0 -DDONT_WANT_WIN32_DLL_SUPPORT build/libhsunix.a build/test0.o -L/usr/lib/ghc-6.2 -lHShaskell98 -lHSutil -lHSutil_cbits -lHSreadline -lreadline -lncurses -lHSQuickCheck -lHSconcurrent -lHStext -lHSparsec -lHSposix -lHSposix_cbits -ldl -lHSunix -lHSunix_cbits -ldl -lHSlang -lHSlang_cbits -lHSbase -lHSbase_cbits -lHSrts -lm -lgmp -ldl -u GHCziBase_Izh_static_info -u GHCziBase_Czh_static_info -u GHCziFloat_Fzh_static_info -u GHCziFloat_Dzh_static_info -u GHCziPtr_Ptr_static_info -u GHCziWord_Wzh_static_info -u GHCziInt_I8zh_static_info -u GHCziInt_I16zh_static_info -u GHCziInt_I32zh_static_info -u GHCziInt_I64zh_static_info -u GHCziWord_W8zh_static_info -u GHCziWord_W16zh_static_info -u GHCziWord_W32zh_static_info -u GHCziWord_W64zh_static_info -u GHCziStable_StablePtr_static_info -u GHCziBase_Izh_con_info -u GHCziBase_Czh_con_info -u GHCziFloat_Fzh_con_info -u GHCziFloat_Dzh_con_info -u GHCziPtr_Ptr_con_info -u GHCziPtr_FunPtr_con_info -u GHCziStable_StablePtr_con_info -u GHCziBase_False_closure -u GHCziBase_True_closure -u GHCziPack_unpackCString_closure -u GHCziIOBase_stackOverflow_closure -u GHCziIOBase_heapOverflow_closure -u GHCziIOBase_NonTermination_closure -u GHCziIOBase_BlockedOnDeadMVar_closure -u GHCziIOBase_Deadlock_closure -u GHCziWeak_runFinalizzerBatch_closure -u __stginit_Prelude
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3
/usr/lib/gcc-lib/i386-linux/3.2.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o build/test0 -u GHCziBase_Izh_static_info -u GHCziBase_Czh_static_info -u GHCziFloat_Fzh_static_info -u GHCziFloat_Dzh_static_info -u GHCziPtr_Ptr_static_info -u GHCziWord_Wzh_static_info -u GHCziInt_I8zh_static_info -u GHCziInt_I16zh_static_info -u GHCziInt_I32zh_static_info -u GHCziInt_I64zh_static_info -u GHCziWord_W8zh_static_info -u GHCziWord_W16zh_static_info -u GHCziWord_W32zh_static_info -u GHCziWord_W64zh_static_info -u GHCziStable_StablePtr_static_info -u GHCziBase_Izh_con_info -u GHCziBase_Czh_con_info -u GHCziFloat_Fzh_con_info -u GHCziFloat_Dzh_con_info -u GHCziPtr_Ptr_con_info -u GHCziPtr_FunPtr_con_info -u GHCziStable_StablePtr_con_info -u GHCziBase_False_closure -u GHCziBase_True_closure -u GHCziPack_unpackCString_closure -u GHCziIOBase_stackOverflow_closure -u GHCziIOBase_heapOverflow_closure -u GHCziIOBase_NonTermination_closure -u GHCziIOBase_BlockedOnDeadMVar_closure -u GHCziIOBase_Deadlock_closure -u GHCziWeak_runFinalizzerBatch_closure -u __stginit_Prelude /usr/lib/gcc-lib/i386-linux/3.2.3/../../../crt1.o /usr/lib/gcc-lib/i386-linux/3.2.3/../../../crti.o /usr/lib/gcc-lib/i386-linux/3.2.3/crtbegin.o -L/usr/lib/ghc-6.2 -L/usr/lib/gcc-lib/i386-linux/3.2.3 -L/usr/lib/gcc-lib/i386-linux/3.2.3/../../.. build/libhsunix.a build/test0.o -lHShaskell98 -lHSutil -lHSutil_cbits -lHSreadline -lreadline -lncurses -lHSQuickCheck -lHSconcurrent -lHStext -lHSparsec -lHSposix -lHSposix_cbits -ldl -lHSunix -lHSunix_cbits -ldl -lHSlang -lHSlang_cbits -lHSbase -lHSbase_cbits -lHSrts -lm -lgmp -ldl -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc-lib/i386-linux/3.2.3/crtend.o /usr/lib/gcc-lib/i386-linux/3.2.3/../../../crtn.o
build/test0.o(.text+0x1b): In function `__stginit_Main_':
: undefined reference to `__stginit_HsUnix_'
build/test0.o(.text+0xec): In function `Main_main_srt':
: undefined reference to `HsUnix_mainwrapper_closure'
build/test0.o(.text+0x151): In function `Main_main_entry':
: undefined reference to `HsUnix_mainwrapper_closure'
collect2: ld returned 1 exit status
*** Deleting temp files
Deleting:
More information about the Glasgow-haskell-users
mailing list