Error related to GCC LTO optimization for GMP at ARM AArch64
Some One
gluker at gmail.com
Sat Jan 7 17:38:54 CET 2023
As I've just researched iproute2 started to compile since I had upgraded
dev-libs/mpfr from 4.1.1_p1 to 4.2.0, however liblinear and cmake
still hang no matter if mpfr compiled with LTO or not.
сб, 7 янв. 2023 г. в 16:10, Some One <gluker at gmail.com>:
> Dear GMP devs,
>
> As I reported the same issue to gentoo bugzilla and retried to reproduce
> for them with all logs attached,
> I've found out that iproute2 magically started to compile OK.
>
> However, there were other sources whose compilation was broken.
>
> Another example with all previous flags for GMP:
>
> 1. git clone https://github.com/cjlin1/liblinear.git
> 2. cd liblinear/ && make:
> c++ -Wall -Wconversion -O3 -fPIC -c -o newton.o newton.cpp
> ... hangs on the first source ...
>
> Regards
>
>
>
>
>
>
> пт, 6 янв. 2023 г. в 17:03, Some One <gluker at gmail.com>:
>
>> Hi,
>>
>> Let me try to reproduce the whole process with original GMP source:
>>
>> 1. I've downloaded https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
>>
>> 2. Exported my CFLAGS with LTO enabled:
>> export COMMON_FLAGS="-O3 -march=native -mcpu=native -pipe -funroll-loops \
>> -fomit-frame-pointer -fforce-addr -ftracer -fno-stack-protector
>> -flto"
>> export CFLAGS="${COMMON_FLAGS}"
>> export CXXFLAGS="${COMMON_FLAGS}"
>>
>> 3. Configure, make & install GMP with gcc version 12.2.1 20221231:
>> ./configure --prefix=/usr/ --libdir=/usr/lib64/ --enable-cxx
>> make -j4
>> make install
>>
>> 4. Cloned iproute2:
>> git clone git://git.kernel.org/pub/scm/network/iproute2/iproute2.git
>>
>> 5. Try to compile iproute2 with hang as follows:
>> CC tc_cbq.o
>> CC tc_estimator.o
>> ... hangs here ...
>>
>> 6. Commented out the following piece of iproute2 code in
>> tc/tc_estimator.c:
>> // if (A/(-log(w)) > time_const)
>> // break;
>>
>> 7. Continued to compile iproute2 and compilation went OK
>>
>> Same error was reproduced with current https://gmplib.org/repo/gmp-6.2/
>>
>> Switching off LTO let iproute2 compile OK
>>
>> Regards!
>>
>> пт, 6 янв. 2023 г. в 15:00, Torbjörn Granlund <tg at gmplib.org>:
>>
>>> Some One <gluker at gmail.com> writes:
>>>
>>> I've found the problem related to GCC LTO optimization for GMP for ARM
>>> aarch64
>>> under QEMU with ARM Neoverse-N1 virt-4.2 (Oracle Cloud) and ARM
>>> virt-7.2
>>> (Apple M1)
>>> both running the latest Gentoo with gmp-6.2.1-r5 compiled by both
>>> gcc version 11.3.1 20221209 and gcc version 12.2.1 20221231.
>>>
>>> To reproduce:
>>> 1. Compile GMP with LTO optimization -- compiles OK
>>> 2. Try to compile iproute2-6.1.0 or cmake-3.25.1 -- compilation hangs
>>> during the process
>>>
>>> Disabling LTO optimization for GMP solves the problem.
>>>
>>> I would not expect any GMP developer to attempt to reproduce this
>>> problem. You're using a patched GMP ("-r5") in an environment which
>>> would be very close to impossible to reproduce!
>>>
>>> You need to isolate this problem and only then report it to the package
>>> maintainer of the buggy program.
>>>
>>> --
>>> Torbjörn
>>> Please encrypt, key id 0xC8601622
>>>
>>
More information about the gmp-bugs
mailing list