You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling on Red Hat associated systems, the end compile will error out unless the -fPIE option is changed to -fPIC -pie -Wl,-z,relro,-z,now [The last part may be superfluous to the bug bit the -fPIC -pie are required.] This is probably due to the overall compiler options that Fedora and RHEL packages have but I have needed to carry a patch like the following for a while:
$ less vsomeip-compiler-flags.patch
diff -up ./CMakeLists.txt.compiler-flags ./CMakeLists.txt
--- ./CMakeLists.txt.compiler-flags 2025-01-17 11:25:57.000000000 +0000
+++ ./CMakeLists.txt 2025-03-14 20:29:38.052779251 +0000
@@ -78,7 +78,7 @@ endif()
if(NOT DEFINED _FORTIFY_SOURCE)
set(_FORTIFY_SOURCE 2)
endif()
- set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=${_FORTIFY_SOURCE} -Wformat -Wformat-security -Wpedantic -Werror -fPIE")
+ set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=${_FORTIFY_SOURCE} -Wformat -Wformat-security -Wpedantic -fPIC -pie -Wl,-z,relro,-z,now")
# force all use of std::mutex and std::recursive_mutex to use runtime init
# instead of static initialization so mutexes can be hooked to enable PI as needed
Reproduction Steps
When trying to build an RPM of vsomeip for EPEL or Fedora ends up with errors unless the above patch is applied. Steps to redo:
Install a Fedora or CentOS Stream VM.
Install mock and needed required packages for vsomeip
What I would like is that the CMake tests for the operating system and for specific ones (Fedora and RHEL) sets up the compile flags one way and defaults to the other elsewhere. However I am not sure if that is overall desired or wanted.
Logs and Screenshots
No response
The text was updated successfully, but these errors were encountered:
I have a couple other 'bugs' which I carry patches for in the src.rpm but I want to make sure i am opening things as the project expects (aka should they be bugs to track or just PRs)
vSomeip Version
v3.5.5
Boost Version
1.83
Environment
Fedora Linux > 33, RHEL-9, RHEL-10 gcc > 11.5.0
Describe the bug
When compiling on Red Hat associated systems, the end compile will error out unless the
-fPIE
option is changed to-fPIC -pie -Wl,-z,relro,-z,now
[The last part may be superfluous to the bug bit the -fPIC -pie are required.] This is probably due to the overall compiler options that Fedora and RHEL packages have but I have needed to carry a patch like the following for a while:Reproduction Steps
When trying to build an RPM of vsomeip for EPEL or Fedora ends up with errors unless the above patch is applied. Steps to redo:
mock
and needed required packages for vsomeiprpm -ivh vsomeip3*src.rpm
cd rpmbuild/SPECS/
rpmbuild -bp vsomeip3.spec
8
mock -r fedora-41-x86_64 ../SRPMS/vsome3*src.rpm
What it fail to build
Expected behaviour
What I would like is that the CMake tests for the operating system and for specific ones (Fedora and RHEL) sets up the compile flags one way and defaults to the other elsewhere. However I am not sure if that is overall desired or wanted.
Logs and Screenshots
No response
The text was updated successfully, but these errors were encountered: