mortie / swaylock-effects

Swaylock, with fancy effects
MIT License
708 stars 45 forks source link

Fails to build swaylock.p/fade.c.o #26

Closed MatthiasCoppens closed 4 years ago

MatthiasCoppens commented 4 years ago

I'm packaging this project for Gentoo, but since https://github.com/mortie/swaylock-effects/commit/600477eade5dc77f14e34d99136ca7484da5aad5 it doesn't build on my machine.

Meson version: 0.55.1 Ninja version: 1.10.0 OS: Gentoo Linux Processor: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz

build log ``` ninja: Entering directory `build' [1/2] Compiling C object swaylock.p/fade.c.o FAILED: swaylock.p/fade.c.o ccache cc -Iswaylock.p -I. -I.. -Iinclude -I../include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -g -Wno-unused-parameter -Wno-unused-result -Wundef -Wvla -fopenmp -O3 -mtune=native '-DSYSCONFDIR="//usr/local/etc"' '-DSWAYLOCK_VERSION="v1.6-1-6-g2cbc0c8 (" __DATE__ ", branch '"'"'master'"'"')"' -pthread -MD -MQ swaylock.p/fade.c.o -MF swaylock.p/fade.c.o.d -o swaylock.p/fade.c.o -c ../fade.c ../fade.c: In function 'set_alpha_sse': ../fade.c:41:22: error: implicit declaration of function '_mm_loadu_si64'; did you mean '_mm_loadl_epi64'? [-Werror=implicit-function-declaration] __m128i argb_vec = _mm_loadu_si64(orig_bytes + index); ^~~~~~~~~~~~~~ _mm_loadl_epi64 ../fade.c:41:22: error: incompatible types when initializing type '__m128i' {aka '__vector(2) long long int'} using type 'int' ../fade.c:49:3: error: implicit declaration of function '_mm_storeu_si64'; did you mean '_mm_store_epi64'? [-Werror=implicit-function-declaration] _mm_storeu_si64(dest_bytes + index, argb_vec); ^~~~~~~~~~~~~~~ _mm_store_epi64 cc1: all warnings being treated as errors ninja: build stopped: subcommand failed. ```
mortie commented 4 years ago

Hmm, it looks like GCC before 9 was missing the _mm_loadu_si64 intrinsic: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78782

I would've thought Gentoo has a fairly recent GCC though. Which version of GCC are you using?

In any case, a workaround for the time being would be to either patch out the code in #ifdef __SSE2__, compile without SSE2 with -mno-sse2, or use GCC >=9. I'll have to find a way to implement what I'm doing without using that particular SSE intrinsic.

MatthiasCoppens commented 4 years ago

Great! I'm using GCC 8.4.0 on my machine, but versions 6.5.0, 7.5.0, 8.4.0 and 9.3.0 are stable in Gentoo. I'll include in the deps that swaylock-effects depends on GCC 9.3.0.