bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make-3.81.91 & procps-3.2.8


From: Paul Smith
Subject: Re: make-3.81.91 & procps-3.2.8
Date: Tue, 27 Jul 2010 18:00:14 -0400

On Tue, 2010-07-27 at 15:39 -0600, Matthew Burgess wrote:
> I'm trying to compile procps-3.2.8
> (http://procps.sourceforge.net/procps-3.2.8.tar.gz) with Make-3.81.91.
> 
> The last command invoked with Make-3.81 is:
> 
> cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align
> -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings
> -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s
> -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb
> -frename-registers -fomit-frame-pointer -fno-inline-functions
> -Wl,-warn-common  -o ps/ps ps/display.o ps/global.o ps/help.o
> ps/output.o ps/parser.o ps/select.o ps/sortformat.o
> proc/libproc-3.2.8.so
> 
> The last command invoked with Make-3.81.91 is:
> 
> cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align
> -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings
> -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s
> -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb
> -frename-registers -fomit-frame-pointer -fno-inline-functions
> -Wl,-warn-common  -o ps/ps ps/display.o ps/global.o ps/help.o
> ps/output.o ps/parser.o ps/select.o ps/sortformat.o
> 
> This obviously leads to linking errors as it doesn't pull in
> 'proc/libproc-3.2.8.so'. e.g.
> 
> ps/display.o: In function `show_proc_array':
> display.c:(.text+0x210): undefined reference to `readtask'
> 
> At the moment I suspect this is actually a buggy Makefile, but would
> appreciate it if you could confirm please.  My Makefile-fu is not
> sufficient to figure out why things have changed between the 2
> versions of `make'.

This is because you have an undocumented ordering in the makefile; the
top-level makefile says:

        -include */module.mk

However, some of these various module.mk files depend on each other, in
particular the ps/module.mk makefile uses LIBPROC, which is set in
proc/module.mk (there may be others, too, I didn't check closely).

In previous versions of GNU make, wildcards were returned in sorted
order; however that was never guaranteed and the new version of make
(for efficiency) returns matches in "directory order", which is
essentially random.  On your system, ps/module.mk is being included
first before proc/module.mk, so when ps/module.mk is parsed the LIBPROC
variable is empty.

If you want to impose some order on these you'll have to either (a) list
them explicitly in the top-level makefile, rather than using wildcards
(that's what I would do), or else use $(sort $(wildcard */module.mk)) to
get back the sorted list and just understand that you can only use
references to variables that appear in directories before this one after
sorting (yikes!  Here be magic!)

Or, you can raise the setting of that variable to the top-level
makefile.  Or something.

Cheers!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]