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

Does not build on i386 #2

Closed
arrowd opened this issue Aug 13, 2020 · 16 comments
Closed

Does not build on i386 #2

arrowd opened this issue Aug 13, 2020 · 16 comments

Comments

@arrowd
Copy link

arrowd commented Aug 13, 2020

Building library for libBF-0.5.1..
[1 of 3] Compiling LibBF.Opts       ( /wrkdirs/usr/ports/security/hs-cryptol/work/cryptol-2.9.0/dist-newstyle/build/i386-freebsd/ghc-8.10.1/libBF-0.5.1/build/LibBF/Opts.hs, /wrkdirs/usr/ports/security/hs-cryptol/work/cryptol-2.9.0

src/LibBF/Opts.hsc:174:23: error:
    * Couldn't match type `Word64' with `Word32'
      Expected type: LimbT
        Actual type: Word64
    * In the first argument of `ShowFmt', namely `n'
      In the expression: ShowFmt n 0
      In an equation for `showFixed': showFixed n = ShowFmt n 0
    |
174 | showFixed n = ShowFmt n #{const BF_FTOA_FORMAT_FIXED}
    |                       ^

src/LibBF/Opts.hsc:178:22: error:
    * Couldn't match type `Word64' with `Word32'
      Expected type: LimbT
        Actual type: Word64
    * In the first argument of `ShowFmt', namely `n'
      In the expression: ShowFmt n 65536
      In an equation for `showFrac': showFrac n = ShowFmt n 65536
    |
178 | showFrac n = ShowFmt n #{const BF_FTOA_FORMAT_FRAC}
    |                      ^
@robdockins
Copy link
Contributor

I believe this should be fixed via #8, but I don't have easy access to a 32-bit system to check.

@arrowd
Copy link
Author

arrowd commented Feb 16, 2021

This problem was indeed fixed, but there is another one:

src/LibBF/Mutable.hsc:455:56: error:
    * Couldn't match type `Int64' with `Int32'
      Expected type: SLimbT
        Actual type: Int64
    * In the second argument of `bf_mul_2exp', namely `e'
      In the expression: bf_mul_2exp out e p f
      In the first argument of `bf1', namely
        `(\ out -> bf_mul_2exp out e p f)'
    |
455 | fmul2Exp (BFOpts p f) e = bf1 (\out -> bf_mul_2exp out e p f)
    |                                                        ^

@robdockins
Copy link
Contributor

Bummer. I'll see if I can get access to a 32-bit system and get this figured out.

@arrowd
Copy link
Author

arrowd commented Mar 12, 2021

Any progress on this?

@robdockins
Copy link
Contributor

No yet, I'm afraid.

@arrowd
Copy link
Author

arrowd commented Oct 14, 2021

This is still a problem not only for i386, but also aarch64: https://cgit.freebsd.org/ports/commit/?id=01049111d77ab4f8a1c0b59d8cb965414b9a2a0d

@robdockins
Copy link
Contributor

I'll make another attempt to get this building, but it will be especially hard for me to test ARM builds.

@robdockins
Copy link
Contributor

I think that #16 has fixed this issue, although I don't have ready access to a suitable system to test. Would it be possible for you to run a build before I cut a new Hackage release?

@arrowd
Copy link
Author

arrowd commented Oct 15, 2021

Repository HEAD seems to work for me on FreeBSD 12.2 i386.

@tilowiklundSensmetry
Copy link

This is also breaking builds for some of my colleagues on M1-macs.

@RyanGlScott
Copy link
Contributor

Since this appears to be addressed on master, I think this just needs someone to upload a new Hackage release.

@tilowiklundSensmetry
Copy link

I don't think the fix in master will work on 64bit non-x86_64 architectures (e.g. ARM64). The issue arises from the way 64bit architecture is identified in libbf (see here).

@robdockins
Copy link
Contributor

Oh, that is unfortunate. I'm actually not sure what's a good semi-portable way to query 32 vs 64 bit machine words in C.

@tilowiklundSensmetry
Copy link

I think something like this may work but I have not had the opportunity to test yet.

@RyanGlScott
Copy link
Contributor

Is this still an issue as of libBF-0.6.7? In #31, I was able to compile the library on 32-bit Linux without running into any build failures. (There are other problems with running the test suite, as reported in #26, but I think it at least compiles now.)

@RyanGlScott
Copy link
Contributor

#31 adds a 32-bit Linux CI configuration, which should ensure that it continues to work going forward. As such, I'll close this. Please re-open if I've missed something.

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

4 participants