Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 32-bit operating systems #1

Open
andrewthad opened this issue Aug 22, 2019 · 6 comments
Open

Support 32-bit operating systems #1

andrewthad opened this issue Aug 22, 2019 · 6 comments

Comments

@andrewthad
Copy link
Member

GHC makes it somewhat difficult to write platform-portable code once you start explicitly unboxing Word, Word64, etc. I need to make things portable anyway so that I can start using this as a dependency in other libraries.

@chessai
Copy link
Member

chessai commented Aug 22, 2019

Use the i386 shell.nix i gave you

@andrewthad
Copy link
Member Author

I was looking around for that but couldn't find it. Is that on github or in a gist somewhere?

@chessai
Copy link
Member

chessai commented Aug 22, 2019

Its in one of your repos as shell-i386.nix, i think.

@andrewthad
Copy link
Member Author

Oh, it's shell-i686.nix, and it was in primitive-unaligned.

@Heinrich-CH
Copy link

Heinrich-CH commented May 10, 2020

Hello,
Is there a solution to this for non-nix users?
I was having similar issues with the wide-word project, but an unofficial patch fixed it.
See:
erikd/wide-word#38

I currently get the following (ghc 8.8.3, armv7h on a dynamically-linked system):

Building library for bytesmith-0.3.6.0..
[ 7 of 10] Compiling Data.Bytes.Parser.Latin ( src/Data/Bytes/Parser/Latin.hs, dist/build/Data/Bytes/Parser/Latin.dyn_o )

src/Data/Bytes/Parser/Latin.hs:544:57: error:
    * Couldn't match expected type `Exts.Word64#'
                  with actual type `Word#'
    * In the first argument of `W64#', namely `a'
      In the expression: W64# a
      In the expression: (# W64# a, b, c #)
    |
544 | upcastWord64Result (# | (# a, b, c #) #) = (# | (# W64# a, b, c #) #)
    |                                                         ^

src/Data/Bytes/Parser/Latin.hs:989:52: error:
    * Couldn't match expected type `Exts.Word64#'
                  with actual type `Word#'
    * In the first argument of `W64#', namely `a'
      In the expression: W64# a
      In the expression: (# W64# a, b, c #)
    |
989 |       (# | (# a, b, c #) #) -> (# s1, (# | (# W64# a, b, c #) #) #)
    |                                                    ^

Best regards

@andrewthad
Copy link
Member Author

Since wide-word has historically not supported 32-bit platforms, and bytesmith depends on wide-word, there has never been any point in attempting to support 32-bit platforms. However, it looks like this might be changing. If wide-word gets a release that works on 32-bit platforms, I can make bytesmith build on them as well. It shouldn't be that difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants