mkmf.rb: Incorrect have_devel? test depending on run order
have_devel? is usually lazily checked on the first call to try_do(). However, try_do() may be invoked within the scope of a with_ldflags or with_cflags block. If have_devel? is checked for the first time with altered test LDFLAGS or CFLAGS it may crash.
# extconf.rb $LDFLAGS = "-L/custom/path/to/lib try_ldflags "-Issl" # try_ldflags -> try_link -> try_do -> have_devel (with incorrect $LDFLAG in scope)
Updated by nobu (Nobuyoshi Nakada) over 5 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r49482.
mkmf.rb: avoid interference
- lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of interference by modifying global variables in have_devel? method. [ruby-core:67962] [Bug #10821]
Updated by usa (Usaku NAKAMURA) over 5 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE
ruby_2_0_0 r49735 merged revision(s) 49482,49487.
note: need to require
envutil because it's not loaded implicitly ruby 2.0.0.