Compiling GMP dependency
Hans Åberg
haberg_1@icloud.com
Mon Sep 30 12:58:05 GMT 2024
> On 30 Sep 2024, at 14:33, Jonathan Wakely via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>
> On Mon, 30 Sept 2024, 13:02 Hans Åberg, <haberg_1@icloud.com> wrote:
>
>>
>>> On 30 Sep 2024, at 11:38, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>>
>>> On Mon, 30 Sept 2024 at 08:25, Hans Åberg <haberg_1@icloud.com> wrote:
>>>>
>>>>
>>>>> On 30 Sep 2024, at 09:20, Jonathan Wakely via Gcc-help <
>> gcc-help@gcc.gnu.org> wrote:
>>>>>
>>>>> On Sun, 29 Sept 2024, 21:15 Hans Åberg via Gcc-help, <
>> gcc-help@gcc.gnu.org>
>>>>> wrote:
>>>>>
>>>>>> There is a recursive package issue on MacPorts [1] on how to compile
>> GMP
>>>>>> for the GCC build:
>>>>>>
>>>>>> GMP 'make check' fails with Clang if assembly is enabled, but passes
>> with
>>>>>> GCC, and also with Clang if assembly is disabled.
>>>>>>
>>>>>> So the question is how to set the build of GCC, specifically, is GMP
>> used
>>>>>> only for the build, or also when it is run?
>>>>>>
>>>>>
>>>>> The GCC compiler binaries are linked to libgmp and use some of its
>>>>> functions when compiling user code.
>>>>
>>>> Is GMP used otherwise for the build itself?
>>>
>>> Yes, the GCC compiler binaries use it, and those binaries are used
>>> during bootstrap.
>>> I don't know whether they use the parts of your libgmp.dylib that
>>> misbehave when using Clang. That would require finding out exactly
>>> which parts of gmp are incorrect, …
>>
>> It may be Clang that is incorrect, ditching the C/C++ standards in favor
>> if mainstream programming.
>>
>>> …and whether each of those is ever
>>> used during GCC bootstrap.
>>>
>>> If you want to avoid rebuilding GMP after bootstrapping GCC and then
>>> rebuild GCC as well, the simplest solution would be to use the
>>> download_prerequisites script as described at
>>> https://gcc.gnu.org/wiki/InstallingGCC
>>> That will build GMP as part of the GCC bootstrap, linking statically
>>> to it (so the Clang-built libgmp.dylib already on the system won't be
>>> used).
>>
>> Is that script tried on MacOS?
>
> Not by me.
I have put the info back to MacPorts.
> —An old man page for ld said that on MacOS, static linking is only for
>> building the Mach kernel, and one cannot mix static and dynamic linking.
There is a MacPorts port re-flex that only installs a static library, and when I tried linking against that, it didn't work. A net search led that ld man page.
>>>>>> 1. https://trac.macports.org/ticket/70859
More information about the Gcc-help
mailing list