Opened 12 years ago

Closed 12 years ago

Last modified 20 months ago

#3637 closed defect

GOB: not compilable under ps2 toolchain in MINGW/MSYS

Reported by: SF/mac_es78 Owned by: sunmax
Priority: normal Component: Port: PS2
Keywords: Cc:



I was trying to compile ScummVM 0.11.1 whith ps2 toolchain under MINGW/MSYS. I got an error when I tried to include gob engine.

The 'offending' code is in engines/gob/map_v1.cpp and was introduced in revision 28591.

The error is: Assertion failure in tc_gen_reloc at ../../gas/config/tc-mips.c line 1440

The real code is in the init() method:

if (_passMap || _itemsMap) return;

It seems that you can't use the pointers like that. For example, if (_passMap[0] || _itemsMap[0]) will work...

My ps2 toolchain is based in: binutils-2.14, gcc-3.2.2, newlib-1.10.0 and an updated ps2sdk.

All other engines in the branch are compilable.


Ticket imported from: #1902303. Ticket imported from: bugs/3637.

Change History (14)

comment:1 by fingolfin, 12 years ago

So this is a compiler bug. Does it work if you use if (_passMap != 0 || _itemsMap != 0) return; instead?

comment:2 by SF/mac_es78, 12 years ago

Yes, it is a compiler bug... No, it doesn't work either, the same error. I had tried it already, forgot to mention in the initial comment.

comment:3 by SF/mac_es78, 12 years ago

Ok, trying to create a proper code to bypass this bug. I found that the problem are not the pointers, the problem is the assignament of the internal variable whith the result of the or by the compiler.

So, this code compiles:

bool initialized = _passMap || _itemsMap; if (initialized) return;

May I create a patch, or it is not necessary?

comment:4 by fingolfin, 12 years ago

Owner: set to sunmax

comment:5 by fingolfin, 12 years ago

Assigning to our PS2 porter.

comment:6 by sunmax, 12 years ago

Hi there Max!

Am I allowed to modify GOB code to make it MINGW-friendly?

Should I put an #ifdef for the PS2+MINGW case?

Please let me know, -max

comment:7 by fingolfin, 12 years ago

It seems there is no need for #ifdef -- apparently some simple changes help to work around this nasty compiler bugs. Does any of these work? if (_passMap != NULL || _itemsMap != NULL) return; or if (_passMap) return; if (_itemsMap) return;

If so, change it accordingly, and add a comment pointing to this bug, stating something like "Do not modify this check unless you have to, else it may break certain cross compilers (see bug #XYZ)".

Anyway, I really wish those tool chains wouldn't use buggy compilers from the stoneage... I mean, even gcc 3.2.*3* would be better than 3.2.2; not to mention 3.3.6 or 3.4.6 (I am not even going to bother thinking about 4.x ;).

comment:8 by fingolfin, 12 years ago

Status: newpending

comment:9 by fingolfin, 12 years ago

This tracker item is pending response by the submitter; we cannot continue processing it before that happens. As a consequence, its status has been set to "Pending". It will automatically revert to "Open" once a new comment is made to this item. If no response is made within 14 days, it will automatically be closed.

Thank you.

comment:10 by SF/mac_es, 12 years ago


I'm mac_es78 but whith the correct username :) Sorry for the delay.

None of them works. The code I wrote in my third comment works however:

bool initialized = _passMap || _itemsMap; if (initialized) return;

comment:11 by SF/mac_es, 12 years ago

Ops! Forgot to comment, I have tried it against 0.12.0 branch as the trunk for ps2 is uncompilable because of the recent savefiles changes

comment:12 by SF/sf-robot, 12 years ago

Status: pendingclosed

comment:13 by SF/sf-robot, 12 years ago

This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).

comment:14 by digitall, 20 months ago

Component: Port: PS2
Note: See TracTickets for help on using tickets.