Bug 198277 - PATCH: libsepol doesnt use CFLAGS every time
PATCH: libsepol doesnt use CFLAGS every time
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: libsepol (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-10 16:14 EDT by Dennis Gilmore
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-31 12:05:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
have libsepol use CFLAGS always (433 bytes, patch)
2006-07-10 16:14 EDT, Dennis Gilmore
no flags Details | Diff

  None (edit)
Description Dennis Gilmore 2006-07-10 16:14:55 EDT
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 16:14:56 EDT
Created attachment 132194 [details]
have libsepol use CFLAGS always
Comment 2 Stephen Smalley 2006-07-11 08:47:05 EDT
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 08:50:56 EDT
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 09:04:57 EDT
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 17:54:16 EDT
(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 12:05:53 EDT
This has been in rawhide for quite some time.

Note You need to log in before you can comment on or make changes to this bug.