Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 553716 - flag-o-matic.eclass: strip-flags: whitelisting of -fsanitize flags does not work
Summary: flag-o-matic.eclass: strip-flags: whitelisting of -fsanitize flags does not work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-01 10:58 UTC by Hanno Böck
Modified: 2015-09-01 04:06 UTC (History)
1 user (show)

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


Attachments
patch to fix fsanitize-whitelisting in strip-flags (flag-o-matic-fix-fsanitize-whitelisting.diff,566 bytes, patch)
2015-07-01 10:58 UTC, Hanno Böck
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck gentoo-dev 2015-07-01 10:58:21 UTC
Created attachment 406028 [details, diff]
patch to fix fsanitize-whitelisting in strip-flags

The flag-o-matic.eclass whitelists -fsanitize flags for the strip-flags() function (see #530070). However it doesn't work.

This is the whitelisting:
	ALLOWED_FLAGS+=" -fstack-protector* -fsanitize=*"

The strip-flags function however will split flags at every = sign before doing the check:
                        local flag=${x%%=*}

Therefore the whitelisting doesn't work that way. The simplest way to fix it is to whitelist it without the =-char, change it to:
	ALLOWED_FLAGS+=" -fstack-protector* -fsanitize*"

Patch attached, please apply.
Comment 1 SpanKY gentoo-dev 2015-09-01 04:06:35 UTC
gcc also has flags like -fsanitize-recover and -fsanitize-undefined-trap-on-error, so using a glob enables those

http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49ab0182a2d872bade4c4ead9ef189a80b0925df