Skip to content

Allow building on 32bit platforms #337

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

albertov
Copy link

This PR allows cborg to be compiled on 32 bit platforms (tested on armv7l)

@amesgen
Copy link

amesgen commented Aug 1, 2024

Also see #322 for the same thing

@sorki
Copy link

sorki commented Mar 29, 2025

Thanks for this, saved me today!

@juhp
Copy link

juhp commented Apr 8, 2025

Where was this tested (ie which ghc versions)?

Anyway seems to fail to compile for me for ix86 though on 9.4, 9.6, and 9.8 😢
Given that the target was armv7 maybe it worked on 9.2?

@sorki
Copy link

sorki commented Apr 8, 2025

I've used 9.6.6 for armv7l arvm6l build.

@juhp
Copy link

juhp commented Apr 12, 2025

Thanks for this PR, it helped me too.

I don't really have access to 32bit ARM anymore, but at least on Fedora ix86 I need the following change for this PR to compile (tested with GHC 9.2, 9.4, 9.6, 9.8 and 9.10):

--- cborg-0.2.10.0/src/Codec/CBOR/Magic.hs~	2001-09-09 09:46:40.000000000 +0800
+++ cborg-0.2.10.0/src/Codec/CBOR/Magic.hs	2025-04-12 13:54:16.901381291 +0800
@@ -173,7 +173,7 @@
 grabWord64 (Ptr ip#) = W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
 #endif
 #else
-grabWord64 (Ptr ip#) = W64# (byteSwap64# (word64ToWord# (indexWord64OffAddr# ip# 0#)))
+grabWord64 (Ptr ip#) = W64# (byteSwap64# (indexWord64OffAddr# ip# 0#))
 #endif

Ah this also agrees with the other PR https://github.com/well-typed/cborg/pull/322/files#diff-977386b4cda6ac2666d400abade9280c54b6ad875d914bb88212440cdd1145a8

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

Successfully merging this pull request may close these issues.

4 participants