libtool: link: x86_64-pc-linux-gnu-gcc -std=gnu99 -o /var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspect8dYlPX/.libs/GstAudio-1.0 -march=k8-sse3 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -mno-sse4a -mno-cx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 -O2 -g -Wall -fstack-protector -pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed tmp-introspect8dYlPX/var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspect8dYlPX/GstAudio-1.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -L. ./.libs/libgstaudio-1.0.so -L/usr/lib64 -L../../../gst-libs/gst/tag/ -lgio-2.0 -lgmodule-2.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -pthread -Wl,-rpath -Wl,/usr/lib64 ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_linear_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_cubic_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_full_1_sse41' collect2: error: ld returned 1 exit status
Same problem here
Created attachment 465108 [details] emerge --info
Created attachment 465110 [details] Build.log
Removing some CFLAGS enables the building CFLAGS="-march=amdfam10 -O2 -pipe" CXXFLAGS="-march=amdfam10 -O2 -pipe" emerge -1avq media-libs/gst-plugins-base
I can reproduce with -mno-sse4.1 added to CFLAGS, but curious if on these machines here that don't have SSE4.1 (and thus your written out -march=native including an explicit -mno-sse4.1) it fails with -march=native too?
I was able to compile with -march=native on a "AMD Turion(tm) Neo X2 Dual Core Processor L625", which does not have SSE4.1.
Did you have USE=introspection there? The failure is in introspection building, works otherwise. I don't have any actively used non-SSE4.1 machines, so for further investigation it'd be good to know if -march=native and that written out manually makes a difference with USE=introspection. -march=native written out means replacing -march=native in your CFLAGS with the highlighted part of this output: gcc -march=native -E -v - </dev/null 2>&1 | grep cc1 |grep '[-]march.*tune.* ' That is, -march and -mtune from that output, with everything inbetween included as well.
Yes, I have USE="X alsa introspection nls ogg orc pango theora vorbis" When it failed my CFLAGS were: -march=k8-sse3 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 To try without introspection I have to adjust other packages too, so I'm not going to try for now.
There is no need to try without introspection. I wanted -march=native vs -march=native spelled out tried as I told in my previous comment. I still don't have an answer to that.
CFLAGS="-march=native -O2 -pipe" emerge -1 media-libs/gst-plugins-base => success CFLAGS="-march=k8-sse3 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 -O2 -pipe" emerge -1 media-libs/gst-plugins-base => failure ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_linear_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_cubic_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_full_1_sse41' collect2: error: ld returned 1 exit status linking of temporary binary failed: Command '[u'../../../libtool', u'--mode=link', u'--tag=CC', 'x86_64-pc-linux-gnu-gcc', '-std=gnu99', u'-o', u'/var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspectuRP9nN/GstAudio-1.0', u'-export-dynamic', '-march=k8-sse3', '-mmmx', '-m3dnow', '-msse', '-msse2', '-msse3', '-mno-ssse3', '-mno-sse4a', '-mcx16', '-msahf', '-mno-movbe', '-mno-aes', '-mno-sha', '-mno-pclmul', '-mno-popcnt', '-mno-abm', '-mno-lwp', '-mno-fma', '-mno-fma4', '-mno-xop', '-mno-bmi', '-mno-bmi2', '-mno-tbm', '-mno-avx', '-mno-avx2', '-mno-sse4.2', '-mno-sse4.1', '-mno-lzcnt', '-mno-rtm', '-mno-hle', '-mno-rdrnd', '-mno-f16c', '-mno-fsgsbase', '-mno-rdseed', '-mprfchw', '-mno-adx', '-mfxsr', '-mno-xsave', '-mno-xsaveopt', '-mno-avx512f', '-mno-avx512er', '-mno-avx512cd', '-mno-avx512pf', '-mno-prefetchwt1', '--param', 'l1-cache-size=64', '--param', 'l1-cache-line-size=64', '--param', 'l2-cache-size=512', '-mtune=k8', '-O2', '-pipe', '-Wl,-O1', '-Wl,--as-needed', u'tmp-introspectuRP9nN/var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspectuRP9nN/GstAudio-1.0.o', '-L.', 'libgstaudio-1.0.la', '-L/usr/lib64', '-rpath', '/usr/lib64', '-L/usr/lib64', '-rpath', '/usr/lib64', '-L../../../gst-libs/gst/tag/', u'-lgio-2.0', u'-Wl,--export-dynamic', u'-lgmodule-2.0', u'-pthread', u'-lgstbase-1.0', u'-lgstreamer-1.0', u'-lgobject-2.0', u'-lglib-2.0']' returned non-zero exit status 1 bonus test : CFLAGS="-march=native -O2 -pipe -mno-sse4.1" emerge -1 media-libs/gst-plugins-base => failure ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_linear_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_cubic_1_sse41' ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_full_1_sse41' collect2: error: ld returned 1 exit status linking of temporary binary failed: Command '[u'../../../libtool', u'--mode=link', u'--tag=CC', 'x86_64-pc-linux-gnu-gcc', '-std=gnu99', u'-o', u'/var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspectLqRcbq/GstAudio-1.0', u'-export-dynamic', '-march=native', '-O2', '-pipe', '-mno-sse4.1', '-Wl,-O1', '-Wl,--as-needed', u'tmp-introspectLqRcbq/var/tmp/portage/media-libs/gst-plugins-base-1.10.3/work/gst-plugins-base-1.10.3-abi_x86_64.amd64/gst-libs/gst/audio/tmp-introspectLqRcbq/GstAudio-1.0.o', '-L.', 'libgstaudio-1.0.la', '-L/usr/lib64', '-rpath', '/usr/lib64', '-L/usr/lib64', '-rpath', '/usr/lib64', '-L../../../gst-libs/gst/tag/', u'-lgio-2.0', u'-Wl,--export-dynamic', u'-lgmodule-2.0', u'-pthread', u'-lgstbase-1.0', u'-lgstreamer-1.0', u'-lgobject-2.0', u'-lglib-2.0']' returned non-zero exit status 1
Created attachment 465802 [details, diff] Patch to test Can you please test the combinations with this patch that Arun wrote for us?
With the attached patch: * Applying patches from /etc/portage/patches/media-libs/gst-plugins-base ... * sse41.patch ... CFLAGS="-march=native -O2 -pipe -mno-sse4.1" emerge -1 media-libs/gst-plugins-base => success CFLAGS="-march=native -O2 -pipe" emerge -1 media-libs/gst-plugins-base => success CFLAGS="-march=k8-sse3 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 -O2 -pipe" emerge -1 media-libs/gst-plugins-base => success Great!
Hi. Could you please add patch from this thread do the portage tree? I've tried to apply it on my local version by adding this lines: src_prepare() { epatch "${FILESDIR}"/sse.patch } but I've got errors
There were some pending concerns from Arun and others in this version of the patch, so I didn't include it yet. You can put it in /etc/portage/patches/media-libs/gst-plugins-base or not use -mno-sse* flags in your CFLAGS while compiling this meanwhile. Make sure to remove the patch after something does get committed to main tree.
As an update, Arun, Nirbheek and me have been discussing about this and hopefully we get to an upstream acceptable solution soon, at which point I can include the patches. Meanwhile just use -march=native properly or don't needlessly add -mno flags that break this. I sometimes use just a written out -march=native too (as in comment #7) for distcc or other purposes, so I want it fully fixed too eventually.
*** Bug 629926 has been marked as a duplicate of this bug. ***
still affects =media-libs/gst-plugins-base-1.12.3
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba018ae41ad2ef5b0bc78ad9a93d1dc982522be0 commit ba018ae41ad2ef5b0bc78ad9a93d1dc982522be0 Author: Mart Raudsepp <leio@gentoo.org> AuthorDate: 2018-01-26 23:33:35 +0000 Commit: Mart Raudsepp <leio@gentoo.org> CommitDate: 2018-01-27 03:29:20 +0000 media-libs/gst-plugins-base: filter out -mno-sse* flags that break introspection build People who copy-paste the whole -march=native meaning out in full detail from the various commands that give the equivalent face issues with the build here, because the build system adds -msse4.1 and other flags explicitly itself to build runtime tested SSE accelerated code, which doesn't get used if the runtime CPU doesn't support them. Because of CFLAGS ordering of -mno-sse4.1 from make.conf and -msse4.1 from gst-plugins-base configure, and apparently slightly different flags used for introspection generation, this ends up with introspection build thinking the SSE specific symbols are there, while they actually aren't. People who do this copy-pasting, really shouldn't be copying it all over verbatim, especially the -mno-* flags, which are redundant in the usual situation (the specific -march= probably doesn't enable them, so no need to -mno them), but causes issues for such specific runtime checked optimizations. Because we have a concrete list of instruction set flags in configure.ac that we'd hit the issue with when the opposite -mno is present in CFLAGS, be nice to these users by explicitly filtering out these redundant flags. I think there's still something to fix in an upstream patch instead (the different flags between library and introspection build?) , hence leaving the bug open for the time being still. Bug: https://bugs.gentoo.org/610340 Package-Manager: Portage-2.3.19, Repoman-2.3.6 media-libs/gst-plugins-base/gst-plugins-base-1.12.4.ebuild | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)}
The problem persists with media-libs/gst-plugins-base-1.14.5-r1
Same problem with =media-libs/gst-plugins-base-1.16.2::gentoo, because I use distcc and must have explicit CFLAGS including -mno-sse4.1 like below. If I disable distcc and use simpler CFLAGS="-O3 -pipe -fomit-frame-pointer -march=native", compilation ends successfully. CFLAGS="-O3 -pipe -fomit-frame-pointer -march=amdfam10 -mtune=amdfam10 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mmmx -m3dnow -msse -msse2 -msse3 -mno-ssse3 -msse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mabm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-sgx -mno-bmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite "