[opensuse-factory] LTO defaults for TW in OBS
[auto line breaks intentionally disabled] Hi, today, I found the package libx264 succeeding with "obs build", but failing with "obs build --vm-type=kvm", and could track this down to a failing endian test in configure: # skip endianness check for Intel Compiler and MSVS, as all supported platforms are little. each have flags that will cause the check to fail as well CPU_ENDIAN="little-endian" if [ $compiler = GNU ]; then echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed" if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then define WORDS_BIGENDIAN CPU_ENDIAN="big-endian" elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then die "endian test failed" fi fi Let's ignore the "beauty" of this test for a moment. Since TW compiles with -flto=auto, the resulting object file is in GIMBLE format, missing the usual debug info, this test relies on. So for the minimum invasive fix, either: %global _lto_cflags %{_lto_cflags} -ffat-lto-objects or %define _lto_cflags %{nil} will help. Since these kind of tests can fail everywhere, shouldn't -ffat-lto-objects be provided as default? I've no idea, why the local chroot build succeeds? For local testing, here's some code: cat > conftest.c << EOF int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0}; EOF gcc -m64 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wall -I. '-I$(SRCPATH)' -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=6 conftest.c -c -o conftest.o strings -a conftest.o gcc -m64 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g -Wall -I. '-I$(SRCPATH)' -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=6 conftest.c -c -o conftest-fat-lto.o strings -a conftest-fat-lto.o Cheers, Pete https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flto -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 19/12/2019 10.36, Hans-Peter Jansen wrote:
Since these kind of tests can fail everywhere, shouldn't -ffat-lto-objects be provided as default?
I think, fat-lto-objects is not needed for 99% of packages. We added it to those that create .a files as output and adding it for libx264 would probably not hurt either. In the other 99% of cases it just creates write-only-data at build time and thereby increases build time and disk space requirements. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Dec 19, 2019 at 6:36 AM Hans-Peter Jansen <hpj@urpla.net> wrote:
[auto line breaks intentionally disabled]
Hi,
today, I found the package libx264 succeeding with "obs build", but failing with "obs build --vm-type=kvm", and could track this down to a failing
Let's ignore the "beauty" of this test for a moment.
No, we don't :) tree is full of this wonderful tests.. for autoconf use AC_C_BIGENDIAN for cmake the TestBigEndian module for meson build_machine.endian() But you shouldn't need any of this.. both mainstream compilers/preprocessors support __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (3)
-
Bernhard M. Wiedemann
-
Cristian Rodríguez
-
Hans-Peter Jansen