[devel] I: LTO in %optflags by default

Dmitry V. Levin ldv на altlinux.org
Чт Авг 26 11:24:11 MSK 2021


On Thu, Aug 26, 2021 at 12:23:01PM +0800, alexei на taf.ru wrote:
[...]
> >> Это хорошо, но все ли наши архитектуры поддерживают LTO?
> > 
> > Конечно, LTO поддерживается на всех наших архитектурах.
> 
> Есть некоторые сомнения по этому поводу.

У вас уже собралось несколько пакетов с включённой LTO,
так что не сомневайтесь.

> http://git.altlinux.org/tasks/283741/build/100/armh/log
> ======================================================
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h: In function 'pg_comp_crc32c_armv8':
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:739:10: error: this builtin is not supported for this target
> [00:02:11]   739 |   return __builtin_arm_crc32cb (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:745:10: error: this builtin is not supported for this target
> [00:02:11]   745 |   return __builtin_arm_crc32ch (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:751:10: error: this builtin is not supported for this target
> [00:02:11]   751 |   return __builtin_arm_crc32cw (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:751:10: error: this builtin is not supported for this target
> [00:02:11]   751 |   return __builtin_arm_crc32cw (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:751:10: error: this builtin is not supported for this target
> [00:02:11]   751 |   return __builtin_arm_crc32cw (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:751:10: error: this builtin is not supported for this target
> [00:02:11]   751 |   return __builtin_arm_crc32cw (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:745:10: error: this builtin is not supported for this target
> [00:02:11]   745 |   return __builtin_arm_crc32ch (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] /usr/lib/gcc/armh-alt-linux-gnueabi/10/include/arm_acle.h:739:10: error: this builtin is not supported for this target
> [00:02:11]   739 |   return __builtin_arm_crc32cb (__a, __b);
> [00:02:11]       |          ^
> [00:02:11] make[3]: *** [/usr/src/tmp/ccaltlWW.mk:377: /usr/src/tmp/postgres.w4Po8V.ltrans125.ltrans.o] Error 1
> [00:02:11] lto-wrapper: fatal error: make returned 2 exit status
> [00:02:11] compilation terminated.
> [00:02:11] ld: error: lto-wrapper failed
> [00:02:11] collect2: error: ld returned 1 exit status
> [00:02:11] make[2]: *** [Makefile:66: postgres] Error 1
> [00:02:11] make[2]: Leaving directory '/usr/src/RPM/BUILD/postgresql13-13.4/src/backend'
> [00:02:11] make[1]: *** [Makefile:42: all-backend-recurse] Error 2
> [00:02:11] make: *** [GNUmakefile:11: all-src-recurse] Error 2
> =======================================================
> 
> При этом задание с отключенным LTO для armh собирается успешно
> ( http://git.altlinux.org/tasks/283796/ )

Это один из нескольких случаев, которые, видимо, были исправлены в gcc11:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96939

Наверное, можно пока отключить LTO для armh и оставить в спек-файле
соответствующий комментарий, а после перехода на gcc11 включить обратно.


-- 
ldv


Подробная информация о списке рассылки Devel