Skip to content

Support Go modules for gccgo compilers #1946

@partouf

Description

@partouf

The go_library_builder.py currently skips gccgo compilers because modules don't work with our GCC installations.

Root Cause

The go tool bundled with gccgo has hardcoded build staging paths that don't exist in the deployed environment:

$ GOROOT=/opt/compiler-explorer/gcc-14.2.0 LD_LIBRARY_PATH=/opt/compiler-explorer/gcc-14.2.0/lib64 \
  /opt/compiler-explorer/gcc-14.2.0/bin/go build .
cmd/go: gccgo: exec: "/opt/compiler-explorer/gcc-build/staging/bin/gccgo": stat /opt/compiler-explorer/gcc-build/staging/bin/gccgo: no such file or directory

The go binary works for basic operations but looks for gccgo at the original build path rather than the installation path.

Potential Solutions

  1. Rebuild GCC with correct installation paths (configure --prefix to match deployment location)
  2. Build a wrapper script that sets up the environment correctly
  3. Patch the go binary post-build to fix the hardcoded paths

References

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