Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please compile opa-fm with flag '-fPIC' #18

Closed
ghost opened this issue Jun 11, 2019 · 1 comment
Closed

please compile opa-fm with flag '-fPIC' #18

ghost opened this issue Jun 11, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 11, 2019

Fedora and RHEL requires compile C/C++ code with strict options for security enhance. So, executables must be linked with '-pie' flag. That needs the C/C++ files compiled with '-fPIC' flag.

Please consider apply this patch.

$ cat add-fPIC-flag.patch 
diff --git a/Makerules/Target.LINUX.GNU.X86_64 b/Makerules/Target.LINUX.GNU.X86_64
index 5a852b3..194a8b2 100755
--- a/Makerules/Target.LINUX.GNU.X86_64
+++ b/Makerules/Target.LINUX.GNU.X86_64
@@ -77,8 +77,8 @@ SHLIB_SONAME=$(notdir $(CMD_TARGETS_SHLIB))
 # ----------------------------
 # -fcheck-new does the opposite of what the manual implies.
 # -fcheck-new DISABLES the run-time test of return value from new
-CMACH		= -pipe -DTARGET_CPU_FAMILY_X86 -Wall -Werror=format-security -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector
-CCMACH		= -pipe -DTARGET_CPU_FAMILY_X86 -Wall -Werror=format-security -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector -fcheck-new -Wno-ctor-dtor-privacy
+CMACH		= -fPIC -pipe -DTARGET_CPU_FAMILY_X86 -Wall -Werror=format-security -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector
+CCMACH		= -fPIC -pipe -DTARGET_CPU_FAMILY_X86 -Wall -Werror=format-security -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector -fcheck-new -Wno-ctor-dtor-privacy
 ifeq ($(shell expr $(GCC_MAJOR_VERSION) \>= 7), 1)
 ifeq ($(shell expr $(GCC_MINOR_VERSION) \>= 0), 1)
 CMACH+= -std=gnu90 -Wno-misleading-indentation -Wno-format-truncation
@ddalessa
Copy link

ddalessa commented Oct 3, 2024

Closing along with the other issue. This is 5+ years old and -fPIC is being added.

@ddalessa ddalessa closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant