make-3.81.91 & procps-3.2.8

View: New views
3 Messages — Rating Filter:   Alert me  

make-3.81.91 & procps-3.2.8

by Matt Burgess :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

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'.

Thanks,

Matt.


_______________________________________________
Bug-make mailing list
Bug-make@...
http://lists.gnu.org/mailman/listinfo/bug-make

Re: make-3.81.91 & procps-3.2.8

by Paul Smith-20 :: Rate this Message:

| View Threaded | Show Only this Message

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!


_______________________________________________
Bug-make mailing list
Bug-make@...
http://lists.gnu.org/mailman/listinfo/bug-make

Re: make-3.81.91 & procps-3.2.8

by Matt Burgess :: Rate this Message:

| View Threaded | Show Only this Message

On Tue, 27 Jul 2010 18:00:14 -0400, Paul Smith <psmith@...> wrote:
> 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.

> 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).

Paul,

Many thanks for your incredibly quick and informative response.  Sure enough,
changing that -include line to the following allows procps to be built
with make-3.81.91 successfully:

-include proc/module.mk ps/module.mk

These are the only 2 module.mk files in the source tarball so it seems
like the most appropriate fix.  I'll report this to procps upstream.

Thanks again,

Matt.


_______________________________________________
Bug-make mailing list
Bug-make@...
http://lists.gnu.org/mailman/listinfo/bug-make