When compile the chromium on my Altra platform, it meet compile problem like this
no-dangling-assignment-gsl -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptio00:01:51 [472/19443] nc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include -fvisibility -inlines-hidden -O2 -pipe -march=armv8.2-a -Wno-unknown-warning-option -c ../../third_party/libyuv/source/comp are_neon64.cc -o obj/third_party/libyuv/libyuv_neon/compare_neon64.o ../../third_party/libyuv/source/compare_neon64.cc:175:8: error: instruction requires: dotprod 175 | "udot v4.4s, v0.16b, v6.16b \n" | ^ <inline asm>:14:1: note: instantiated into assembly here 14 | udot v4.4s, v0.16b, v6.16b | ^ ../../third_party/libyuv/source/compare_neon64.cc:176:8: error: instruction requires: dotprod 176 | "udot v5.4s, v1.16b, v6.16b \n" | ^ <inline asm>:15:1: note: instantiated into assembly here 15 | udot v5.4s, v1.16b, v6.16b | ^ ../../third_party/libyuv/source/compare_neon64.cc:204:8: error: instruction requires: dotprod 204 | "udot v4.4s, v0.16b, v0.16b \n" | ^ <inline asm>:10:1: note: instantiated into assembly here 10 | udot v4.4s, v0.16b, v0.16b | ^ ../../third_party/libyuv/source/compare_neon64.cc:205:8: error: instruction requires: dotprod 205 | "udot v5.4s, v1.16b, v1.16b \n" | ^ <inline asm>:11:1: note: instantiated into assembly here 11 | udot v5.4s, v1.16b, v1.16b | ^ 4 errors generated. [10940/63891] aarch64-unknown-linux-gnu-clang++-18 -MD -MF obj/third_party/libyuv/libyuv_neon/rotate_neon.o.d
Seems because some -march/-mcpu/-mtune drop ‘dotprod’ parameters, it needs to add the extension manuall. ‘+dotprod’.
Edit the file /etc/portage/make.conf, and change the COMMON_FLAGS to
COMMON_FLAGS="-mcpu=neoverse-n1+crc+crypto+ssbs+dotprod -O2 -pipe"
It can use the following command to get current CPU flag
gcc -v -E -x c /dev/null -o /dev/null -march=native -mcpu=native 2>&1 | grep /cc1
Thanks Gentoo user zukunf to provide those information.
發佈留言