[Pkg-pascal-devel] Castle Game Engine build failure on sparc64.

Michalis Kamburelis michalis.kambi at gmail.com
Thu Nov 11 22:47:22 GMT 2021


Looking at your snippet from "fpcsrc/compiler/options.pas", it seems
that CPUSPARC continues to be defined, but only for 32-bit Sparc.

64-bit Sparc defines only CPUSPARC64. I'm not sure was this intended
by FPC developers or not (i.e., did they intend to define CPUSPARC for
both CPUSPARC32 and CPUSPARC64 cases, since otherwise CPUSPARC is just
equivalent to CPUSPARC32 and seems pointless -- but maybe it makes
sense for best backward compatibility). Indeed it seems good to ask
FPC devs about it, and ask for at least update of the docs -- if
everything is as it should be.

For the CGE code, I added there definition of "sparc64" value some
time ago (new allowed value of TCPU in FPC), but I didn't account for
it in "DefaultCPU" definition below. I think that simply adding

  {$ifdef CPUsparc64} sparc64 {$endif}

at the end of DefaultCPU definition should be enough. I did it in
https://github.com/castle-engine/castle-engine/commit/4320f4c2a5c6a4fa5b3e530ac378b1f7050eead5
, through I didn't test -- I do actually have access to a Sparc
machine. Let me know does this help :)

Regards,
Michalis

czw., 11 lis 2021 o 11:38 Abou Al Montacir <abou.almontacir at sfr.fr> napisał(a):
>
> Hi Michalis and All,
>
> While I was waiting for Armel compilation, I had a look at other architectures failure and picked my beloved SPARC one.
> The failure [1] looks as follows:
>
> Compiling tools/build-tool/code/toolproject.pas
> Compiling ./tools/common-code/toolarchitectures.pas
> toolarchitectures.pas(129,3) Error: Illegal expression
> toolarchitectures.pas(146,3) Error: Illegal expression
> toolarchitectures.pas(146,3) Fatal: Syntax error, ";" expected but "identifier DEFAULTOS" found
> Fatal: Compilation aborted
> Error: /usr/bin/ppcsparc64 returned an error exitcode
>
>
> It looks like CPUsparc directive has gone and was replaced by sparc or CPUsparc64.
> According to the compiler code in fpcsrc/compiler/options.pas:3499
>       {$ifdef sparc}
>         def_system_macro('CPUSPARCGEN');
>         def_system_macro('CPUSPARC');
>         def_system_macro('CPUSPARC32');
>         def_system_macro('CPU32');
>         def_system_macro('FPC_CURRENCY_IS_INT64');
>         def_system_macro('FPC_COMP_IS_INT64');
>       {$endif}
>
>       {$ifdef sparc64}
>         def_system_macro('CPUSPARCGEN');
>         def_system_macro('CPUSPARC64');
>         def_system_macro('CPU64');
>         def_system_macro('FPC_CURRENCY_IS_INT64');
>         def_system_macro('FPC_COMP_IS_INT64');
>       {$endif}
>
> So do you agree that we should change the define to the new name, even if the official documentation, Table G.2 in [2], does not mention the new directive?
>
> I'll probably raise a ticket on upstream GiLlab so that doc get aligned with code.
>
> [1] https://buildd.debian.org/status/fetch.php?pkg=castle-game-engine&arch=sparc64&ver=7.0~alpha.1%2Bdfsg-3&stamp=1635791264&raw=0
> [2] https://www.freepascal.org/docs-html/3.2.2/prog/progap7.html
>
> --
>
> Cheers,
> Abou Al Montacir
>
> _______________________________________________
> Pkg-pascal-devel mailing list
> Pkg-pascal-devel at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-pascal-devel



More information about the Pkg-pascal-devel mailing list