Bug 204150 - misc/seabios doesn't compile with GCC 4.9
Summary: misc/seabios doesn't compile with GCC 4.9
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL: http://package18.nyi.freebsd.org/data...
Keywords:
: 204390 (view as bug list)
Depends on:
Blocks: 196712
  Show dependency treegraph
 
Reported: 2015-10-30 15:35 UTC by Koop Mast
Modified: 2016-11-20 21:04 UTC (History)
2 users (show)

See Also:


Attachments
Request gcc 4.8 specificly (453 bytes, patch)
2016-01-31 16:16 UTC, Koop Mast
no flags Details | Diff
Limit seabios to GCC 4.8 (354 bytes, patch)
2016-05-06 19:25 UTC, Koop Mast
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Koop Mast freebsd_committer 2015-10-30 15:35:28 UTC
While working on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196712 it turned out that xen-tools doesn't build with gcc 4.9. 

This can be worked around by setting USE_GCC to 4.8 but I think the correct thing is to support 4.9.

  Generating offset file out/asm-offsets.h
  Compiling whole program out/ccode32flat.o
/tmp//ccqkxgCK.s: Assembler messages:
/tmp//ccqkxgCK.s:956: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:1042: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:1048: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:1434: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:1567: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:2048: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:2193: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:2199: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:2699: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3175: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3181: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3342: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3599: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3605: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:3940: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:4202: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:4382: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:4666: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:5170: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:5176: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:6236: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:6242: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:6794: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:6800: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:7790: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:7796: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:7980: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:7986: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:8181: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:8187: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:9029: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:9035: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:9236: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:9242: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:10168: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:10488: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:11449: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:11455: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12198: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12204: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12463: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12469: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12774: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:12780: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13000: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13006: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13339: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13345: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13525: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13649: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13655: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:13977: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:14495: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:14631: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:14637: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:15325: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:15331: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:15826: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:15928: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:15934: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:16255: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:16261: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:16796: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:16802: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17185: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17191: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17389: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17395: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17758: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:17764: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18336: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18447: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18558: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18648: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18654: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18792: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:18798: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19144: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19150: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19464: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19470: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19708: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19714: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19990: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:19996: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:21408: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:21414: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22264: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22270: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22376: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22382: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22777: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:22783: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:23432: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:23734: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:23938: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:24409: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:24624: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:24630: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:26175: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:26181: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:26784: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:26790: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:27188: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:28187: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:28193: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:29102: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:29336: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:29425: Error: register save offset not a multiple of 8
/tmp//ccqkxgCK.s:29431: Error: register save offset not a multiple of 8
Makefile:146: recipe for target 'out/ccode16.o' failed
gmake[6]: *** [out/ccode16.o] Error 1
Comment 1 Roger Pau Monné freebsd_committer 2015-10-30 15:54:55 UTC
This is an error while compiling SeaBIOS, and the version of SeaBIOS that's shipped in the xen-tools package is not the same from the upstream one AFAIK. TBH I have no idea where ${SEABIOSVERSION} is defined.
Comment 2 Antoine Brodin freebsd_committer 2015-11-10 12:38:35 UTC
*** Bug 204390 has been marked as a duplicate of this bug. ***
Comment 3 Koop Mast freebsd_committer 2016-01-31 16:16:50 UTC
Created attachment 166357 [details]
Request gcc 4.8 specificly
Comment 4 Koop Mast freebsd_committer 2016-05-06 19:24:26 UTC
misc/seabios was split off from sysutils/xen-tools
Comment 5 Koop Mast freebsd_committer 2016-05-06 19:25:45 UTC
Created attachment 170056 [details]
Limit seabios to GCC 4.8

New patch for seabios, still doesn't build with gcc 4.9+
Comment 6 Roger Pau Monné freebsd_committer 2016-05-09 08:44:04 UTC
(In reply to Koop Mast from comment #5)
This looks fine to me, I will try to figure out why SeaBIOS doesn't build with gcc 4.9, but IIRC SeaBIOS has always been quite special regarding the compiler you need to use in order to build it, even on Linux.
Comment 7 Gerald Pfeifer freebsd_committer 2016-06-19 17:43:27 UTC
Thanks Roger.  Do you have an update for us?

Ideally this could be fixed to also build with GCC 4.9, not just GCC 4.8,
but if this is not feasible for now, can you please go with the proposed
patch by Koop (that is attached to this report)?
Comment 8 Roger Pau Monné freebsd_committer 2016-07-04 15:42:32 UTC
(In reply to Gerald Pfeifer from comment #7)
Hello,

Today I've attempted to fix this and found that gcc49 seems to be broken, I have the following installed from pkg 4.9.4.s20160608 and the following trivial program breaks it:

#include <stdio.h>

int main(int argc, char *argv[])
{
	return 0;
}

$ gcc49 -o main main.c
In file included from main.c:1:0:
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/stdio.h:77:9: error: unknown type name '__off64_t'
 typedef __off64_t off64_t;
         ^
Comment 9 Roger Pau Monné freebsd_committer 2016-07-06 14:22:09 UTC
(In reply to Roger Pau Monné from comment #8)
It seems like this was a mismatch between my world and the version of gcc shipped with pkg. I've now updated world and both gcc 4.9 and 5.4 seem to work fine, and I'm able to see the issue.

AFAICT the issue is a bug in gcc, and I've already sent a patch upstream (I've Cced Gerald on it). Let's see what the gcc folks think about it:

https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00252.html

With this patch applied I'm able to compile SeaBIOS with gcc > 4.8, without any change to SeaBIOS itself.

Roger.
Comment 10 Gerald Pfeifer freebsd_committer 2016-11-20 21:04:29 UTC
Thank you, Roger!

I have applied your patch to lang/gcc when I updated this port from
GCC 4.8.5 to GCC 4.9.4 earlier today, so misc/seabios should be fine
(even after this update and also for future updates of lang/gcc).

In parallel I have been running various tests to (finally) also push
this into upstream GCC (GCC 7) and will be looking into backporting
that into the GCC 6 and GCC 5 branches as well.

Thanks again!