Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655616 - media-libs/mesa-17.3.9 on sparc - glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `cache_put': disk_cache.c:(.text+0xab4): undefined reference to `__atomic_fetch_add_8'
Summary: media-libs/mesa-17.3.9 on sparc - glsl/.libs/libstandalone.a(libmesautil_la-d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-12 22:22 UTC by spock128
Modified: 2018-06-15 21:35 UTC (History)
1 user (show)

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


Attachments
0001-configure.ac-meson.build-Fix-latomic-test.patch (0001-configure.ac-meson.build-Fix-latomic-test.patch,2.38 KB, patch)
2018-06-06 23:56 UTC, Matt Turner
Details | Diff
0002-configure.ac-rework-latomic-check.patch (0002-configure.ac-rework-latomic-check.patch,4.70 KB, patch)
2018-06-06 23:56 UTC, Matt Turner
Details | Diff
0003-check__atomic_add_fetch-too.patch (0003-check__atomic_add_fetch-too.patch,1.99 KB, patch)
2018-06-10 13:05 UTC, spock128
Details | Diff
0003-check__atomic_add_fetch-too.patch fix (0003-check__atomic_add_fetch-too.patch,1.99 KB, patch)
2018-06-12 11:47 UTC, spock128
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description spock128 2018-05-12 22:22:27 UTC
I've been having trouble building the current stable version of media-libs/mesa on Sparc:

# emerge -v1 mesa
...
libtool: link: sparc-unknown-linux-gnu-ranlib glsl/.libs/libstandalone.a
libtool: link: rm -fr glsl/.libs/libstandalone.lax glsl/.libs/libstandalone.lax
libtool: link: ( cd "glsl/.libs" && rm -f "libstandalone.la" && ln -s "../libstandalone.la" "libstandalone.la" )
/bin/sh ../../libtool  --tag=CXX   --mode=link sparc-unknown-linux-gnu-g++ -fvisibility=hidden -Werror=vla -mcpu=ultrasparc -O2 -pipe -Wall -fno-math-errno -fno-trapping-math   -Wl,-O1 -Wl,--as-needed -o glsl_compiler glsl/main.o glsl/libstandalone.la
libtool: link: sparc-unknown-linux-gnu-g++ -fvisibility=hidden -Werror=vla -mcpu=ultrasparc -O2 -pipe -Wall -fno-math-errno -fno-trapping-math -Wl,-O1 -Wl,--as-needed -o glsl_compiler glsl/main.o  glsl/.libs/libstandalone.a -lz -lpthread -pthread
glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `cache_put':
disk_cache.c:(.text+0xab4): undefined reference to `__atomic_fetch_add_8'
disk_cache.c:(.text+0xdcc): undefined reference to `__atomic_fetch_add_8'
glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `disk_cache_remove':
disk_cache.c:(.text+0x1374): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status

As suggested in this forum thread https://forums.gentoo.org/viewtopic-t-1081066.html I was able to work around the build failure by adding LDFLAGS=-latomic using package.env
Comment 1 Matt Turner gentoo-dev 2018-06-06 23:56:02 UTC
Can you confirm that this occurs with mesa-18.1.x?

If so, can you please drop these two patches into /etc/portage/patches/media-libs/mesa and try again (See https://wiki.gentoo.org/wiki//etc/portage/patches)?
Comment 2 Matt Turner gentoo-dev 2018-06-06 23:56:40 UTC
Created attachment 535164 [details, diff]
0001-configure.ac-meson.build-Fix-latomic-test.patch
Comment 3 Matt Turner gentoo-dev 2018-06-06 23:56:56 UTC
Created attachment 535166 [details, diff]
0002-configure.ac-rework-latomic-check.patch
Comment 4 spock128 2018-06-10 13:05:17 UTC
Created attachment 535532 [details, diff]
0003-check__atomic_add_fetch-too.patch

The previous two patches weren't enough to get media-libs/mesa-18.1.1-r1 to compile, but I used them as a base for this patch that does work.  Apparently, not all __atomic calls require -latomic on some archs.
Comment 5 Matt Turner gentoo-dev 2018-06-11 22:00:04 UTC
(In reply to spock128 from comment #4)
> Created attachment 535532 [details, diff] [details, diff]
> 0003-check__atomic_add_fetch-too.patch
> 
> The previous two patches weren't enough to get media-libs/mesa-18.1.1-r1 to
> compile, but I used them as a base for this patch that does work. 
> Apparently, not all __atomic calls require -latomic on some archs.

Thanks, I will send that upstream if you'll tell me your first and last names as you'd like them to appear in the Git log :)
Comment 6 spock128 2018-06-12 11:47:27 UTC
Created attachment 535698 [details, diff]
0003-check__atomic_add_fetch-too.patch fix

Oops, just noticed an error in that patch. This one should be correct.
- Andrew Galante
Comment 7 Matt Turner gentoo-dev 2018-06-13 00:51:34 UTC
(In reply to spock128 from comment #6)
> Created attachment 535698 [details, diff] [details, diff]
> 0003-check__atomic_add_fetch-too.patch fix
> 
> Oops, just noticed an error in that patch. This one should be correct.
> - Andrew Galante

Thank you. I've slightly modified the patch and sent it upstream for review. I hope to have it included in 18.1.2.
Comment 8 Matt Turner gentoo-dev 2018-06-13 22:21:31 UTC
Excellent. The patches are now upstream and will be in 18.1.2.

If you have time , please give mesa-9999 a build test to confirm that everything is working under the Meson build system we've recently switched to.

18.1.2 will be out this Friday at which point we'll close this bug if it builds for you. I expect to request stabilization of 18.1.x sometime soon.
Comment 9 spock128 2018-06-14 13:18:20 UTC
mesa-9999 works for me, will check out 18.1.2.
Comment 10 Matt Turner gentoo-dev 2018-06-15 21:35:28 UTC
18.1.2 is now in tree. If you have time to confirm it compiles for you, that would be great. Thanks again!