Project

General

Profile

Actions

Bug #685

closed

crosstool-ng build fails on gcc 7.1

Added by Hammel about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
00 - Basic Build Issues
Target version:
Start date:
01 Feb 2019
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

This is a known issue: https://github.com/crosstool-ng/crosstool-ng/issues/992
It's fixed in git but won't be available till the next release of Ctng.
This means I can't build on Fedora 27 right now.

Options:
  1. Downrev gcc or install gcc-6.x. There don't appear to be any packages for gcc-6.x available in th default repos.
  2. Fix xcc build to support building from git. Right now it only builds from release images.
Actions #1

Updated by Hammel about 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30

I found an RPM from here: https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view
It was reference on Stack Overflow: https://stackoverflow.com/questions/49018215/install-gcc-and-g-version-6-in-fedora-27
I installed the RPM, which installs a /usr/bin/gcc63 binary. I then ran the xcc build as such:

make CC=gcc63 HW=rpi2 xcc

That seems to get past the bug without having to patch the source or use git. We'll see if this works for the test of the build.

Actions #2

Updated by Hammel about 5 years ago

I was wrong. Setting CC=gcc63 didn't force use of that compiler and I hit the bug again.

Investigating how I can force the compiler selection on the build.

Actions #3

Updated by Hammel about 5 years ago

  • % Done changed from 30 to 50

I can force a different gcc on the host and in the build but it doesn't matter. The bug still shows up.

So now I need to modify the build to support Crosstool-NG GIT releases.

Actions #4

Updated by Hammel about 5 years ago

I found a workaround for now. Edit this file:

 <bld>/crosstool-ng-1.23.0.bld/work/src/gcc-linaro-6.3-2017.02/gcc/ubsan.c

and change line 1474 (or whatever line is reported in the error while building Crosstool-NG) from this

      || xloc.file == '\0' || xloc.file[0] == '\xff'

to this

      || xloc.file[0] == '\0'

This allows the build to continue. See Crosstool-NG issues for details.

Actions #5

Updated by Hammel about 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

Crosstool-NG has a patches directory and there is a subdir for the Linaro gcc PiBox is using. I created a patch for the ubsan.c file and put it in that directory. Then I created a patch of the Crosstool-NG tree and placed that patch in the PiBox xcc patch directory so it gets applied in the xcc-patch target. This appears to have worked.

The patch is applicable for any gcc as the bug was always there but simply not identified by compilers before gcc 7.x (as far as I know).

Patch has been tested and pushed upstream.

Closing issue.

Actions

Also available in: Atom PDF