Project

General

Profile

Actions

Backport #5975

closed

Handling of ARCH_FLAG in configure can lead to mangled flags

Added by jberry (James Berry) about 12 years ago. Updated about 12 years ago.

Status:
Closed
Assignee:
-
[ruby-core:42381]

Description

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).


Files

patch-configure.in.diff (727 Bytes) patch-configure.in.diff Patch to configure.in jberry (James Berry), 02/07/2012 08:35 AM
patch-configure.diff (758 Bytes) patch-configure.diff Patch to configure (for reference) jberry (James Berry), 02/07/2012 08:35 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0