Bug 198277

Summary: PATCH: libsepol doesnt use CFLAGS every time
Product: [Fedora] Fedora Reporter: Dennis Gilmore <dennis>
Component: libsepolAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: sdsmall, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-31 16:05:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
have libsepol use CFLAGS always none

Description Dennis Gilmore 2006-07-10 20:14:55 UTC
Description of problem:

libsepol doesnt use CFLAGS every time attached patch fixes that


additionally sparc64 needs to use -fPIC not -fpic  

please put  this in the %prep section of the spec.  if you prefer a patch 
please let me know

# sparc64 is an -fPIC arch, so we need to fix it here
%ifarch sparc64
sed -i 's/fpic/fPIC/g' src/Makefile
%endif

Comment 1 Dennis Gilmore 2006-07-10 20:14:56 UTC
Created attachment 132194 [details]
have libsepol use CFLAGS always

Comment 2 Stephen Smalley 2006-07-11 12:47:05 UTC
If you want to pass a flag to the linker, set LDFLAGS.
Don't add CFLAGS to the linking command line.


Comment 3 Stephen Smalley 2006-07-11 12:50:56 UTC
Ulrich's guidance was to use -fpic whenever possible, so we wouldn't want to
change the default there, but possibly we should put that into its own variable
so that you can override it on the make commandline w/o needing to patch the
Makefile.


Comment 4 Tom "spot" Callaway 2006-07-11 13:04:57 UTC
sparc64 needs -fPIC only when the GOT size for the linked executable exceeds the
maximum machine size (which it does in libsepol). Most other arches will use
-fpic happily, so it is a good default. Having a variable that I can override
for sparc64 will resolve this issue cleanly.

Comment 5 Tom "spot" Callaway 2006-07-11 21:54:16 UTC
(In reply to comment #2)
> If you want to pass a flag to the linker, set LDFLAGS.
> Don't add CFLAGS to the linking command line.

Yes, but you're not using "ld" to link. You're using gcc. The flags that would
be appropriate for ld to link as a sparc64 binary are not the same flags that
would be appropriate for gcc.to link a sparc64 binary. CFLAGS is appropriate
when you're using gcc, thus, the patch.
 



Comment 6 Daniel Walsh 2006-08-31 16:05:53 UTC
This has been in rawhide for quite some time.