ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: v.ondruch@tiscali.cz
To: ruby-core@ruby-lang.org
Subject: [ruby-core:77698] [Ruby trunk Bug#11863] configure/makefile needs to follow the standard behavior
Date: Fri, 21 Oct 2016 12:47:05 +0000	[thread overview]
Message-ID: <redmine.journal-60980.20161021124705.ac7e39fce0e5b15d@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11863.20151222212548@ruby-lang.org

Issue #11863 has been updated by Vit Ondruch.


Ping? What this the state. Now I noticed that the LDFLAGS are not used during build of Fedora package, so Ruby is not properly hardened as it should be. That is unexpected :/

----------------------------------------
Bug #11863: configure/makefile needs to follow the standard behavior
https://bugs.ruby-lang.org/issues/11863#change-60980

* Author: Luiz Angelo Daros de Luca
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [i486-linux-gnu]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Hello,

I'm the current OpenWRT maintainer of ruby packages.
However, configure/makefile for ruby has some exotic usages.

LDFLAGS is used only for execs
DLDFLAGS for libraries
XLDFLAGS for extra options for both.

Normally, it is expected that LDFLAGS applies to all linked code.
If ruby needs something special for each case, I guess the extra
?LDFLAGS should append to what LDFLAGS defines (and in Makefile).

DLDFLAGS is a special confusion. It is an accepted configure VAR.
However, that really defines DLDFLAGS in Makefile is not DLDFLAGS but LIBRUBY_DLDFLAGS.
At first, LIBRUBY_DLDFLAGS uses DLDFLAGS to define its initial value. However, for some targets,
it is simply overwritten (i.e.: for linux).

XLDFLAGS also has this problem of not respecting what was defined. However, reading the code, this happens only for AIX. I wasn't hit by this bug.

I noticed in some places that some configure vars include other vars as value. Ex:

darwin*) :
...
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'

Normally all vars should include only new arguments. The job of merging VAR values should
be done in Makefile. This happens for most of vars, but not for some cases like LIBRUBY_DLDFLAGS.
Specially for this example, LIBRUBY_DLDFLAGS is only used to define DLDFLAGS in Makefile and it
DOES already include XLDFLAGS there. Appending var values with another var both in configure and makefile
makes the build debugging a lot harder, specially if it changes the var names.

What would be expected by configure/makefile:
1) standard vars like CFLAGS, LDFLAGS, etc should be respected for all compiled/linked code.
2) all accepted env var defined for configure should not be replaced internally by ./configure but only appended.
3) var XYZ defined in configure should be the one that defines var XYZ in Makefile. Extra opts not appended should come from an extra var.
4) var XYZ should not include the value of another var ABC in configure. Do it in Makefile.



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

  parent reply	other threads:[~2016-10-21 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11863.20151222212548@ruby-lang.org>
2015-12-22 21:25 ` [ruby-core:72444] [Ruby trunk - Bug #11863] [Open] configure/makefile needs to follow the standard behavior luizluca
2016-10-21 12:47 ` v.ondruch [this message]
2016-10-21 12:47 ` [ruby-core:77699] [Ruby trunk Bug#11863] " v.ondruch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-60980.20161021124705.ac7e39fce0e5b15d@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).