Issue #5975 has been updated by Yui NARUSE.


r33934 already fixed it.
----------------------------------------
Bug #5975: Handling of ARCH_FLAG in configure can lead to mangled flags
https://bugs.ruby-lang.org/issues/5975

Author: James Berry
Status: Open
Priority: Normal
Assignee: 
Category: build
Target version: 1.9.3
ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570)


In configure, ARCH_FLAG ends up with a leading space which, when replaced with "$(ARCH_FLAG)" in CFLAGS, CXXFLAGS, and LDFLAGS, can cause the new CFLAGS, etc, definition to be missing a crucial space.

Coming into the section of code shown in the patch files (configure.in line 2684) , ARCH_FLAG might contain " -arch x86_64", which becomes archflagpat also. The sed substitution "s|$archflagpat"'|$(ARCH_FLAG)|' , for a CFLAGS that originally held "-DFOO -arch x86_64", thus results in a new (and improper) CFLAGS that contains "-DFOO-arch x86_64" (note the missing space).

The attached patch shows one way to correct this problem. Another way to correct the issue would be to strip the extraneous space, or to prevent it from being added in the first place (configure.in line 188, I think).


-- 
http://bugs.ruby-lang.org/