Skip to content

undefined reference to `github.com/segmentio/asm/cpu.X86' #81

@mettledrum

Description

@mettledrum

When segmentio/asm v1.2.0 is vendored into a module, building a Docker image fails.

build layer in Dockerfile:

RUN CGO_ENABLED=1 GO111MODULE=off go install /cmd/main.go

error logs:

[2022-12-06 16:56:34]  INFO docker build: #10 37.51 # github.com/segmentio/<REPO>/cmd/<BINARY>
  | [2022-12-06 16:56:34]  INFO docker build: #10 37.51 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
  | [2022-12-06 16:56:34]  INFO docker build: #10 37.51 /usr/bin/ld: /tmp/go-link-506352844/go.o: in function `github.com/segmentio/<REPO>/vendor/github.com/segmentio/asm/bswap.swap64.abi0':
  | [2022-12-06 16:56:34]  INFO docker build: #10 37.51 /go/src/github.com/segmentio/<REPO>/vendor/github.com/segmentio/asm/bswap/swap64_amd64.s:14: undefined reference to `github.com/segmentio/asm/cpu.X86'
  | [2022-12-06 16:56:34]  INFO docker build: #10 37.51 collect2: error: ld returned 1 exit status
  | [2022-12-06 16:56:34]  INFO docker build: #10 37.51
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83 # github.com/segmentio/<REPO>/cmd/<BINARY>
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83 /usr/bin/ld: /tmp/go-link-65482911/go.o: in function `github.com/segmentio/<REPO>/vendor/github.com/segmentio/asm/bswap.swap64.abi0':
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83 /go/src/github.com/segmentio/<REPO>/vendor/github.com/segmentio/asm/bswap/swap64_amd64.s:14: undefined reference to `github.com/segmentio/asm/cpu.X86'
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83 collect2: error: ld returned 1 exit status
  | [2022-12-06 16:56:35]  INFO docker build: #10 37.83

It seems like this is the line of code within segmentio/asm that's missing a reference but I'm unsure how to fix this.

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