[RSB PATCH] 6: Merge the MacOS M silicon patch from gcc-12 to gcc-13

Chris Johns chrisj at rtems.org
Mon Dec 4 21:37:55 UTC 2023


On 4/12/2023 7:13 pm, Cedric Berger wrote:
> Hello,
> 
> On 28.11.2023 03:00, Chris Johns wrote:
>> On 27/11/2023 6:43 pm, Cedric Berger wrote:
>>> Hello,
>>>
>>> On 24.11.2023 08:36, Sebastian Huber wrote:
>>>> Would updating to ISL 0.26 and MPC 1.3.1 fix this issue also?
>>> I just tried in on my fully up-to-date M1 Pro (macOS Sonoma 14.1.1, Xcode
>>> 15.0.1)
>>>
>>> Short answer: everything works well without issues (configure, make, check)
>>>
>>> I just installed the following packages successively:
>>>
>>>   - https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
>>>   - https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.gz
>>>   - https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz
>>>   - https://libisl.sourceforge.io/isl-0.26.tar.gz
>>>
>>> by simply extracting the archive and doing:
>>>
>>>    ./configure
>>>    make
>>>    make check
>>>    sudo make install
>> Is this a native build?
> Yes
>>   This seems to resolve the OS support part which is good
>> however is the other issue of bad code execution in GMP fixed?
> 
> Could you point me to the problem?

The issue has been resolved in gmp-6.3.0 for M silicon. I am how looking at:

https://lists.rtems.org/pipermail/users/2023-October/068894.html

and the crash is in a GMP call via MPFR. This is on Intel silicon on Ventura. I
have just run `make check` on the RSB build of GMP and it is not great:

============================================================================
Testsuite summary for GNU MP 6.3.0
============================================================================
# TOTAL: 53
# PASS:  10
# SKIP:  1
# XFAIL: 0
# FAIL:  42
# XPASS: 0
# ERROR: 0

> In any case I ran make check, so at least for all the builtin tests, there is no
> issues.

Are you checking the RSB built package or a stand along configure and compile build?

>> This only showed
>> up when the cross-compiled libraries are built?
> 
> These libraries are only used by gcc itself right?

Yes. An example of the usage can be seen in the above crash building the libgcc
div3c module. The back trace is:

 thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0xd5)
  * frame #0: 0x..
    frame #1: 0x.. cc1`__gmpn_bc_set_str + 1370
    frame #2: 0x.. cc1`parsed_string_to_mpfr() at strtofr.c:555:20 [opt]
    frame #3: 0x.. cc1`mpfr_strtofr() at strtofr.c:965:13 [opt]
    frame #4: 0x.. cc1`real_from_string(r=0x00007ff7bfefb350,
str="1.79769313486231570814527423731704357e+308") at real.cc:2152:17 [opt]

> Why would you cross-compile these libraries?

Sorry if I was not clear. Those libraries are not being cross-compiled, it
things like libgcc that are and in this case of the crash posted here the
failure appears when building that code.

Chris


More information about the devel mailing list