modula3 / cm3

Critical Mass Modula-3
http://modula3.github.io/cm3/
Other
133 stars 26 forks source link

MxConfigC.c seems to set a wrong host name for Darwin PPC #1171

Open barracuda156 opened 10 months ago

barracuda156 commented 10 months ago

Apparently https://github.com/modula3/cm3/commit/24fff5dc01815c18ced9a61fe1dbd38321d82a1c commit was not actually tested on Darwin PPC, where uname -m gives a value of Power Macintosh. Nothing seems to account for that.

So when you try to build cm3, this error happens:

do-cm3-all.py: Success.
'./do-pkg.py m3cc m3core libm3 buildship c  c PPC_DARWIN'
SearchPath return:/opt/svacchanda/cm3/bin/cm3
A working cm3 is required. Checking.
/opt/svacchanda/cm3/bin/cm3 -version | fgrep host:
sh: line 1: 14360 Abort trap              /opt/svacchanda/cm3/bin/cm3 -version 2> /dev/null
== package /opt/svacchanda/cm3/cm3/m3-libs/m3core ==

 +++ /opt/svacchanda/cm3/bin/cm3   -DM3_BACKEND_MODE=C -DBUILD_DIR=PPC_DARWIN   -build -DROOT=/opt/svacchanda/cm3/cm3 -DTARGET=PPC_DARWIN +++
PPC_DARWIN POWER MACINTOSH32_DARWIN
MxConfigC.c:304: failed assertion `strcmp(M3_HOST, result) == 0'
 *** execution of [<function _BuildGlobalFunction at 0xdf8c70>, <function _ShipFunction at 0xdf8cb0>] failed ***
ERROR: ./do-pkg.py m3cc m3core libm3 buildship c  c PPC_DARWIN

@VictorMiasnikov @jaykrell Could we fix this?

barracuda156 commented 10 months ago

P. S. Notice that while cpu_word_size is supposed to be nothing for powerpc-darwin (i.e. implicitly 32, but not spelled out): https://github.com/modula3/cm3/blob/4499ba5572f6ef13260b5ff8633c7818adb001e3/m3-sys/m3quake/src/MxConfigC.c#L285-L291 – we still get POWER MACINTOSH32_DARWIN. So it looks like the condition fails, and the following generic code is used, which adds 32.