Project

General

Profile

This project is closed and read-only.

Actions

Backport #6504

closed

mkmf.rb should not use CFLAGS when compiling C++ code

Backport #6504: mkmf.rb should not use CFLAGS when compiling C++ code

Added by hansdegraaff (Hans de Graaff) over 14 years ago. Updated over 13 years ago.


Description

mkmf.rb currently sets CXXFLAGS to include CFLAGS. It should not do this because CFLAGS are meant for C compilation only and may contain flags that cause problems with C++. If there are flags that are common to both C and C++ (such as the -I flags in the downstream bug) then these should be collected in a separate variable.

https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1786

CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}

For reference our downstream bug report that triggered this: https://bugs.gentoo.org/show_bug.cgi?id=396281


Related issues 1 (0 open1 closed)

Related to Ruby - Bug #8315: mkmf does not include include paths from pkg_config anymoreClosednobu (Nobuyoshi Nakada)Actions

Updated by mame (Yusuke Endoh) over 14 years ago Actions #1 [ruby-core:45274]

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

Updated by nobu (Nobuyoshi Nakada) over 14 years ago Actions #2 [ruby-core:45287]

  • Status changed from Assigned to Feedback

hansdegraaff (Hans de Graaff) wrote:

For reference our downstream bug report that triggered this: https://bugs.gentoo.org/show_bug.cgi?id=396281

I can't see that page because of "untrusted issuer error".

Updated by drbrain (Eric Hodel) over 13 years ago Actions #3 [ruby-core:51689]

  • Subject changed from mkrf.rb should not use CFLAGS when compiling C++ code to mkmf.rb should not use CFLAGS when compiling C++ code
  • Status changed from Feedback to Rejected

Since the submitter has not given access to the downstream bug report as requested I am rejecting this.

Updated by postmodern (Hal Brodigan) over 13 years ago Actions #4 [ruby-core:53814]

Visiting https://bugs.gentoo.org/ gives me "Error code: sec_error_untrusted_issuer)" with Firefox 19 on Fedora 17. I can however add an exception and temporarily trust the certificate in order to view the bug report.

Updated by Flameeyes (Diego Elio Pettenò) over 13 years ago Actions #5 [ruby-core:53816]

It's not like the bug at Gentoo adds much more. It just happens to be somebody who has different CFLAGS/CXXFLAGS (like many do, for instance it's common to use -ggdb3 on C code, but not enabling it on C++ code because it requires at least an order of magnitude more ram), and gets fxruby built with the wrong set.

How much more info than this (which was provided in the original report, including the reference to the line where the mix-up is happening) do you expect? An essay on why you should not mix flags for one language with those for another? A dissertation on why any half-serious build system, including both Autotools and CMake, keep the two separate?

Updated by drbrain (Eric Hodel) over 13 years ago Actions #6 [ruby-core:53817]

  • Status changed from Rejected to Assigned

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #7

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

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


mkmf.rb: no CFLAGS in CXXFLAGS

  • lib/mkmf.rb (configuration): not include all CFLAGS in CXXFLAGS, to
    use different set than C for C++. [ruby-core:45273] [Bug #6504]

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #8

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 15
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago Actions #9

  • Status changed from Assigned to Closed

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


merge revision(s) 39994: [Backport #6504]

* lib/mkmf.rb (configuration): not include all CFLAGS in CXXFLAGS, to
  use different set than C for C++.  [ruby-core:45273] [Bug #6504]

Updated by nagachika (Tomoyuki Chikanaga) about 12 years ago Actions #10 [ruby-core:65045]

  • Related to Bug #8315: mkmf does not include include paths from pkg_config anymore added
Actions

Also available in: PDF Atom