git: 7cbdbdbb7383 - main - multimedia/obs-studio: Fix IPO failure by adding -fPIC

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 12 Oct 2025 09:51:30 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7cbdbdbb7383c98aa67fc5359fb908b93ade705b

commit 7cbdbdbb7383c98aa67fc5359fb908b93ade705b
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-10-12 07:33:20 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-10-12 09:51:27 +0000

    multimedia/obs-studio: Fix IPO failure by adding -fPIC
    
    ... instead of disabling IPO.
---
 multimedia/obs-studio/Makefile                          |  5 +++--
 .../files/patch-cmake_common_compiler__common.cmake     | 17 -----------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/multimedia/obs-studio/Makefile b/multimedia/obs-studio/Makefile
index 77daa095df05..9c1885ce3a96 100644
--- a/multimedia/obs-studio/Makefile
+++ b/multimedia/obs-studio/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	obs-studio
 DISTVERSION=	32.0.1
+PORTREVISION=	1
 CATEGORIES=	multimedia
 MASTER_SITES=	https://github.com/obsproject/obs-studio/releases/download/${DISTVERSION}/
 DISTFILES=	OBS-Studio-${DISTVERSION}-Sources${EXTRACT_SUFX}
@@ -64,12 +65,12 @@ USE_LDCONFIG=	yes
 CMAKE_ARGS=	-DOBS_VERSION_OVERRIDE:STRING="${PORTVERSION}" \
 		-DQT_VERSION=6 \
 		-DPython_EXECUTABLE="${PYTHON_CMD}"
-CMAKE_ARGS+=	-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF # prevent errors like: ld: error: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC
-# see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290157
 
 CFLAGS+=	-Wno-error=attribute-warning
 CFLAGS_powerpc64=	-Wno-error=deprecated-altivec-src-compat -Wno-error=pass-failed
 CFLAGS_powerpc64le=	-Wno-error=deprecated-altivec-src-compat
+CFLAGS+=	-fPIC # otherwise we get: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC
+CXXFLAGS+=	-fPIC # otherwise we get: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC
 LDFLAGS+=	-fPIC # pending https://github.com/obsproject/obs-studio/issues/3436
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-sources
diff --git a/multimedia/obs-studio/files/patch-cmake_common_compiler__common.cmake b/multimedia/obs-studio/files/patch-cmake_common_compiler__common.cmake
deleted file mode 100644
index 0e8fd4425f84..000000000000
--- a/multimedia/obs-studio/files/patch-cmake_common_compiler__common.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# disable IPO due to breakage:
-# ld: error: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC
-
---- cmake/common/compiler_common.cmake.orig	2025-01-06 17:00:00 UTC
-+++ cmake/common/compiler_common.cmake
-@@ -28,8 +28,8 @@ if(HAS_INTERPROCEDURAL_OPTIMIZATION)
-   message(STATUS "Checking for interprocedural optimization support - enabled [Release, MinSizeRel]")
-   set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF)
-   set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF)
--  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
--  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON)
-+  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
-+  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF)
- else()
-   message(STATUS "Checking for interprocedural optimization support - disabled")
-   set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF)
-