bug-make
[Top][All Lists]
Advanced

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

Re: make-4.0 allows empty ARFLAGS to be passed to ar


From: Ken Moffat
Subject: Re: make-4.0 allows empty ARFLAGS to be passed to ar
Date: Mon, 21 Oct 2013 16:02:21 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 21, 2013 at 12:02:20AM -0400, Paul Smith wrote:
> On Mon, 2013-10-21 at 04:05 +0100, Ken Moffat wrote:
> >  With GNU Make 4.0 on x86_64-unknown-linux-gnu I am unable to build
> > qemu 1.6.{0,1} because it fails with
> >          AR libfdt/libfdt.a
> > ar: two different operation options specified
> > Makefile:234: recipe for target 'libfdt/libfdt.a' failed
> > 
> >  If I try to build it with make V=1 the output shows it has
> > ARFLAGS=""
> > 
> >  It builds if I export ARFLAGS="rv".  If I have understood
> > the reply on the qemu-devel list correctly, qemu deliberately passes
> > empty ARFLAGS and relies on the following in 'info make' :
> > `ARFLAGS'
> >      Flags to give the archive-maintaining program; default `rv'.
> 
> There must be something else going on in your makefile.  The built-in
> value for ARFLAGS is still present; you can see it set:
> 
>   $ make -p -f /dev/null | grep ARFLAGS
>   make: *** No targets.  Stop.
>   ARFLAGS = rv
>           $(AR) $(ARFLAGS) $@ $<
> 
> Something in your makefile is overriding this value.
> 
> Perhaps you are setting MAKEFLAGS to add the -R flag (which disables
> built-in variables)?  Or, you're overriding it somehow.
> 
> If you run:
> 
>   $ make -p -n
> 
> and search the output for ARFLAGS, the comment before should tell you
> where that variable is being assigned.

 OK, I configured with
 ./configure --prefix=/usr                \
            --sysconfdir=/etc            \
            --target-list=x86_64-softmmu

 and ran that.

# command line
ARFLAGS = 

 I then ran it in the directory where the build fails (dtc/) -

# makefile (from 'Makefile', line 51)
ARFLAGS = rc

 I then went back to the top level and ran make:
address@hidden /scratch/ken/makedebugging/qemu-1.6.1 $make
        CHK version_gen.h
         AR libfdt/libfdt.a
ar: two different operation options specified
Makefile:234: recipe for target 'libfdt/libfdt.a' failed
make[1]: *** [libfdt/libfdt.a] Error 1
Makefile:153: recipe for target 'subdir-dtc' failed
make: *** [subdir-dtc] Error 2
address@hidden /scratch/ken/makedebugging/qemu-1.6.1 $

 Then I put make-3.82 (in /usr/local) at the front of the path with
a fresh tree in a different directory.

 The top level result is different :
# command line
ARFLAGS = rv

 Also ran it in dtc/ but there 'ARFLAGS = rc' was again the result.
With 3.82 it builds.

 So, back to the 4.0 build.  The Makefile has the following
references to MAKEFLAGS :

SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)

subdir-%:
        $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" 
TARGET_DIR="$*/" all,)

subdir-pixman: pixman/Makefile
        $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" 
all,)

subdir-dtc:dtc/libfdt dtc/tests
        $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) 
CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" 
ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) 
libfdt/libfdt.a,)

romsubdir-%:
        $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" 
TARGET_DIR="$*/",)

 It's the long one (subdir-dtc) where the problem exists.
The DTC values are :

DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" 
LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt

DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)

DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt

 Any idea whose bug it is, please ?

ĸen
-- 
das eine Mal als Tragödie, dieses Mal als Farce



reply via email to

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