bugmake - Bugs: bug #12260, 3.81beta3: new regressions...


bug #12260: 3.81beta3: new regressions reported by automake test suite

Submitted by:  Dmitry V. Levin <ldv>
Submitted on:  Wed 09 Mar 2005 04:01:53 PM UTC  
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.0 Operating System:  POSIX-Based
Fixed Release:  3.81 Triage Status:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Tue 01 Nov 2005 07:04:39 PM UTC, comment #10: 

I'm fixing this now.  Half of the fix has already been committed (for explicit and static pattern rules).  The other half (for implicit rules) will be committed "soon".

The fix is that the default behavior does not double-expand anymore.  If you want double-expansion you have to specify a special target .SECONDEXPANSION.

This will be present in the next beta of GNU make.  If you want to test it today (for non-implicit rules) you can build the CVS version.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 01 Nov 2005 06:37:45 PM UTC, comment #9: 

Argh, ignore that last comment, I'm indeed missing something obvious ;) patching Makefile.in and still thinking automake should get things right is not exactly right.

Note to self: Don't post bug reports after 48 hours of uninterrupted coding ;)

Bernhard Rosenkraenzer <bero>
Tue 01 Nov 2005 06:22:30 PM UTC, comment #8: 

Getting gcc/libjava to build with make 3.81b3 is, at least on my box (make 3.81b3, automake 1.9.6) trying to compile GCC SVN trunk), far more complicated than indicated here.

After doing


--- gcc/libjava/Makefile.in.make~       2005-10-31 21:27:03.000000000 +0100
+++ gcc/libjava/Makefile.in     2005-11-01 12:31:20.000000000 +0100
@@ -4738,7 +4738,7 @@
 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \

-inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
+inner_nat_headers := java/io/ObjectOutputStream$$PutField.h \
        java/io/ObjectInputStream$$GetField.h \
        java/nio/DirectByteBufferImpl$$ReadWrite.h \
        java/nio/channels/Pipe$$SinkChannel.h \
@@ -4751,6 +4751,18 @@
        gnu/java/nio/PipeImpl$$SourceChannelImpl.h \

+ifneq (,$(filter second-expansion,$(.FEATURES)))
+define escape-dollar-sign
+$(subst $$,$$$$,$1)
+define escape-dollar-sign
+inner_nat_headers := $(call escape-dollar-sign,$(inner_nat_headers))
 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \


make actually works, but make install barfs, saying

make[1]: Entering directory `/usr/src/ark/BUILD/gcc/build/i586-ark-linux/libjava'
make[1]: *** No rule to make target `java/nio/DirectByteBufferImpleadWrite.h', needed by `jni.lo'.  Stop.
make[1]: Leaving directory `/usr/src/ark/BUILD/gcc/build/i586-ark-linux/libjava'
make: *** [install-recursive] Error 1

The problem here is that the autogenerated dependency file (.deps/jni.Plo) has autogenerated references to DirectByteBufferImpl$$ReadWrite.h (which should be DirectByteBufferImpl$$$$ReadWrite.h

Am I missing something, or will fixing this need quite a few hacks in the dependency generator?

Bernhard Rosenkraenzer <bero>
Thu 07 Apr 2005 09:27:39 PM UTC, comment #7: 

I've added a new special variable, .FEATURES, to GNU make.  You can check it's contents for the word "second-expansion" to see if the extra $ quoting is required:

  ifneq (,$(filter second-expansion,$(.FEATURES)))
    # Supports secondary expansion

In a future version of GNU make we will work out a more comprehensive quoting mechanism that can be used to avoid these issues more straightforwardly (I hope).

This doesn't technically fix the regression, unfortunately :-/.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 11 Mar 2005 03:24:37 PM UTC, comment #6: 

I don't like the idea of binding to GNU make version, especially due to the fact that 3.81beta1 is widely used.

Similar but more convinient approach is to add necessary information to "make -v" output.
For example, GNU find does it this way:
$ find --version
GNU find version 4.2.19
Features enabled: D_TYPE O_NOFOLLOW(enabled)

Another way is to introduce something that could be ifdef'ed, instead of writing custom has_second_expansion functions here and there.

The method that requires less modifications is better.

Dmitry V. Levin <ldv>
Fri 11 Mar 2005 02:41:32 PM UTC, comment #5: 

I checked libjava's Makefile.am. It boils down to the following lines:

inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
java/io/ObjectInputStream$$GetField.h \
java/lang/reflect/Proxy$$ProxyData.h \
java/lang/reflect/Proxy$$ProxyType.h \
gnu/java/net/PlainSocketImpl$$SocketInputStream.h \

It is easy to fix just for 3.81 but the solution that works for both 3.80 and 3.81 is somewhat involved. Here is an example makefile that shows the technique:

make_version := $(shell $(MAKE) -v | sed -e 's/GNU Make \([0-9]\+\.[0-9]\+\).*/\1/;q')
make_version_major := $(shell echo $(make_version) | sed -e 's/\([0-9]\+\)\..*/\1/')
make_version_minor := $(shell echo $(make_version) | sed -e 's/.*\.\([0-9]\+\)/\1/')

has_second_expansion := $(shell test $(make_version_major) -gt 3 -o \
  $(make_version_major) -eq 3 -a $(make_version_minor) -gt 80 && echo 1)

ifdef has_second_expansion
define escape-dollar-sign
$(subst $$,$$$$,$1)
define escape-dollar-sign

foo_target := foo$$bar
foo_prereq := $(call escape-dollar-sign,$(foo_target))

.PHONY: all $(foo_prereq)

all: $(foo_prereq)
        @echo '$<'

        @echo '$@'

Note the two variables, foo_target and foo_prereq, that are used respectively to for defining foo as a target (one expansion) and for using it as a prerequisite (two expansions).

In case of libjava, the

In libjava's case, the inner_nat_headers variable is used only to define prerequisites so its content can simply be run through escape-dollar-sign, e.g.,

inner_nat_headers := java/io/ObjectOutputStream$$PutField.h \
java/io/ObjectInputStream$$GetField.h \
java/lang/reflect/Proxy$$ProxyData.h \
java/lang/reflect/Proxy$$ProxyType.h \
gnu/java/net/PlainSocketImpl$$SocketInputStream.h \

inner_nat_headers := $(call escape-dollar-sign,$(inner_nat_headers))

Note the use of `:=' instead of `='.

Fri 11 Mar 2005 11:45:51 AM UTC, comment #4: 

libjava from gcc-3.4.x also doesn't build with current make, due to dollars in filenames.

Dmitry V. Levin <ldv>
Thu 10 Mar 2005 12:57:28 PM UTC, comment #3: 

Since this test requires GNU make anyway, it can be done with simply-expanded variables.  Instead of "foo = foo$$bar", the makefile needs to contain "foo := foo$$bar".  This will work with both the old and new versions of GNU make.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Thu 10 Mar 2005 11:13:49 AM UTC, comment #2: 

I wonder how automake can deal with this recently introduced incompatibility?
Is there any way for automake to generate such makefile for dollar.test so it will work both for old and new versions of GNU make?

Dmitry V. Levin <ldv>
Thu 10 Mar 2005 09:28:15 AM UTC, comment #1: 

The first regression (dollar.test) is due to the know backwards-incompatibility (documented in the NEWS file).

The second and the third regressions (yacc4.test and yacc6.test) are due to the same bug that I re-entered with a minimal example as bug #12267. This bug has been fixed.

Boris Kolpackov <bosk>
Project Member
Wed 09 Mar 2005 04:01:53 PM UTC, original submission:  

Both automake-1.8.5 and automake-1.9.5 report 3 new regressions in make-3.81beta3 compared to make-3.81beta1.

Dmitry V. Levin <ldv>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #2703:  Makefile.am added by ldv (3KiB - part of gcc/libjava/Makefile.am)
file #2700:  automake.log added by ldv (7KiB - part of automake-1.9.5 regression test log)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




Follow 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 => 3.81
2005-04-07 psmith StatusNone => Fixed
    Assigned toNone => psmith
    Open/ClosedOpen => Closed
    Fixed ReleaseNone => 4.0
2005-03-11 ldv Attached File- => Added Makefile.am, #2296
2005-03-10 bosk Carbon-Copy- => Added bosk
2005-03-09 ldv Attached File- => Added automake.log, #2293

Back to the top

Powered by Savane 3.5