Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671340 - media-libs/libaom-1.0.0 USE="cpu_flags_x86_sse2 -cpu_flags_x86_ssse3" - libaom.so.0: undefined reference to `aom_sad4xh_sse2'
Summary: media-libs/libaom-1.0.0 USE="cpu_flags_x86_sse2 -cpu_flags_x86_ssse3" - libao...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
: 686770 687624 699482 (view as bug list)
Depends on:
Blocks: 678160
  Show dependency tree
 
Reported: 2018-11-17 13:02 UTC by Jeroen Roovers (RETIRED)
Modified: 2021-12-24 06:08 UTC (History)
23 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
media-libs:libaom-1.0.0-r1:20181117-122721.log (media-libs:libaom-1.0.0-r1:20181117-122721.log,323.76 KB, text/plain)
2018-11-17 13:02 UTC, Jeroen Roovers (RETIRED)
Details
build log with all sse* cpuflags enabled. (build.log,459.19 KB, text/x-log)
2019-03-26 04:20 UTC, N. Andrew Walsh
Details
build log (media-libs:libaom-1.0.0-r2:20190608-090900.log,465.75 KB, text/x-log)
2019-06-08 09:51 UTC, thanasis
Details
/etc/portage/patches/media-libs/libaom/cpuflags.patch rebased to media-libs/libaom-2.0.0 (cpuflags.patch,1.11 KB, patch)
2020-10-12 18:35 UTC, Alexander Bezrukov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2018-11-17 13:02:35 UTC
Created attachment 555458 [details]
media-libs:libaom-1.0.0-r1:20181117-122721.log

aom_dsp/x86/jnt_sad_ssse3.c doesn't get built with this combination of USE flags.
Comment 1 Charlie Gehlin 2019-03-01 13:01:53 UTC
Stumbled upon this bug compiling my own _very_ 64-bit genric distribution for a future LiveDVD (and/or netboot...) with march=x86-64 and mtune=k8 BUT with disabled 3dNow! (-mno-3dnow -mno-3dnowa) in order to support even the early 64-bit VIA processors with very few extra instruction-sets...
However, looking at the ebuild, it seems to handle the CPU-flags internally within multilib_src_configure().
BUT adding '-DAOM_TARGET_CPU=generic' (as suggested at https://github.com/mozilla/aom/issues/2) at the bottom of these options seems to help compiling, working here in my local overlay.
Realizing that this is NOT the real solution on how to solve the ebuilds internal CPU-flags logic, but it might help pointing someone who knows what (s)he's doing in the right direction..

Cheers! /Charlie
Comment 2 N. Andrew Walsh 2019-03-26 04:19:57 UTC
I get a similar error, but I have all the sse variants enabled in make.conf: sse, sse2, sse2, and sse4a. And I get more error messages:

libaom.so.0: undefined reference to `aom_sad4xh_sse2'
libaom.so.0: undefined reference to `aom_sad16xh_sse2'
libaom.so.0: undefined reference to `aom_sad64xh_sse2'
libaom.so.0: undefined reference to `aom_sad8xh_sse2'
libaom.so.0: undefined reference to `aom_sad32xh_sse2'
libaom.so.0: undefined reference to `aom_sad128xh_sse2'

I'll attach the build.log.
Comment 3 N. Andrew Walsh 2019-03-26 04:20:56 UTC
Created attachment 570830 [details]
build log with all sse* cpuflags enabled.
Comment 4 Kelly Hirai 2019-04-03 04:03:21 UTC
i got passed this bug by migrating my processor use flags to the new CPU_FLAG_X86 symbol as prescribed in the gentoo wiki article of the same name.
Comment 5 Radoslaw Madej (radegand) 2019-04-03 12:07:41 UTC
(In reply to Kelly Hirai from comment #4)
> i got passed this bug by migrating my processor use flags to the new
> CPU_FLAG_X86 symbol as prescribed in the gentoo wiki article of the same
> name.

Do you mind sharing the link or shedding more light on this issue? I'm hit with the same bug and I can't get passed it to compile the latest firefox. 

Thanks in advance!
Comment 6 Matthew Schultz 2019-04-03 14:12:54 UTC
(In reply to Radoslaw Madej (radegand) from comment #5)
> (In reply to Kelly Hirai from comment #4)
> > i got passed this bug by migrating my processor use flags to the new
> > CPU_FLAG_X86 symbol as prescribed in the gentoo wiki article of the same
> > name.
> 
> Do you mind sharing the link or shedding more light on this issue? I'm hit
> with the same bug and I can't get passed it to compile the latest firefox. 
> 
> Thanks in advance!

https://wiki.gentoo.org/wiki/CPU_FLAGS_X86
Comment 7 Matthew Schultz 2019-04-03 14:15:13 UTC
(In reply to Kelly Hirai from comment #4)
> i got passed this bug by migrating my processor use flags to the new
> CPU_FLAG_X86 symbol as prescribed in the gentoo wiki article of the same
> name.

Not sure how that fixes the problem.  I have the same specified in both areas and it still fails to compile on one of my machines.
Comment 8 Radoslaw Madej (radegand) 2019-04-03 15:12:00 UTC
(In reply to Matthew Schultz from comment #6)
> https://wiki.gentoo.org/wiki/CPU_FLAGS_X86

So yeah, I also had these set and it doesn't help, I get the 'undefined reference' errors.
I thought Kelly meant something related to this:
https://wiki.gentoo.org/wiki/CPU_FLAGS_X86_conversion
https://packages.gentoo.org/useflags/cpu_flags_x86_xop
Comment 9 Matthew Schultz 2019-04-03 15:35:40 UTC
Also possibly of relevance, the machine I have that successfully compiled and installed libaom-1.0.0 has every CPU_FLAGS_X86 flag enabled while the machine that is not able to compile it has the following:

CPU_FLAGS_X86="mmx sse sse2 sse3 -avx -avx2 -sse4_1 -ssse3"
Comment 10 Fred Krogh 2019-04-04 01:14:44 UTC
Its working for me after
$ cpuid2cpuflags 
CPU_FLAGS_X86: aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3
and then putting
 CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
in /etc/make.conf.
Comment 11 Radoslaw Madej (radegand) 2019-04-05 08:16:00 UTC
Yes, this solved it for me:
CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

turned out to be that by mistake I set CPU_FLAGS_X86 twice in my make conf, and the latter did not include all the flags... <facepalm>
Comment 12 Matthew Schultz 2019-04-05 14:42:15 UTC
(In reply to Matthew Schultz from comment #9)
> Also possibly of relevance, the machine I have that successfully compiled
> and installed libaom-1.0.0 has every CPU_FLAGS_X86 flag enabled while the
> machine that is not able to compile it has the following:
> 
> CPU_FLAGS_X86="mmx sse sse2 sse3 -avx -avx2 -sse4_1 -ssse3"

I think this bug might have more to do with certain older CPUs.  After testing this a bit more, it seems to fail consistently on my older machines which run AMD cpus with the aforementioned CPU_FLAGS_X86 set.  No other CPU_FLAGS_X86 can be set on these older CPUs because they aren't supported.  In addition, this appears to be an amd64 arch problem because it compiles fine on my opteron 144 running x86 arch.
Comment 13 B Nice 2019-04-06 18:22:43 UTC
This bug also hits not so old  AMD (Phenom II) CPUS.  The make.conf has: CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a", but I still get the same errors as Comment 2.
Comment 14 Wadlax 2019-04-12 14:58:32 UTC
On my AMD Phenom II X6 , emerge libaom-1.0.0-r1
1) Fails with "+sse2"
CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a"

2) Succeeds with "-sse2"
CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse3 sse4a"

Full cpu flags (from 1) i got from cpuid2cpuflags
Comment 15 Wadlax 2019-04-12 15:10:50 UTC
Fixed emerge by setting full CPU_FLAGS_X86 in make.conf 
and adding "media-libs/libaom -cpu_flags_x86_sse2" to the package.use

Had compile problems on AMD Phenom II X6
Compile on Intel i7-4771 was ok without any changes
(switched to CPU_FLAGS_X86 on both systems long ago)
Comment 16 B Nice 2019-04-13 13:24:52 UTC
Can emerge by changing make.conf ABI_X86= to "64", but not "32" or "32 64".  "32" and "64 32" errors out with the same error as comment 2.  

"64" gives a post compile warning message of:  QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/media-libs/libaom-1.0.0-r1/work/av1/encoder/rdopt.c:8263:51: warning: array subscript -1 is below array bounds of ‘const CANDIDATE_MV[8]’ {aka ‘const struct candidate_mv[8]’} [-Warray-bounds]

As comment 15, compiles fine on Intel Atom Cherry Lake and Intel i7 gen 7 chips.  No such luck on AMD Phenom II 965.

Tied into Bug 678160?
Comment 17 N. Andrew Walsh 2019-04-18 13:07:11 UTC
(In reply to Wadlax from comment #15)
> Fixed emerge by setting full CPU_FLAGS_X86 in make.conf 
> and adding "media-libs/libaom -cpu_flags_x86_sse2" to the package.use
> 
> Had compile problems on AMD Phenom II X6
> Compile on Intel i7-4771 was ok without any changes
> (switched to CPU_FLAGS_X86 on both systems long ago)

changing libaom's use flags in package.use like this solved the issue for me. Thanks!
Comment 18 Ben Kohler gentoo-dev 2019-06-04 18:53:49 UTC
*** Bug 686770 has been marked as a duplicate of this bug. ***
Comment 19 thanasis 2019-06-08 09:51:44 UTC
Created attachment 579196 [details]
build log
Comment 20 Andreas Sturmlechner gentoo-dev 2019-07-01 09:16:31 UTC
*** Bug 687624 has been marked as a duplicate of this bug. ***
Comment 21 Ben 2019-09-19 16:01:46 UTC
Just ran into this, looks like upstream issue, but I'm a cmake n00b.  I haven't tested the resultant binary but this at least this patch allows build:

--- work.orig/aom_dsp/aom_dsp.cmake     2018-06-28 09:19:27.000000000 -0600
+++ work/aom_dsp/aom_dsp.cmake  2019-09-19 09:33:08.756420455 -0600
@@ -183,6 +183,7 @@
               "${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse2.c"
               "${AOM_ROOT}/aom_dsp/x86/quantize_sse2.c"
               "${AOM_ROOT}/aom_dsp/x86/sum_squares_sse2.c"
+              "${AOM_ROOT}/aom_dsp/x86/jnt_sad_ssse3.c"
               "${AOM_ROOT}/aom_dsp/x86/variance_sse2.c")
 
   list(APPEND AOM_DSP_ENCODER_ASM_SSSE3_X86_64
@@ -208,8 +209,7 @@
               "${AOM_ROOT}/aom_dsp/x86/masked_sad_intrin_ssse3.c"
               "${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.h"
               "${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c"
-              "${AOM_ROOT}/aom_dsp/x86/jnt_variance_ssse3.c"
-              "${AOM_ROOT}/aom_dsp/x86/jnt_sad_ssse3.c")
+              "${AOM_ROOT}/aom_dsp/x86/jnt_variance_ssse3.c")
 
   list(APPEND AOM_DSP_ENCODER_INTRIN_SSE4_1
               "${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse4.c"

With this patch I was able to build without SSSE3 enabled and it appears to not affect my machine with SSSE3.  As this patch is written, people with SSSE3 instructions must also enable SSE2 because I'm a cmake n00b and don't know a better way to do this (is it okay to duplicate files in the cmake file?).

Again I have not tested the resultant binaries so more testing is needed, the machine that I need to test on is currently building rust so it needs to be undisturbed for a while...
Comment 22 onkobu 2019-09-19 22:02:06 UTC
On a machine with cpuid2cpuflags with output of CPU_FLAGS_X86: aes avx f16c fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop and CPU_FLAGS_X86 to exactly this makes it work. It seems like the combination of avx and the more recent sse4*/ssse do the trick. Didn't need to apply a patch.
Comment 23 Ben 2019-09-19 22:42:17 UTC
Correct, newer machines that have SSSE3 set (will have SSE2 as well) and will thus build properly.

Only the older target machines that have SSE2 but not SSSE3 will have problems.  

Or if you typo SSE3 instead of SSSE3...
Comment 24 Ben 2019-09-22 17:04:13 UTC
Just wanted to follow up that the machine with SSE2 but not SSSE3 was able to build and run libaom with the patch.  I tried using it with ffmpeg-4 to encode av1 streams, it at least does not give me illegal instructions but could not discern if the program was working completely (the webpages I read about how to use ffmpeg to build av1 gave me this huge disclaimer about how slow it is, and I do witness the extreme slowness of using libaom compounded with the fact it's running on an old P4.)

www-client/firefox-68.1.0[system-av1] seems to build/run fine with the patched libaom, but I don't have any av1 streams to test playback against.
Comment 25 Alexander Bezrukov 2019-09-27 06:39:13 UTC
I have had yet no chance to check if the compiled binary actually functioning correctly (updated my ws from a mobile device while travelling abroad with almost no internet access) but I can confirm that the patch from comment #21 at least allows libaom to compile and link. K8 CPU with SSE2, SSE3 but not SSSE3, CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3".
Comment 26 garmine 2019-10-31 15:59:45 UTC
I can confirm libaom 1.0.0-r2 builds with the following flags set:

# grep CPU_FLAGS /etc/portage/make.conf
CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4a"

# grep libaom /etc/portage/package.use/default
media-libs/libaom -cpu_flags_x86_sse2 # gentoo bug #6713401

The machine is a VM running on AMD Epyc HW. Without the SSE2 flag disabled for the package the build fails with the above mentioned linker errors.
Comment 27 Jeroen Roovers (RETIRED) gentoo-dev 2019-11-07 08:51:55 UTC
*** Bug 699482 has been marked as a duplicate of this bug. ***
Comment 28 Markus Giese 2019-11-07 15:53:45 UTC
adding "media-libs/libaom -cpu_flags_x86_sse2" to package.use fixed it for me as well

cheers
Comment 29 jospezial 2020-03-28 23:17:45 UTC
Still the same even on live ebuild (did not test with the patch):

311/316] /usr/bin/cmake -E cmake_symlink_library libaom.so.1.0.0  libaom.so.0 libaom.so && :
[312/316] : && /usr/bin/x86_64-pc-linux-gnu-g++ -m32  -march=native -mtune=native -O2 -pipe  -std=c++11 -Wall -Wdisabled-optimization -Wextra -Wfloat-conversion -Wlogical-op -Wpointer-arith -Wsign-compare -Wtype-limits -Wuninitialized -Wunused -Wvla -Wstack-usage=240000 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--as-needed CMakeFiles/aom_common_app_util.dir/common/args.c.o CMakeFiles/aom_common_app_util.dir/common/av1_config.c.o CMakeFiles/aom_common_app_util.dir/common/md5_utils.c.o CMakeFiles/aom_common_app_util.dir/common/tools_common.c.o CMakeFiles/aom_common_app_util.dir/common/rawenc.c.o CMakeFiles/aom_common_app_util.dir/common/y4menc.c.o CMakeFiles/test_aom_common.dir/test/aom_integer_test.cc.o CMakeFiles/test_aom_common.dir/test/av1_config_test.cc.o CMakeFiles/test_aom_common.dir/test/blockd_test.cc.o CMakeFiles/test_aom_common.dir/test/decode_test_driver.cc.o CMakeFiles/test_aom_common.dir/test/log2_test.cc.o CMakeFiles/test_aom_common.dir/test/metadata_test.cc.o CMakeFiles/test_aom_common.dir/test/test_vectors.cc.o CMakeFiles/aom_decoder_app_util.dir/common/ivfdec.c.o CMakeFiles/aom_decoder_app_util.dir/common/obudec.c.o CMakeFiles/aom_decoder_app_util.dir/common/video_reader.c.o CMakeFiles/aom_decoder_app_util.dir/common/webmdec.cc.o CMakeFiles/test_aom_decoder.dir/test/decode_api_test.cc.o CMakeFiles/test_aom_decoder.dir/test/external_frame_buffer_test.cc.o CMakeFiles/test_aom_decoder.dir/test/invalid_file_test.cc.o CMakeFiles/test_aom_decoder.dir/test/test_vector_test.cc.o CMakeFiles/test_aom_encoder.dir/test/active_map_test.cc.o CMakeFiles/test_aom_encoder.dir/test/altref_test.cc.o CMakeFiles/test_aom_encoder.dir/test/aq_segment_test.cc.o CMakeFiles/test_aom_encoder.dir/test/borders_test.cc.o CMakeFiles/test_aom_encoder.dir/test/cpu_speed_test.cc.o CMakeFiles/test_aom_encoder.dir/test/datarate_test.cc.o CMakeFiles/test_aom_encoder.dir/test/svc_datarate_test.cc.o CMakeFiles/test_aom_encoder.dir/test/encode_api_test.cc.o CMakeFiles/test_aom_encoder.dir/test/encode_test_driver.cc.o CMakeFiles/test_aom_encoder.dir/test/end_to_end_test.cc.o CMakeFiles/test_aom_encoder.dir/test/fwd_kf_test.cc.o CMakeFiles/test_aom_encoder.dir/test/gf_pyr_height_test.cc.o CMakeFiles/test_aom_encoder.dir/test/rt_end_to_end_test.cc.o CMakeFiles/test_aom_encoder.dir/test/error_resilience_test.cc.o CMakeFiles/test_aom_encoder.dir/test/frame_size_tests.cc.o CMakeFiles/test_aom_encoder.dir/test/horz_superres_test.cc.o CMakeFiles/test_aom_encoder.dir/test/level_test.cc.o CMakeFiles/test_aom_encoder.dir/test/lossless_test.cc.o CMakeFiles/test_aom_encoder.dir/test/monochrome_test.cc.o CMakeFiles/test_aom_encoder.dir/test/qm_test.cc.o CMakeFiles/test_aom_encoder.dir/test/resize_test.cc.o CMakeFiles/test_aom_encoder.dir/test/scalability_test.cc.o CMakeFiles/test_aom_encoder.dir/test/y4m_test.cc.o CMakeFiles/test_aom_encoder.dir/test/time_stamp_test.cc.o CMakeFiles/aom_encoder_app_util.dir/common/ivfenc.c.o CMakeFiles/aom_encoder_app_util.dir/common/video_writer.c.o CMakeFiles/aom_encoder_app_util.dir/common/warnings.c.o CMakeFiles/aom_encoder_app_util.dir/common/y4minput.c.o CMakeFiles/aom_encoder_app_util.dir/examples/encoder_util.c.o CMakeFiles/aom_encoder_app_util.dir/common/webmenc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/cpu_id.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/planar_functions.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_any.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_common.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_gcc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_mips.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_neon.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_neon64.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_win.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_any.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_common.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_gcc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_mips.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_neon.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_neon64.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_win.cc.o CMakeFiles/webm.dir/third_party/libwebm/common/hdr_util.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvmuxer.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvwriter.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvparser/mkvparser.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvparser/mkvreader.cc.o CMakeFiles/test_libaom.dir/gen_src/usage_exit.c.o CMakeFiles/test_libaom.dir/test/test_libaom.cc.o  -o test_libaom  -Wl,-rpath,/var/tmp/portage/media-libs/libaom-9999/work/libaom-9999_build-abi_x86_32.x86  libaom.so.1.0.0  libaom_gtest.a  -lm  -lpthread && :
FAILED: test_libaom 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -m32  -march=native -mtune=native -O2 -pipe  -std=c++11 -Wall -Wdisabled-optimization -Wextra -Wfloat-conversion -Wlogical-op -Wpointer-arith -Wsign-compare -Wtype-limits -Wuninitialized -Wunused -Wvla -Wstack-usage=240000 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--as-needed CMakeFiles/aom_common_app_util.dir/common/args.c.o CMakeFiles/aom_common_app_util.dir/common/av1_config.c.o CMakeFiles/aom_common_app_util.dir/common/md5_utils.c.o CMakeFiles/aom_common_app_util.dir/common/tools_common.c.o CMakeFiles/aom_common_app_util.dir/common/rawenc.c.o CMakeFiles/aom_common_app_util.dir/common/y4menc.c.o CMakeFiles/test_aom_common.dir/test/aom_integer_test.cc.o CMakeFiles/test_aom_common.dir/test/av1_config_test.cc.o CMakeFiles/test_aom_common.dir/test/blockd_test.cc.o CMakeFiles/test_aom_common.dir/test/decode_test_driver.cc.o CMakeFiles/test_aom_common.dir/test/log2_test.cc.o CMakeFiles/test_aom_common.dir/test/metadata_test.cc.o CMakeFiles/test_aom_common.dir/test/test_vectors.cc.o CMakeFiles/aom_decoder_app_util.dir/common/ivfdec.c.o CMakeFiles/aom_decoder_app_util.dir/common/obudec.c.o CMakeFiles/aom_decoder_app_util.dir/common/video_reader.c.o CMakeFiles/aom_decoder_app_util.dir/common/webmdec.cc.o CMakeFiles/test_aom_decoder.dir/test/decode_api_test.cc.o CMakeFiles/test_aom_decoder.dir/test/external_frame_buffer_test.cc.o CMakeFiles/test_aom_decoder.dir/test/invalid_file_test.cc.o CMakeFiles/test_aom_decoder.dir/test/test_vector_test.cc.o CMakeFiles/test_aom_encoder.dir/test/active_map_test.cc.o CMakeFiles/test_aom_encoder.dir/test/altref_test.cc.o CMakeFiles/test_aom_encoder.dir/test/aq_segment_test.cc.o CMakeFiles/test_aom_encoder.dir/test/borders_test.cc.o CMakeFiles/test_aom_encoder.dir/test/cpu_speed_test.cc.o CMakeFiles/test_aom_encoder.dir/test/datarate_test.cc.o CMakeFiles/test_aom_encoder.dir/test/svc_datarate_test.cc.o CMakeFiles/test_aom_encoder.dir/test/encode_api_test.cc.o CMakeFiles/test_aom_encoder.dir/test/encode_test_driver.cc.o CMakeFiles/test_aom_encoder.dir/test/end_to_end_test.cc.o CMakeFiles/test_aom_encoder.dir/test/fwd_kf_test.cc.o CMakeFiles/test_aom_encoder.dir/test/gf_pyr_height_test.cc.o CMakeFiles/test_aom_encoder.dir/test/rt_end_to_end_test.cc.o CMakeFiles/test_aom_encoder.dir/test/error_resilience_test.cc.o CMakeFiles/test_aom_encoder.dir/test/frame_size_tests.cc.o CMakeFiles/test_aom_encoder.dir/test/horz_superres_test.cc.o CMakeFiles/test_aom_encoder.dir/test/level_test.cc.o CMakeFiles/test_aom_encoder.dir/test/lossless_test.cc.o CMakeFiles/test_aom_encoder.dir/test/monochrome_test.cc.o CMakeFiles/test_aom_encoder.dir/test/qm_test.cc.o CMakeFiles/test_aom_encoder.dir/test/resize_test.cc.o CMakeFiles/test_aom_encoder.dir/test/scalability_test.cc.o CMakeFiles/test_aom_encoder.dir/test/y4m_test.cc.o CMakeFiles/test_aom_encoder.dir/test/time_stamp_test.cc.o CMakeFiles/aom_encoder_app_util.dir/common/ivfenc.c.o CMakeFiles/aom_encoder_app_util.dir/common/video_writer.c.o CMakeFiles/aom_encoder_app_util.dir/common/warnings.c.o CMakeFiles/aom_encoder_app_util.dir/common/y4minput.c.o CMakeFiles/aom_encoder_app_util.dir/examples/encoder_util.c.o CMakeFiles/aom_encoder_app_util.dir/common/webmenc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/cpu_id.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/planar_functions.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_any.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_common.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_gcc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_mips.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_neon.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_neon64.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/row_win.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_any.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_common.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_gcc.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_mips.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_neon.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_neon64.cc.o CMakeFiles/yuv.dir/third_party/libyuv/source/scale_win.cc.o CMakeFiles/webm.dir/third_party/libwebm/common/hdr_util.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvmuxer.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvmuxer/mkvwriter.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvparser/mkvparser.cc.o CMakeFiles/webm.dir/third_party/libwebm/mkvparser/mkvreader.cc.o CMakeFiles/test_libaom.dir/gen_src/usage_exit.c.o CMakeFiles/test_libaom.dir/test/test_libaom.cc.o  -o test_libaom  -Wl,-rpath,/var/tmp/portage/media-libs/libaom-9999/work/libaom-9999_build-abi_x86_32.x86  libaom.so.1.0.0  libaom_gtest.a  -lm  -lpthread && :
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad4xh_sse2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad16xh_sse2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad64xh_sse2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad8xh_sse2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad32xh_sse2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libaom.so.1.0.0: undefined reference to `aom_sad128xh_sse2'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
 * ERROR: media-libs/libaom-9999::gentoo failed (compile phase):
 *   ninja -v -j1 -l0 failed

~ $ cpuid2cpuflags 
CPU_FLAGS_X86: 3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a

/etc/portage/make.conf:
CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a"

cat /proc/cpuinfo 
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 6
model name      : AMD Athlon(tm) II X2 240 Processor
stepping        : 2
microcode       : 0x10000c7
cpu MHz         : 800.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 5625.64
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
Comment 30 Alexander Bezrukov 2020-10-12 18:35:49 UTC
Created attachment 664903 [details, diff]
/etc/portage/patches/media-libs/libaom/cpuflags.patch rebased to media-libs/libaom-2.0.0

Atthached is the patch from comment #21 rebased to version 2.0.0.
I didn't do any encoding though but decoding seem to work on my setup (see comment #25).
Comment 31 Sergey Torokhov 2020-11-07 20:55:48 UTC
media-libs/libaom-2.0.0 failed to build for my sse2 (no sse3) CPU intel core-i3 550 with CPU_FLAGS_X86="sse2" and successfully merged with CPU_FLAGS_X86="-sse2".
Comment 32 Igor Franchuk 2020-12-21 10:52:36 UTC
Same problem. Same solution - I excluded sse2 from CPU_FLAGS_X86="mmx mmxext sse sse3" and libaom compiled.

Portage 3.0.9 (python 3.8.6-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-9.3.0, glibc-2.32-r2, 4.14.209-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-4.14.209-gentoo-x86_64-x86_64-Intel-R-_Atom-TM-_CPU_N2800_@_1.86GHz-with-glibc2.2.5
KiB Mem:     4020956 total,    767036 free
KiB Swap:   33554428 total,  31835844 free
Timestamp of repository gentoo: Thu, 03 Dec 2020 22:00:01 +0000
Head commit of repository gentoo: 4ff8360f1d859c6c0372d22c8d81462c7ff2d7be
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

local
    location: /var/db/repos/local
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/var/db/distfiles/"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=core2 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=core2 -O2 -pipe"
GENTOO_MIRRORS="https://gentoo-mirror.alexxy.name/ https://mirror.yandex.ru/gentoo-distfiles/ ftp://mirror.yandex.ru/gentoo-distfiles/ http://mirror.yandex.ru/gentoo-distfiles/ https://mirrors.gethosted.online/gentoo http://gentoo.cs.utah.edu/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB ru"
MAKEOPTS="-j4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 apache2 berkdb bluetooth branding build bzip2 cairo cdda cdr cgi chrome cli crypt ctype cups curl dbus declarative dri dts dvd dvdr egl elogind emboss encode exif fam fastcgi ffmpeg firefox flac fortran g3dvl gd gdbm gif gpm gtk gui hal handbook hpcups iconv icu id3tag ipv6 jpeg kde kipi kwallet lcms ldap libglvnd libnotify libtirpc mad mailwrapper melt mikmod mng mp3 mp4 mpeg mpm-event multilib mysql mysqli ncurses networkmanager nls nptl nvidia ogg opengl openmp opera pam pango pcre pdf perl phonon php plasma png policykit ppds python qml qt3support qt4 qt5 readline samba sdl seccomp semantic-desktop sftp snmp spell split-usr ssl startup-notification suexec svg symlink tcpd threads tiff truetype udev udisks unicode upower usb v4l video vorbis widgets wxwidgets x264 xattr xcb xml xsl xulrunner xv xvid xvmc zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 33 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-24 06:08:35 UTC
This one is supposedly fixed in 3.0.2 according to https://gitlab.com/webmproject/libaom/-/blob/master/CHANGELOG.