Bug #11863
closedconfigure/makefile needs to follow the standard behavior
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:
- standard vars like CFLAGS, LDFLAGS, etc should be respected for all compiled/linked code.
- all accepted env var defined for configure should not be replaced internally by ./configure but only appended.
- 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.
- var XYZ should not include the value of another var ABC in configure. Do it in Makefile.
Updated by vo.x (Vit Ondruch) almost 8 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 :/
Updated by vo.x (Vit Ondruch) almost 8 years ago
- Assignee set to nobu (Nobuyoshi Nakada)
Updated by vo.x (Vit Ondruch) almost 8 years ago
- Has duplicate Bug #10830: LDFLAGS not honoured when linking libruby.so added
Updated by nobu (Nobuyoshi Nakada) almost 8 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.