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
sed -i 's/fpic/fPIC/g' src/Makefile
Created attachment 132194 [details]
have libsepol use CFLAGS always
If you want to pass a flag to the linker, set LDFLAGS.
Don't add CFLAGS to the linking command line.
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
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.
(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.
This has been in rawhide for quite some time.