Skip to content

Running xgo on Mac M3 cross compiling to Linux x86_64 has a link error #124

@rcowham

Description

@rcowham

/usr/local/go/pkg/tool/linux_arm64/link: running x86_64-linux-gnu-gcc failed: exit status 1 /usr/lib/gcc-cross/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libm-2.31.a /usr/lib/gcc-cross/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libmvec.a

I discovered by looking inside the Docker container, that the relevant libraries were located in /usr/x86_64-linux-gnu/lib/

Tried a few things to fix, but ended up with modifying the Dockerfile and adding this near the end:

RUN ln -s /usr/x86_64-linux-gnu/lib/* /usr/lib/x86_64-linux-gnu/

Seems a bit clunky but works...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions