Bug 10403 - [PATCH] configure --cflags breaks when CFLAGS contain commas
Summary: [PATCH] configure --cflags breaks when CFLAGS contain commas
Status: RESOLVED FIXED
Alias: None
Product: Pseudo
Classification: Yocto Project Subprojects
Component: pseudo (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.3
Assignee: Mark Hatle
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-10-09 22:06 UTC by dominik
Modified: 2016-10-13 16:14 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
configure: support using comma (,) in flags passed to --cflags (506 bytes, patch)
2016-10-09 22:06 UTC, dominik
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dominik 2016-10-09 22:06:00 UTC
Created attachment 3464 [details]
configure: support using comma (,) in flags passed to --cflags

Preconditions/Environment
-------------------------
pseudo-1.8.1 on Fedora rawhide

Triggering Action/Cause
-----------------------
./configure --bits=64 --cflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --enable-memory-db --enable-xattr --enable-xattrdb --libdir=/usr/lib64/pseudo --prefix=/usr --without-rpath

Expectation
-----------
No errors.

Actual Result
-------------
SQLite header for version 3014002 found in /usr.
sed: -e expression #1, char 239: unknown option to `s'

Reproducibility
---------------
100%

That's because the sed expression at configure:321 uses commas as sed expression separator. The solution is to use another separator that doesn't occur in CFLAGS, like !, which is what is done for RPATH already. Proposed patch attached.
Comment 1 Joshua Lock 2016-10-13 14:48:57 UTC
Adding Seebs to CC.

Peter, Mark — do we prefer pseudo patches to the mailing list?
Comment 2 Seebs 2016-10-13 14:50:35 UTC
In general, yeah, but this one's probably fine. Of course the real problem is that ! can also occur in cflags. LOTS of things can occur in cflags. I think the workaround I usually use is to first run cflags through s/,/\\,/ or something. I'll poke it a bit.
Comment 3 Seebs 2016-10-13 16:06:48 UTC
Added fix in upstream. One-line configure change:

+arch_flags=$(echo "$arch_flags" | sed -e 's/,/\\,/g')
Comment 4 Seebs 2016-10-13 16:14:12 UTC
Fixed in upstream. Doesn't seem to affect yocto. (Fix is only in master, but it'll be included in next bugfix/point release.)