Skip to content

undefined reference to `hsc_fputs' #83

Open

Description

@ysangkok

After installing hsc2hs using Cabal, I get a problem during linking:

 % make
make EHC_VARIANT=101 ehclibs-variant-dflt
make[1]: Entering directory '/tmp/uhc-master/EHC'
mkdir -p install/101/lib/pkg/base-3.0.0.0/101/bc/plain
make EHC_VARIANT=`       echo install/101/lib/pkg/base-3.0.0.0/101/bc/plain/ | sed -n -e 's+install/\([0-9]*\)/lib/pkg/\([a-zA-Z0-9_.-]*\)/\([0-9]*\)/\([a-zA-Z0-9_]*\)/plain/.*+\1+p'` \
        EHC_VARIANT_TARGET=`echo install/101/lib/pkg/base-3.0.0.0/101/bc/plain/ | sed -n -e 's+install/\([0-9]*\)/lib/pkg/\([a-zA-Z0-9_.-]*\)/\([0-9]*\)/\([a-zA-Z0-9_]*\)/plain/.*+\4+p'` \
        ehclib-variant-dflt
make[2]: Entering directory '/tmp/uhc-master/EHC'
mkdir -p build/101/ehclib/base/System && \
if grep -q 'HSC2HS_EXTRA' /home/janus/.cabal/bin/hsc2hs ;\
then \
   sed -e 's/^HSC2HS_EXTRA=.*$/HSC2HS_EXTRA=/' < /home/janus/.cabal/bin/hsc2hs > build/101/ehclib/hsc2hs && chmod +x build/101/ehclib/hsc2hs && \
         hsc2hs -v --output=build/101/ehclib/base/System/CPUTime.hs \
              --include=HsFFI.h \
              --cc=/usr/bin/gcc \
         -D__UHC__=1010905 \
         -D__UHC_TARGET_BC__ \
         -D__UHC_TARGET__=bc \
         -I/tmp/uhc-master/EHC/install/101/include/bc/ \
         -I/tmp/uhc-master/EHC/install/101/shared/include/ \
          -Iehclib/uhcbase/include/ -Iehclib/base/include/ -Iehclib/array/include/ -Iehclib/filepath/include/ -Iehclib/old-locale/include/ -Iehclib/old-time/include/ -Iehclib/unix/include/ -Iehclib/directory/include/ -Iehclib/random/include/ \
         -Iinstall/101/lib/pkg/uhcbase-1.1.9.5/101/bc/plain/include -Iinstall/101/lib/pkg/base-3.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/array-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/filepath-1.1.0.4/101/bc/plain/include -Iinstall/101/lib/pkg/old-locale-1.0.0.2/101/bc/plain/include -Iinstall/101/lib/pkg/old-time-1.0.0.4/101/bc/plain/include -Iinstall/101/lib/pkg/unix-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/directory-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/random-1.0.0.2/101/bc/plain/include \
       ehclib/base/System/CPUTime.hsc ; \
else \
      /home/janus/.cabal/bin/hsc2hs -v --output=build/101/ehclib/base/System/CPUTime.hs --no-compile --include=HsFFI.h ehclib/base/System/CPUTime.hsc && \
   /usr/bin/gcc -D__UHC__=1010905 \
      -D__UHC_TARGET_BC__ -D__UHC_TARGET__=bc \
      -I/tmp/uhc-master/EHC/install/101/include/bc/ \
      -I/tmp/uhc-master/EHC/install/101/shared/include/ \
        -Iehclib/uhcbase/include/ -Iehclib/base/include/ -Iehclib/array/include/ -Iehclib/filepath/include/ -Iehclib/old-locale/include/ -Iehclib/old-time/include/ -Iehclib/unix/include/ -Iehclib/directory/include/ -Iehclib/random/include/ \
        -Iinstall/101/lib/pkg/uhcbase-1.1.9.5/101/bc/plain/include -Iinstall/101/lib/pkg/base-3.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/array-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/filepath-1.1.0.4/101/bc/plain/include -Iinstall/101/lib/pkg/old-locale-1.0.0.2/101/bc/plain/include -Iinstall/101/lib/pkg/old-time-1.0.0.4/101/bc/plain/include -Iinstall/101/lib/pkg/unix-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/directory-1.0.0.0/101/bc/plain/include -Iinstall/101/lib/pkg/random-1.0.0.2/101/bc/plain/include \
      -o build/101/ehclib/base/System/CPUTime_hsc_make \
      build/101/ehclib/base/System/CPUTime_hsc_make.c \
   && build/101/ehclib/base/System/CPUTime_hsc_make > build/101/ehclib/base/System/CPUTime.hs \
   && rm -f build/101/ehclib/base/System/CPUTime_hsc_make.c ; \
fi \
&& touch build/101/ehclib/base/System/CPUTime.hs
/tmp/ccHglEfa.o: In function `main':
CPUTime_hsc_make.c:(.text+0x24): undefined reference to `hsc_printf'
CPUTime_hsc_make.c:(.text+0x29): undefined reference to `hsc_stdout'
CPUTime_hsc_make.c:(.text+0x36): undefined reference to `hsc_fputs'

Activity

  1. atzedijkstra commented on Aug 21, 2016

    @atzedijkstra
    Member

    Uptil now uhc relies on hsc2hs as installed by ghc. Perhaps the cabal version behaves differently?

  2. ysangkok commented on Aug 22, 2016

    @ysangkok
    Author

    But hsc2hs is not available in my GHC installation. I am using this GHC build: http://ppa.launchpad.net/hvr/ghc/ubuntu

  3. atzedijkstra commented on Aug 24, 2016

    @atzedijkstra
    Member

    A couple of years ago I have tried the separate cabal version of hsc2hs but could not make it work (easily) for uhc usage, I have not sorted this out any further, so I have little help to offer here. Sorry.

    A

    On 22 Aug 2016, at 10:25, Janus Troelsen notifications@github.com wrote:

    But hsc2hs is not available in my GHC installation. I am using this GHC build: http://ppa.launchpad.net/hvr/ghc/ubuntu

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions