Project

General

Profile

Actions

Bug #11863

closed

configure/makefile needs to follow the standard behavior

Added by luizluca (Luiz Angelo Daros de Luca) over 8 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [i486-linux-gnu]
[ruby-core:72444]

Description

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.

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #10830: LDFLAGS not honoured when linking libruby.soClosed02/05/2015Actions
Actions #1

Updated by vo.x (Vit Ondruch) over 7 years ago

Ping? What is the status here?. 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 :/

Actions #2

Updated by vo.x (Vit Ondruch) over 7 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)
Actions #3

Updated by vo.x (Vit Ondruch) over 7 years ago

  • Has duplicate Bug #10830: LDFLAGS not honoured when linking libruby.so added
Actions #4

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Closed

Applied in changeset r56472.


configure.in: fallback DLDFLAGS to LDFLAGS

  • configure.in (DLDFLAGS): fallback to LDFLAGS.
    [ruby-core:72444] [Bug #11863]
  • configure.in (LIBRUBY_DLDFLAGS): fallback to DLDFLAGS.
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0