obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Please remove broken cmake code for e2k.

Open ilyakurdyukov opened this issue 2 months ago • 3 comments

Operating System Info

Other

Other OS

AltLinux

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

none

OBS Studio Crash Log URL

No response

Expected Behavior

cmake should succeed

Current Behavior

https://github.com/obsproject/obs-studio/blob/10bfa99365c1ed1df27f3a0af60c218a46d9071b/cmake/Modules/CompilerConfig.cmake#L171

This code uses a minus sign from the warning option in the variable name, which breaks cmake.

/usr/bin/cc   -pipe -Wall -Wno-error -g -O3 -march=elbrus-v5  -std=gnu17   -DC_COMPILER_SUPPORTS_FLAG_-Wno-unused-parameter -Wno-unused-parameter -o CMakeFiles/cmTC_ff446.dir/src.c.o -c /usr/src/RPM/BUILD/obs-studio-30.1.2/e2kv5-alt-linux/CMakeFiles/CMakeScratch/TryCompile-PVn0pT/src.c
lcc: Warning #1648: '=' assumed following macro name
          "C_COMPILER_SUPPORTS_FLAG_" in command-line definition

And then cmake fail on any compile tests, like this:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)

I didn’t find in the history who added this code for e2k. It's better to delete this code, you won't be able to maintain it. And those distributions that work with this architecture will patch it themselves.

Steps to Reproduce

try to build on e2k machine

Anything else we should know?

Where's the build issues template, did you expect this to never happen?

ilyakurdyukov avatar Apr 20 '24 05:04 ilyakurdyukov

Support was added by a contributor 4 years ago: https://github.com/obsproject/obs-studio/pull/3288

Probably worth just dropping support at this point, but unlikely to be something we fix ourselves as we don't have access to any e2k machines.

Feel free to open a PR to remove the problematic code.

Fenrirthviti avatar Apr 20 '24 06:04 Fenrirthviti

@makise-homura Not sure if you're still participating on github all that much, but if you're around it seems that e2k isn't currently compiling.

@ilyakurdyukov It's one thing to say "There's a bug in this code" or "this code is incorrect", and maybe I would have even been fine with "buggy code", but saying "poorly written" is unnecessary wording that goes beyond that, don't you think? It was kind enough that a contributor came around to advocate for and add support for e2k, so I don't see the point of adding unnecessary wording such as "poorly written" other than to be abrasive. Please kindly keep such abrasive and unnecessary wording out of our repository, and keep things constructive as per our conduct guidelines. We try to work together, not against one another.

Anyway, you're saying to remove it, but whether we remove it or not, it's not like anything will change for people who use e2k anyway if it were removed. If it's not currently compiling then it still won't compile anyway. So I'm not sure why you even made this issue report. Probably would have been better to just to ignore it at that point and move on from.

Lain-B avatar Apr 20 '24 07:04 Lain-B

@makise-homura, please fix this.

This breaks cmake-3.28.3 very badly. I disabled this code and don't see any of the warnings listed, so not only is it broken, but it's no longer needed.

I successfully built the obs-studio using these hacks:

sed -i '/MATCHES "e2k"/c if(false)' cmake/Modules/CompilerConfig.cmake
%add_optflags -DSIMDE_ARCH_AMD64=1000 -mno-sse4.2

The only spam warning in the log:

lcc: "/usr/src/RPM/BUILD/obs-studio-30.1.2/libobs/graphics/../util/simde/x86/sse2.h", line 5427: warning #1675:
          unrecognized GCC pragma [-Wunknown-pragmas]
  	SIMDE_VECTORIZE
  	    ^

This warning appeared 3419 times during the build.

ilyakurdyukov avatar Apr 20 '24 12:04 ilyakurdyukov