Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 678870

Summary: dev-libs/openssl-1.1.1b.ebuild generates invalid CFLAGS
Product: Gentoo Linux Reporter: Slava Sterling <gentoo.org>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to fix sed regex to account for gcc flags that contain dashes

Description Slava Sterling 2019-02-26 22:02:21 UTC
Created attachment 566622 [details, diff]
Patch to fix sed regex to account for gcc flags that contain dashes

Existing ebuild code:

# Clean out hardcoded flags that openssl uses
# Fix quoting for sed
local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
    -e 's:^CFLAGS=::' \
    -e 's:-fomit-frame-pointer ::g' \
    -e 's:-O[0-9] ::g' \
    -e 's:-march=[-a-z0-9]* ::g' \
    -e 's:-mcpu=[-a-z0-9]* ::g' \
    -e 's:-m[a-z0-9]* ::g' \
    -e 's:\\:\\\\:g' \
)

Expression 's:-m[a-z0-9]* ::g' doesn't account for flags that themselves contain a dash, e.g. -mno-sha or -mno-clzero, so sed turns them into -mno-mno-sha and -mno-mno-clzero, correspondingly, which breaks compilation with gcc error "unrecognized command line option".

Suggested fix: 's:-m[a-z0-9-]* ::g'

Patch attached.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2019-02-27 02:16:37 UTC

*** This bug has been marked as a duplicate of bug 671016 ***