obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
59.14k stars 7.86k forks source link

libobs pkgconfig (and possibly cmake) configs are broken on non-x86_64 (particularly AArch64) #7972

Closed Conan-Kudo closed 5 months ago

Conan-Kudo commented 1 year ago

Operating System Info

Other

Other OS

Fedora Linux 37

OBS Studio Version

Other

OBS Studio Version (Other)

29.0.0-beta3

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior

I wanted to be able to build obs-webkitgtk for OBS Studio on AArch64 so that I can use it as a temporary substitute until I could get CEF built and packaged.

Current Behavior

I wanted to be able to build obs-webkitgtk for OBS Studio on AArch64 so that I can use it as a temporary substitute until I could get CEF built and packaged, but when trying to compile it, I get the following errors:

[1/4] gcc -Iobs-webkitgtk.so.p -I. -I.. -I/usr/include/obs -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -pthread -DHAVE_OBSCONFIG_H -DSIMDE_ENABLE_OPENMP '$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>' '$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>' -MD -MQ obs-webkitgtk.so.p/obs-webkitgtk.c.o -MF obs-webkitgtk.so.p/obs-webkitgtk.c.o.d -o obs-webkitgtk.so.p/obs-webkitgtk.c.o -c ../obs-webkitgtk.c
FAILED: obs-webkitgtk.so.p/obs-webkitgtk.c.o 
gcc -Iobs-webkitgtk.so.p -I. -I.. -I/usr/include/obs -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -pthread -DHAVE_OBSCONFIG_H -DSIMDE_ENABLE_OPENMP '$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>' '$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>' -MD -MQ obs-webkitgtk.so.p/obs-webkitgtk.c.o -MF obs-webkitgtk.so.p/obs-webkitgtk.c.o.d -o obs-webkitgtk.so.p/obs-webkitgtk.c.o -c ../obs-webkitgtk.c
gcc: warning: $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>: linker input file unused because linking not done
gcc: error: $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>: linker input file not found: No such file or directory
gcc: warning: $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>: linker input file unused because linking not done
gcc: error: $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>: linker input file not found: No such file or directory
[2/4] gcc -Iobs-webkitgtk-helper.p -I. -I.. -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/webkitgtk-4.0 -I/usr/include/libsoup-2.4 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -pthread -MD -MQ obs-webkitgtk-helper.p/obs-webkitgtk-helper.c.o -MF obs-webkitgtk-helper.p/obs-webkitgtk-helper.c.o.d -o obs-webkitgtk-helper.p/obs-webkitgtk-helper.c.o -c ../obs-webkitgtk-helper.c
ninja: build stopped: subcommand failed.

Steps to Reproduce

  1. Build obs-studio for AArch64
  2. Examine the generated libobs.pc and cmake configs

Anything else we should know?

I have a COPR with builds of obs-studio and obs-webkitgtk that demonstrates the problem.

The pkgconfig file looks like this in the AArch64 version of obs-studio-devel:

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include/obs

Name: libobs
Description: OBS Studio Library
Version: 29.0.0
Cflags: -I${includedir} -DHAVE_OBSCONFIG_H -DSIMDE_ENABLE_OPENMP $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>  
Libs: -L${libdir} -lobs 

The x86_64 version (which works) looks like this:

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include/obs

Name: libobs
Description: OBS Studio Library
Version: 29.0.0
Cflags: -I${includedir} -DHAVE_OBSCONFIG_H -mmmx -msse -msse2  
Libs: -L${libdir} -lobs 
Conan-Kudo commented 1 year ago

cc: @davide125, @marcan, @asahilina

kkartaltepe commented 1 year ago

I don't believe anyone is currently interested in supporting non-x86 linux platforms, so patches are welcome for issues on that platform.

mcatanzaro commented 1 year ago

Looks like a CMake-level problem. $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd> is a CMake expression, not a valid linker input file. ;)