Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88399 - SBCL 0.8.21: hardened USE flag error message misleading
Summary: SBCL 0.8.21: hardened USE flag error message misleading
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Lisp Project
URL:
Whiteboard:
Keywords:
: 64452 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-08 13:12 UTC by Tyler Berry
Modified: 2005-05-31 09:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Berry 2005-04-08 13:12:11 UTC
The new ebuild for SBCL 0.8.21 prints an error message if the user has
hardened in his USE flags. This is somewhat misleading; the stack protector
and PIC options for hardened GCC do cause a compiler error during the SBCL
build, but there's an easy way around this not mentioned by the error
message which is available even if GCC was compiled with hardened. 

Namely, use gcc-config to select the -vanilla variant of the GCC compiled
with the hardened flag, do 'source /etc/profile', and emerge SBCL. Given the
current setup in the ebuild, you also have to do USE="-hardened" just to
disable the error message and allow the build to happily proceed.

It would be nice to expand the printed error message in the ebuild so that
users with hardened GCC don't unnecessarily rebuild their C compiler just
to install SBCL; ideally, the ebuild could look at the currently selected GCC
profile and print a better error message.

Caveat; this is all assuming ~x86 Gentoo, which is all that I use. I don't know
if gcc-config is in use on non-tilde Gentoo yet.
Comment 1 Matthew Kennedy (RETIRED) gentoo-dev 2005-04-09 13:43:27 UTC
Thanks for this information, I going to add 

pkg_setup() {
	if gcc-config -c |grep hardened; then
		while read line; do einfo "${line}"; done <<EOF

So-called "hardened" compiler features are incompatible with SBCL.	You must use
gcc-config to select a profile with non-hardened features and "source
/etc/profile" before continuing.

EOF
	fi
}

Do you think thats reasonable?
Comment 2 Matthew Kennedy (RETIRED) gentoo-dev 2005-04-09 14:31:57 UTC
typo: missing "die" after "fi"
Comment 3 Tyler Berry 2005-04-11 16:47:48 UTC
That will miss certain cases actually. From my system:

% gcc-config -l
[1] i686-pc-linux-gnu-3.3.4
[2] i686-pc-linux-gnu-3.4.3-20050110 *
[3] i686-pc-linux-gnu-3.4.3-20050110-hardenednopie
[4] i686-pc-linux-gnu-3.4.3-20050110-hardenednossp
[5] i686-pc-linux-gnu-3.4.3-20050110-vanilla

The -vanilla is the only one that will work with SBCL (and for that matter,
CMUCL too). But AFAIK that option will only exist if the gcc was compiled
with hardened in the first place.

Maybe something like:

use hardened &&
  if `gcc-config -c | grep -q vanilla` ; then
    ...
  fi

Which assumes that hardened wasn't altered between the compilation
of gcc and SBCL, but really I don't see a way around that assumption.
Comment 4 Tyler Berry 2005-05-23 11:00:43 UTC
Looking for an update; the ebuild currently in portage has the version you
suggested, which misdiagnoses the gcc status.
Comment 5 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-27 11:06:48 UTC
Is this logic correct...

  use hardened &&
    if `gcc-config -c | grep -q vanilla` ; then
      ...
    fi

"If the user has "hardened" in thier USE flag set, and their corrently selected 
gcc-config profile has "vanilla" in it, then show the error message and die".
I'm a bit confused because in Comment #3 you mentioned that -vanilla is the only
profile which works with SBCL and CMUCL. Did you mean:

  use hardened && 
    if `gcc-config -c | grep -qv vanilla`; then
      ...
    fi

Which is true for when hardened is in USE *and* their gcc-config profile
*doesn't* contain "vanilla" in it.
Comment 6 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-29 21:42:35 UTC
*** Bug 64452 has been marked as a duplicate of this bug. ***
Comment 7 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-30 01:34:49 UTC
I added the above check to the ebuild for sbcl-0.9.1. Please check my
logic. I'll resolve this bug for now with a test request.
Comment 8 Tyler Berry 2005-05-30 17:11:01 UTC
Sorry for the delay, RL reared its ugly head this weekend.

Either of those two formulations should work, just as long as you're sensitive to which
case is 'OK' and which one is 'Evil', and do the right thing inside the conditional as
appropriate.

The way you have it in the ebuild right now seems to behave correctly for me.
Comment 9 Matthew Kennedy (RETIRED) gentoo-dev 2005-05-31 09:55:21 UTC
Thanks. I will resolve this bug as verified then.