Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1282 closed bug (fixed)

binary package wants uncheckedShift functions to be exported from base

Reported by: Isaac Dupree Owned by: simonmar
Priority: high Milestone: 6.8.1
Component: libraries/base Version: 6.7
Keywords: Cc: id@…, dons@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

darcs get http://darcs.haskell.org/binary
cd binary
ghc --make Setup.lhs
./Setup configure --ghc [--with-compiler=/home/isaac/install/ghc-6.6.20070415/bin/ghc]

./Setup build # 6.6

Preprocessing library binary-0.3...
Building binary-0.3...
[1 of 4] Compiling Data.Binary.Builder ( src/Data/Binary/Builder.hs, dist/build/Data/Binary/Builder.o )
[2 of 4] Compiling Data.Binary.Get  ( src/Data/Binary/Get.hs, dist/build/Data/Binary/Get.o )
[3 of 4] Compiling Data.Binary.Put  ( src/Data/Binary/Put.hs, dist/build/Data/Binary/Put.o )
[4 of 4] Compiling Data.Binary      ( src/Data/Binary.hs, dist/build/Data/Binary.o )
...

./Setup build # 6.6.20070415

Preprocessing library binary-0.3...
Building binary-0.3...
[1 of 4] Compiling Data.Binary.Builder ( src/Data/Binary/Builder.hs, dist/build/Data/Binary/Builder.o )
/tmp/ghc3685_0/ghc3685_0.hc: In function ‘s3cf_ret’:

/tmp/ghc3685_0/ghc3685_0.hc:1568:0:
     warning: implicit declaration of function ‘stg_uncheckedShiftRL64’
[2 of 4] Compiling Data.Binary.Get  ( src/Data/Binary/Get.hs, dist/build/Data/Binary/Get.o )
/tmp/ghc3685_0/ghc3685_0.hc: In function ‘s5Cn_ret’:

/tmp/ghc3685_0/ghc3685_0.hc:609:0:
     warning: implicit declaration of function ‘stg_uncheckedShiftL64’
[3 of 4] Compiling Data.Binary.Put  ( src/Data/Binary/Put.hs, dist/build/Data/Binary/Put.o )
[4 of 4] Compiling Data.Binary      ( src/Data/Binary.hs, dist/build/Data/Binary.o )
/tmp/ghc3685_0/ghc3685_0.hc: In function ‘sdYB_ret’:

/tmp/ghc3685_0/ghc3685_0.hc:1142:0:
     warning: implicit declaration of function ‘stg_uncheckedShiftRL64’
/tmp/ghc3685_0/ghc3685_0.hc: In function ‘rbKZ_entry’:

/tmp/ghc3685_0/ghc3685_0.hc:2759:0:
     warning: implicit declaration of function ‘stg_uncheckedShiftL64’
/usr/bin/ar: creating dist/build/libHSbinary-0.3.a

See <http://www.indiegigs.co.uk:8010/linux_ppc/builds/111/step-yhc/0> errors at the end from ghc-6.6.20070415 on the same "binary" library for the Yhc buildbot. I don't know if this error is a regression versus 6.6 and I can't figure out how to reproduce it outside my Yhc-buildbot (I tried building the library with a wrapper shell script ghc-6.6.20070415 "$@" -O0 -fasm, and it succeeded building the Binary library without any warnings OR errors, so I don't know what's going on...)

(I'm not entirely sure, since Ubuntu 7.04 packagers build my 6.6, so maybe they did something to it that made it work better -- made it unregisterised, at least, and unable to use ghci or produce -fasm output. But the ghc-6.6.20070415 warning messages above, from the .hc look to be -fvia-C, and produced by the C compiler before any mangler starts on the produced assembly...)

Change History (14)

comment:1 Changed 10 years ago by Isaac Dupree

Reporter: changed from Isaac Dupree <id@…> to Isaac Dupree

Okay, there is an _error_ from my yhc buildbot because it's actually trying to link the files. I can run the command in that yhc directory now and get the same error. If I instead use the same arguments, but with the system ghc-6.6, it succeeds in producing an executable (which segfaults because it's linking in libraries compiled by a different ghc, of course). Also, using a ghc-6.6 that I built sometime (without mtl, so I deleted -package mtl from my command-line and ignored undefined references to mtl parts), it did not report those stg_uncheckedShift things (nor indeed anything besides mtl) to be undefined.

(the Version field of this ticket isn't correct... there doesn't seem to be a "6.6 branch" option...)

comment:2 Changed 10 years ago by Isaac Dupree

Problem also reproducible with 6.7.20070418 for me.

comment:3 Changed 10 years ago by Isaac Dupree

Okay, looking at different versions of the GHC source-code, it looks like the problem is that the stg_* functions have been renamed hs_* (e.g. see foreign imports in libraries/base/GHC/Word.hs, or libraries/base/include/HsBase.h and libraries/base/cbits/longlong.c), and so the "binary" library is trying to import uncheckedShiftL64 and uncheckedShiftRL64 using the C-names that are used in any so-far-released version of GHC, that start with stg_.

comment:4 Changed 10 years ago by igloo

Architecture: powerpcMultiple
Component: Compilerlibraries/base
Milestone: 6.8
Operating System: LinuxMultiple
Summary: stg_uncheckedShift* not found: regression from ghc-6.6 to ghc-6.6.1 RC 6.6.20070415 (?)binary package wants uncheckedShift functions to be exported from base
Version: 6.66.7

I don't think that these names are intended to be part of the interface of base - not even part of the internal GHC.* "interface". Nevertheless I've reverted the names for 6.6.1 so binary will continue to work.

However, for 6.8, it would be better to have any necessary functions exported by GHC.Int/GHC.Word/GHC.Base/GHC.Exts/... instead. I'm not sure if you need a word-sized unchecked shift, a 64-bit one, or something else?

(moving the bug to the 6.8 milestone as the 6.6 branch part should be fixed now)

comment:5 Changed 10 years ago by duncan

Yes, it'd clearly be better to be using an exported API. We'll try and figure out exactly what is needed and then see about getting that exported properly.

comment:6 Changed 10 years ago by igloo

Priority: normalhigh

comment:7 Changed 10 years ago by Isaac Dupree

Cc: id@… added

comment:8 Changed 10 years ago by dons

Cc: dons@… added

comment:9 Changed 10 years ago by igloo

Owner: set to dons@…

We need to know exactly what is needed in order to make progress on this.

comment:10 Changed 10 years ago by simonmar

Owner: changed from dons@… to simonmar

I'm doing this

comment:11 Changed 10 years ago by simonmar

Resolution: fixed
Status: newclosed

Fixed:

Thu Aug 23 14:50:33 BST 2007  Simon Marlow <simonmar@microsoft.com>
  * FIX #1282: 64-bit unchecked shifts are not exported from base

comment:12 Changed 10 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:13 Changed 9 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:14 Changed 9 years ago by simonmar

Operating System: MultipleUnknown/Multiple
Note: See TracTickets for help on using tickets.