Bug 198277 - PATCH: libsepol doesnt use CFLAGS every time
Summary: PATCH: libsepol doesnt use CFLAGS every time
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libsepol   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-10 20:14 UTC by Dennis Gilmore
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

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: ---


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

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.


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