+
Skip to content

Witness generator will not compile on aarch64 (Mac OS) due to type mismatch in fr.hpp/fr.cpp #351

Open
@mars-risc0

Description

@mars-risc0

On 64-bit Linux, uint64_t is unsigned long, but on 64-bit Apple ARM, uint64_t is unsigned long long. Regardless of platform, GMP's mp_limb_t is always defined as unsigned long. As a result, it is possible to freely assign between *uint64_t and *mp_limb_t when building for Linux, but not when building for Mac OS.

Building a circom-generated witness generator on MacOS will therefore produce a spew of errors when compiling fr.cpp, because it frequently attempts to pass in *uint64_t where GMP expects *mp_limb_t.

This can be resolved by changing the declared types in fr.hpp and fr.cpp from uint64_t to mp_limb_t, as shown in the attached files. The modified files will compile successfully on aarch64.

updated_witgen_fr.zip

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载