Compiler cannot be bootstrapped anymore on Mac OS X 10.3
Original Reporter info from Mantis: Giulio
-
Reporter name: Giulio Bernardi
Original Reporter info from Mantis: Giulio
- Reporter name: Giulio Bernardi
Description:
The Apple assembler given with Xcode tools 1.5 (the last one for 10.3.9) is unable to compile some code generated by fpc.
This problem shows up when cycling the compiler (ppc1 is unable to compile the rtl).
Note: a solution would be to upgrade apple's as, however this means compiling a new cctools package (this is more or less possible, at least empirically it works).
Additional information:
When compiling rtl/unix/sysutils.pp,
in included file rtl/objpas/sysutils/sysstr.inc,
in function FloatToStrFIntl,
at the end of the function there is a case statement (line 1367):
1367 Case NegCurrFormat Of
1368 0: Result := '(' + FormatSettings.CurrencyString + Result +')';
1369 1: Result := '-' + FormatSettings.CurrencyString + Result;
etc etc...
which fpc compiles to the following assembly code:
10277 # [1367] Case NegCurrFormat Of
10278 addis r2,r25,ha16(L_TC_SYSUTILS_DEFAULTFORMATSETTINGS$non_lazy_ptr-Lj3605)
10279 lwz r2,lo16(L_TC_SYSUTILS_DEFAULTFORMATSETTINGS$non_lazy_ptr-Lj3605)(r2)
10280 lbz r2,1(r2)
10281 cmplwi cr0,r2,10
10282 bgt cr0,Lj3611
10283 slwi r2,r2,2
10284 addis r3,r25,ha16(Lj4233-Lj3605)
10285 addi r3,r3,lo16(Lj4233-Lj3605)
10286 lwzx r2,r3,r2
10287 add r2,r2,r3
10288 mtctr r2
10289 bctr
10290 Lj4233:
10291 .long L$set$1
10292 .set L$set$1,Lj4222-Lj4233
10293 .long L$set$2
10294 .set L$set$2,Lj4223-Lj4233
10295 .long L$set$3
10296 .set L$set$3,Lj4224-Lj4233
10297 .long L$set$4
10298 .set L$set$4,Lj4225-Lj4233
10299 .long L$set$5
10300 .set L$set$5,Lj4226-Lj4233
10301 .long L$set$6
10302 .set L$set$6,Lj4227-Lj4233
10303 .long L$set$7
10304 .set L$set$7,Lj4228-Lj4233
10305 .long L$set$8
10306 .set L$set$8,Lj4229-Lj4233
10307 .long L$set$9
10308 .set L$set$9,Lj4230-Lj4233
10309 .long L$set$10
10310 .set L$set$10,Lj4231-Lj4233
10311 .long L$set$11
10312 .set L$set$11,Lj4232-Lj4233
and as complains:
sysutils.pp:10292:Complex expression. Absolute segment assumed.
sysutils.pp:10294:Complex expression. Absolute segment assumed.
sysutils.pp:10296:Complex expression. Absolute segment assumed.
sysutils.pp:10298:Complex expression. Absolute segment assumed.
sysutils.pp:10300:Complex expression. Absolute segment assumed.
sysutils.pp:10302:Complex expression. Absolute segment assumed.
sysutils.pp:10304:Complex expression. Absolute segment assumed.
sysutils.pp:10306:Complex expression. Absolute segment assumed.
sysutils.pp:10308:Complex expression. Absolute segment assumed.
sysutils.pp:10310:Complex expression. Absolute segment assumed.
sysutils.pp:10312:Complex expression. Absolute segment assumed.
The guilty as is the one given in XCode 1.5:
Apple Computer, Inc. version cctools-525.obj~1, GNU assembler version 1.38
if as is told to ignore warnings (with -W), compilation succeeds but the newly generated ppc2 crashes.
Mantis conversion info:
- Mantis ID: 10541
- Version: 2.3.1
- Fixed in version: 2.2.2
- Fixed in revision: 9867 (#3c2dd733)