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

Updated by jberry (James Berry) about 12 years ago

Correction to my statement:

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_FLAG)" (note the missing space). When ARCH_FLAG is later expanded it will be missing the space, which results in an improper effective CFLAGS of "-DFOO-arch x86_64" (missing a space after -DFOO).

Updated by naruse (Yui NARUSE) about 12 years ago

r33934 already fixed it.

Actions #4

Updated by naruse (Yui NARUSE) about 12 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (build)
  • Target version deleted (1.9.3)
Actions #5

Updated by naruse (Yui NARUSE) about 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34474.
James, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 33934: [Backport #5975]

* Makefile.in (CFLAGS): append ARCH_FLAG.

* configure.in (ARCH_FLAG): exclude from CFLAGS.
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0