Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610340 - media-libs/gst-plugins-base-1.10.3 - ./.libs/libgstaudio-1.0.so: undefined reference to `resample_gint32_linear_1_sse41'
Summary: media-libs/gst-plugins-base-1.10.3 - ./.libs/libgstaudio-1.0.so: undefined re...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: GStreamer package maintainers
URL:
Whiteboard:
Keywords:
: 629926 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-21 06:43 UTC by Jeroen Roovers (RETIRED)
Modified: 2020-07-01 20:38 UTC (History)
3 users (show)

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


Attachments
emerge --info (emergeinfo.txt,6.80 KB, text/plain)
2017-02-25 12:55 UTC, Laurent Morretton
Details
Build.log (build.log.gz,51.54 KB, application/gzip)
2017-02-25 12:57 UTC, Laurent Morretton
Details
Patch to test (audio-resampler-consistent-sse-conditionals.patch,3.69 KB, patch)
2017-03-03 10:39 UTC, Mart Raudsepp
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 2017-02-21 06:43:53 UTC
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
Comment 1 Laurent Morretton 2017-02-25 12:53:33 UTC
Same problem here
Comment 2 Laurent Morretton 2017-02-25 12:55:03 UTC
Created attachment 465108 [details]
emerge --info
Comment 3 Laurent Morretton 2017-02-25 12:57:52 UTC
Created attachment 465110 [details]
Build.log
Comment 4 Laurent Morretton 2017-02-25 13:15:08 UTC
Removing some CFLAGS enables the building

CFLAGS="-march=amdfam10 -O2 -pipe" CXXFLAGS="-march=amdfam10 -O2 -pipe" emerge -1avq media-libs/gst-plugins-base
Comment 5 Mart Raudsepp gentoo-dev 2017-02-27 09:36:17 UTC
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?
Comment 6 Laurent Bachelier 2017-02-27 09:49:52 UTC
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.
Comment 7 Mart Raudsepp gentoo-dev 2017-02-27 09:54:49 UTC
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.
Comment 8 Laurent Bachelier 2017-02-27 14:33:10 UTC
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.
Comment 9 Mart Raudsepp gentoo-dev 2017-02-27 14:41:23 UTC
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.
Comment 10 Laurent Bachelier 2017-02-27 15:27:38 UTC
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
Comment 11 Mart Raudsepp gentoo-dev 2017-03-03 10:39:31 UTC
Created attachment 465802 [details, diff]
Patch to test

Can you please test the combinations with this patch that Arun wrote for us?
Comment 12 Laurent Bachelier 2017-03-03 13:10:12 UTC
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!
Comment 13 Andrey 2017-03-08 07:16:13 UTC
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
Comment 14 Mart Raudsepp gentoo-dev 2017-03-08 07:51:49 UTC
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.
Comment 15 Mart Raudsepp gentoo-dev 2017-04-11 00:58:17 UTC
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.
Comment 16 Mart Raudsepp gentoo-dev 2017-09-05 05:27:21 UTC
*** Bug 629926 has been marked as a duplicate of this bug. ***
Comment 17 Christian Bricart 2017-12-18 09:27:27 UTC
still affects =media-libs/gst-plugins-base-1.12.3
Comment 18 Larry the Git Cow gentoo-dev 2018-01-27 03:30:30 UTC
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(-)}
Comment 19 Judge Dredd 2020-03-15 16:39:02 UTC
The problem persists with media-libs/gst-plugins-base-1.14.5-r1
Comment 20 Mickaël Bucas 2020-07-01 20:37:52 UTC
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 "