dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.2k stars 1.57k forks source link

GCC build fails when building zlib #52080

Closed alexmarkov closed 4 months ago

alexmarkov commented 1 year ago

vm-gcc-linux bot fails when building Dart for arm:

[1925/3162] CC obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o
FAILED: obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o 
arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o.d -D_FORTIFY_SOURCE=2 -DDEBUG -DZLIB_IMPLEMENTATION -DZLIB_DEBUG -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -I../../third_party/zlib -I../.. -Igen -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -fno-tree-sra -fno-caller-saves -fPIE -mfpu=neon -mthumb -Wall -Wextra -Werror -Wendif-labels -Wno-missing-field-initializers -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-psabi -fdebug-prefix-map=/b/s/w/ir/cache/builder/sdk=../.. -no-canonical-prefixes -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -fdata-sections -ffunction-sections -g3 -ggdb3 -march=armv8-a+aes+crc -c ../../third_party/zlib/crc32_simd.c -o obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-march=armv8-a+aes+crc’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv5tej armv6 armv6-m armv6j armv6k armv6kz armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc armv8-m.base armv8-m.main armv8-m.main+dsp armv8.1-a armv8.2-a armv8.2-a+dotprod armv8.2-a+fp16 armv8.2-a+fp16+dotprod iwmmxt iwmmxt2 native; did you mean ‘armv8-a+crc’?

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8783504870400738449/+/u/build_dart_debug_arm/stdout

Most likely this build error is caused by the new version of zlib: bd9c7a46e2b1f89a8487c21aafe714fa004d687f.

/cc @aam @rmacnak-google

dcharkes commented 1 year ago

Likely caused by this commit in zlib: https://chromium-review.googlesource.com/c/chromium/src/+/3917532.

It looks like the GCC bot hasn't triggered yet since the GCC bot update, so we have to wait a bit more and see if that fixes it.

rmacnak-google commented 1 year ago

From a try job after the switch to focal:

FAILED: obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o 
arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o.d -D_FORTIFY_SOURCE=2 -DDEBUG -DZLIB_IMPLEMENTATION -DZLIB_DEBUG -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -I../../third_party/zlib -I../.. -Igen -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -fno-tree-sra -fno-caller-saves -fPIE -mfpu=neon -mthumb -Wall -Wextra -Werror -Wendif-labels -Wno-missing-field-initializers -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-psabi -fdebug-prefix-map=/b/s/w/ir/cache/builder/sdk=../.. -no-canonical-prefixes -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -fdata-sections -ffunction-sections -g3 -ggdb3 -march=armv8-a+aes+crc -c ../../third_party/zlib/crc32_simd.c -o obj/third_party/zlib/zlib_arm_crc32.crc32_simd.o
arm-linux-gnueabihf-gcc: error: ‘armv8-a’ does not support feature ‘aes’
arm-linux-gnueabihf-gcc: note: valid feature names are: crc simd crypto nocrypto nofp sb predres
alexmarkov commented 1 year ago

Now gcc bot fails with the following compile-time errors:

FAILED: obj/runtime/bin/gen_snapshot_dart_io.eventhandler.o 
g++ -MMD -MF obj/runtime/bin/gen_snapshot_dart_io.eventhandler.o.d -DDART_IO_SECURE_SOCKET_DISABLED -D_FORTIFY_SOURCE=2 -DDEBUG -DSUPPORT_PERFETTO -DDART_PRECOMPILER -DTARGET_ARCH_IA32 -DDART_TARGET_OS_LINUX -I../../runtime -I../../third_party -I../.. -Igen -I../../runtime/include -I../../third_party/zlib -m32 -msse2 -mfpmath=sse -fPIE -Wall -Wextra -Werror -Wendif-labels -Wno-missing-field-initializers -Wno-unused-parameter -Wno-ignored-qualifiers -fdebug-prefix-map=/b/s/w/ir/cache/builder/sdk=../.. -no-canonical-prefixes -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -fdata-sections -ffunction-sections -g3 -ggdb3 -Wno-unused-parameter -Wno-unused-private-field -Wnon-virtual-dtor -Wvla -Woverloaded-virtual -Wno-comments -g3 -ggdb3 -fno-rtti -fno-exceptions -Wno-cast-function-type -O2 -fvisibility-inlines-hidden -fno-omit-frame-pointer -std=c++17 -fno-rtti -c ../../runtime/bin/eventhandler.cc -o obj/runtime/bin/gen_snapshot_dart_io.eventhandler.o
In file included from /usr/include/c++/9/stdlib.h:36,
                 from ../../runtime/bin/builtin.h:9,
                 from ../../runtime/bin/eventhandler.h:8,
                 from ../../runtime/bin/eventhandler.cc:5:
/usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
   41 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780515181443094241/+/u/build_dart_debug_ia32/stdout