GCC link failure

#1

Starting today, my Go (1.11.7) builds on Trusty for a project that uses CGO started failing with no code changes on my end.

I’ve tried upgrading to 1.12.2 and it do not help.

/home/travis/.gimme/versions/go1.11.7.linux.amd64/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-085423499/000020.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
#2

Seems to be fixed now after setting to go version 1.12.1?

#3

I don’t think this is our issue.

#4

To solve this add

dist: xenial

To your .travis.yml file. This includes a new enough linker to understand what the go compiler is creating.

This is mentioned in this comment on the issue.

1 Like