qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Build failure with make-4.0
@ 2013-10-18 22:48 Ken Moffat
  2013-10-18 23:36 ` Ken Moffat
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Moffat @ 2013-10-18 22:48 UTC (permalink / raw)
  To: qemu-devel

Hi,

 I'm working through the packages in Beyond Linux From Scratch in
the expectation that make-4.0 would break something.  Got about
halfway through and started to doubt that.  Then I tried qemu.

 Initially 1.6.0, which failed, so tried 1.6.1 and that fails the
same way.  Found some comments in the June and July archives about
ARFLAGS being empty, and particularly a comment from Peter Maydell
(http://lists.gnu.org/archive/html/qemu-devel/2013-06/msg02952.html)

|However, it's not the cause of the problem:
|
|> ar  libfdt/libfdt.a libfdt/fdt.o libfdt/fdt_ro.o libfdt/fdt_wip.o
|> libfdt/fdt_sw.o libfdt/fdt_rw.o libfdt/fdt_strerror.o
|> ar: two different operation options specified
|
|...which is that the top level makefile is passing ARFLAGS=""
|and so we don't specify any operation to ar at all. For me
|the submake is invoked with ARFLAGS ="rv" (which is Make's
|default for when ARFLAGS wasn't specified).
|
|QEMU's configure and makefile don't fiddle with ARFLAGS at all:
|are you passing some odd values in from your environment?

 So I tried make-3.82 and 1.6.0 built.  Here is the output from
1.6.1 mith "V=1", configured with--prefix=/usr --sysconfdir=/etc
--target-list=x86_64-softmmu (sorry about the reformatting when I
paste) :

make -I/scratch/ken/qemu-1.6.1/dtc VPATH=/scratch/ken/qemu-1.6.1/dtc
-C dtc V="1" LIBFDT_srcdir=/scratch/ken/qemu-1.6.1/dtc/libfdt
CPPFLAGS="-I/scratch/ken/qemu-1.6.1/dtc
-I/scratch/ken/qemu-1.6.1/dtc -I/scratch/ken/qemu-1.6.1/dtc/libfdt"
CFLAGS="-O2 -D_FORTIFY_SOURCE=2 -g  -fPIE -DPIE -m64 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing  -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -fstack-protector-all
-I/usr/include/libpng16  -I/usr/include/nss -I/usr/include/nspr
-pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/pixman-1  -I/scratch/ken/qemu-1.6.1/dtc/libfdt
-pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/scratch/ken/qemu-1.6.1/tests" LDFLAGS="-Wl,--warn-common
-Wl,-z,relro -Wl,-z,now -pie -m64 -g " ARFLAGS="" CC="cc" AR="ar"
LD="ld"  BUILD_DIR=/scratch/ken/qemu-1.6.1 libfdt/libfdt.a
make[1]: Entering directory '/scratch/ken/qemu-1.6.1/dtc'

 from which I see that ARFLAGS are empty

 and at the place where it fails

cc -I/scratch/ken/qemu-1.6.1/dtc -I/scratch/ken/qemu-1.6.1/dtc
-I/scratch/ken/qemu-1.6.1/dtc/libfdt -O2 -D_FORTIFY_SOURCE=2 -g
-fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall
-Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing
-Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits
-fstack-protector-all    -I/usr/include/libpng16  -I/usr/include/nss
-I/usr/include/nspr  -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include  -I/usr/include/pixman-1
-I/scratch/ken/qemu-1.6.1/dtc/libfdt -pthread
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/scratch/ken/qemu-1.6.1/tests -o libfdt/fdt_strerror.o -c
libfdt/fdt_strerror.c
ar  libfdt/libfdt.a libfdt/fdt.o libfdt/fdt_ro.o libfdt/fdt_wip.o
libfdt/fdt_sw.o libfdt/fdt_rw.o libfdt/fdt_strerror.o
ar: two different operation options specified
Makefile:234: recipe for target 'libfdt/libfdt.a' failed
make[1]: *** [libfdt/libfdt.a] Error 1
make[1]: Leaving directory '/scratch/ken/qemu-1.6.1/dtc'
Makefile:153: recipe for target 'subdir-dtc' failed
make: *** [subdir-dtc] Error 2

 Any suggestions for how to fix this, please ?

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Build failure with make-4.0
  2013-10-18 22:48 [Qemu-devel] Build failure with make-4.0 Ken Moffat
@ 2013-10-18 23:36 ` Ken Moffat
  2013-10-19  9:05   ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Moffat @ 2013-10-18 23:36 UTC (permalink / raw)
  To: qemu-devel

On Fri, Oct 18, 2013 at 11:48:12PM +0100, Ken Moffat wrote:

> ar  libfdt/libfdt.a libfdt/fdt.o libfdt/fdt_ro.o libfdt/fdt_wip.o
> libfdt/fdt_sw.o libfdt/fdt_rw.o libfdt/fdt_strerror.o
> ar: two different operation options specified
> Makefile:234: recipe for target 'libfdt/libfdt.a' failed
> make[1]: *** [libfdt/libfdt.a] Error 1
> make[1]: Leaving directory '/scratch/ken/qemu-1.6.1/dtc'
> Makefile:153: recipe for target 'subdir-dtc' failed
> make: *** [subdir-dtc] Error 2
> 
>  Any suggestions for how to fix this, please ?
> 
 Seems I can just
$export ARFLAGS="rv"
before I configure, and it will build and install.  Unless there is
some reason NOT to do that, please consider this closed.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Build failure with make-4.0
  2013-10-18 23:36 ` Ken Moffat
@ 2013-10-19  9:05   ` Peter Maydell
  2013-10-19  9:53     ` Ken Moffat
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2013-10-19  9:05 UTC (permalink / raw)
  To: Ken Moffat; +Cc: QEMU Developers

On 19 October 2013 00:36, Ken Moffat <zarniwhoop@ntlworld.com> wrote:
>  Seems I can just
> $export ARFLAGS="rv"
> before I configure, and it will build and install.  Unless there is
> some reason NOT to do that, please consider this closed.

Well, the reason would be that nobody in practice will do
that. Make should be setting ARFLAGS correctly (as per
its documentation) unless you've somehow managed to
set ARFLAGS to something incorrect in your environment.
If you "unset ARFLAGS" does it work?

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Build failure with make-4.0
  2013-10-19  9:05   ` Peter Maydell
@ 2013-10-19  9:53     ` Ken Moffat
  2013-10-21 18:22       ` Ken Moffat
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Moffat @ 2013-10-19  9:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On Sat, Oct 19, 2013 at 10:05:10AM +0100, Peter Maydell wrote:
> On 19 October 2013 00:36, Ken Moffat <zarniwhoop@ntlworld.com> wrote:
> >  Seems I can just
> > $export ARFLAGS="rv"
> > before I configure, and it will build and install.  Unless there is
> > some reason NOT to do that, please consider this closed.
> 
> Well, the reason would be that nobody in practice will do
> that. Make should be setting ARFLAGS correctly (as per
> its documentation) unless you've somehow managed to
> set ARFLAGS to something incorrect in your environment.
> If you "unset ARFLAGS" does it work?
> 
> -- PMM
 I don't normally touch ARFLAGS.  Here's a freshly-untarred qemu
tree.

ken@ac4tv /scratch/ken/tmp/qemu-1.6.1 $echo $ARFLAGS

ken@ac4tv /scratch/ken/tmp/qemu-1.6.1 $unset ARFLAGS

./configure --prefix=/usr --sysconfdir=/etc --target-list=x86_64-softmmu
make

	 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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Build failure with make-4.0
  2013-10-19  9:53     ` Ken Moffat
@ 2013-10-21 18:22       ` Ken Moffat
  2013-10-21 19:37         ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Moffat @ 2013-10-21 18:22 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On Sat, Oct 19, 2013 at 10:53:43AM +0100, Ken Moffat wrote:
> On Sat, Oct 19, 2013 at 10:05:10AM +0100, Peter Maydell wrote:
> > 
> > Well, the reason would be that nobody in practice will do
> > that. Make should be setting ARFLAGS correctly (as per
> > its documentation) unless you've somehow managed to
> > set ARFLAGS to something incorrect in your environment.
> > If you "unset ARFLAGS" does it work?
> > 
> > -- PMM
>  I don't normally touch ARFLAGS.  Here's a freshly-untarred qemu
> tree.
> 
> ken@ac4tv /scratch/ken/tmp/qemu-1.6.1 $echo $ARFLAGS
> 
> ken@ac4tv /scratch/ken/tmp/qemu-1.6.1 $unset ARFLAGS
> 
> ./configure --prefix=/usr --sysconfdir=/etc --target-list=x86_64-softmmu
> make
> 
> 	 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
> 
 I took this to bug-make, but now I'm back here.  The first thing in
rules.mak is

# Don't use implicit rules or variables
# we have explicit rules for everything
MAKEFLAGS += -rR

 and Paul Smith said -

It's a qemu bug, that just happened to work with make-3.82.  By adding
the -R flag they are stating they don't want to use ANY default variable
values.  However they are relying on the default variable value for
ARFLAGS to be set.  If they want to use -R they should set ARFLAGS to an
acceptable value in their makefile.

In previous versions of GNU make adding those flags wouldn't take effect
in the current instance of make; it would only be in effect in a
sub-make; that bug/mis-feature was fixed in GNU make 4.0.  Now adding
those flags in a makefile takes effect immediately, within that same
instance of make.  From the NEWS for GNU make 4.0:

* Setting the -r and -R options in MAKEFLAGS inside a makefile now works as
  expected, removing all built-in rules and variables, respectively.

 Thread starts at
http://lists.gnu.org/archive/html/bug-make/2013-10/msg00151.html

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Build failure with make-4.0
  2013-10-21 18:22       ` Ken Moffat
@ 2013-10-21 19:37         ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2013-10-21 19:37 UTC (permalink / raw)
  To: Ken Moffat; +Cc: QEMU Developers

On 21 October 2013 19:22, Ken Moffat <zarniwhoop@ntlworld.com> wrote:
>  I took this to bug-make, but now I'm back here.  The first thing in
> rules.mak is
>
> # Don't use implicit rules or variables
> # we have explicit rules for everything
> MAKEFLAGS += -rR
>
>  and Paul Smith said -
>
> It's a qemu bug, that just happened to work with make-3.82.  By adding
> the -R flag they are stating they don't want to use ANY default variable
> values.  However they are relying on the default variable value for
> ARFLAGS to be set.  If they want to use -R they should set ARFLAGS to an
> acceptable value in their makefile.

Thanks very much for taking the time to follow this up with the
make mailing list (and if you happen to post to that list again
you could pass on my thanks to Paul for looking into this as well).
I guess we should treat ARFLAGS the same way we do LDFLAGS
and friends -- capture the setting in configure (with a default of
"rv" if unset) and write it to config-host.mak. Then we'll be setting
it explicitly for our top level make which can pass it down correctly
to the dtc makefile.

I'll put together a patch...

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-21 19:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 22:48 [Qemu-devel] Build failure with make-4.0 Ken Moffat
2013-10-18 23:36 ` Ken Moffat
2013-10-19  9:05   ` Peter Maydell
2013-10-19  9:53     ` Ken Moffat
2013-10-21 18:22       ` Ken Moffat
2013-10-21 19:37         ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).