applied proposed patch at gentoo bugzilla #460858