Skip to contentSkip to conversation

configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0

PATCH In review Peter Maydell 5 participants 11 messages Oct 21, 2013 – Nov 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0

Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules. However we were accidentally relying on the default ARFLAGS ("rv"). This went unnoticed because of a bug in GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS only affected submakes, not the currently running instance. Explicitly set ARFLAGS in config-host.mak, in the same way we handle CFLAGS and LDFLAGS; this will allow us to work with Make 4.0.

Thanks to Paul Smith for analyzing this bug for us.

---
Ken: I think this should work (and it doesn't break building with old makes), but I don't have a make 4.0 to hand; if you could test it I'd appreciate it.

 configure | 5 +++++
 1 file changed, 5 insertions(+)
configure +5 -0
index 57ee62a..4eb3a07 100755
@@ -308,6 +308,9 @@ query_pkg_config() {
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 
+# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
+ARFLAGS="${ARFLAGS-rv}"
+
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
@@ -3664,6 +3667,7 @@ echo "C compiler        $cc"
 echo "Host C compiler   $host_cc"
 echo "C++ compiler      $cxx"
 echo "Objective-C compiler $objcc"
+echo "ARFLAGS           $ARFLAGS"
 echo "CFLAGS            $CFLAGS"
 echo "QEMU_CFLAGS       $QEMU_CFLAGS"
 echo "LDFLAGS           $LDFLAGS"
@@ -4239,6 +4243,7 @@ echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "CXX=$cxx" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "ARFLAGS=$ARFLAGS" >> $config_host_mak
 echo "AS=$as" >> $config_host_mak
 echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 3 lines · Peter Maydell

Ken: I think this should work (and it doesn't break building with old makes), but I don't have a make 4.0 to hand; if you could test it I'd appreciate it.

Forwarding a message from Ken (whose mail client is apparently not very good :-):

Ken wrote:
# I applied it to 1.6.1 - some fuzz and large offsets, but it

# completed the default build (i.e. just ./configure so all targets)
# and also a DESTDIR install.

Ken -- any chance you could test git master? I think it would be more interesting to make sure that 1.7 works with Make 4.0:
I don't know if anybody will care enough to backport this patch to 1.6.x.

thanks
-- PMM

#2 lore raw
Quoted 8 lines · Peter Maydell
Quoted 3 lines · Peter Maydell

Ken: I think this should work (and it doesn't break building with old makes), but I don't have a make 4.0 to hand; if you could test it I'd appreciate it.

Forwarding a message from Ken (whose mail client is apparently not very good :-):

No, it was operator error - I somehow fell into editing the
original mail (didn't even know that was an option for received mails) and trashed the header. Anyway.

Quoted 5 lines

Ken wrote:
# I applied it to 1.6.1 - some fuzz and large offsets, but it

# completed the default build (i.e. just ./configure so all targets)
# and also a DESTDIR install.
Quoted 7 lines

Ken -- any chance you could test git master? I think it would be more interesting to make sure that 1.7 works with Make 4.0:
I don't know if anybody will care enough to backport this patch to 1.6.x.

thanks
-- PMM

Not sure how to. I cloned git://git.qemu.org/qemu.git which was at
commit fc8ead74674b7129e8f31c2595c76658e5622197
Merge: 3551643 7174e54
Author: Anthony Liguori <[email protected]>
Date: Fri Oct 18 10:03:24 2013 -0700

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

Copied the non-dotfiles (cp -av *), applied the patch, got a
message from configure:

ERROR: DTC not present. Your options:
(1) Preferred: Install the DTC devel package
(2) Fetch the DTC submodule, using:
git submodule update --init dtc

So I went back to git, did the submodule update and copied afresh,
applied the patch, and still got the same error.

ĸen

Signature · 1 line
das eine Mal als Tragödie, dieses Mal als Farce
#3 lore raw
Quoted 10 lines · Ken Moffat
Quoted 8 lines

Ken -- any chance you could test git master? I think it would be more interesting to make sure that 1.7 works with Make 4.0:
I don't know if anybody will care enough to backport this patch to 1.6.x.

thanks
-- PMM

Not sure how to.

Scratch that, user error.

ĸen

Signature · 1 line
das eine Mal als Tragödie, dieses Mal als Farce
#4 lore raw
Quoted 7 lines · Ken Moffat
Quoted 6 lines · Ken Moffat
Quoted 6 lines

Ken -- any chance you could test git master? I think it would be more interesting to make sure that 1.7 works with Make 4.0:
I don't know if anybody will care enough to backport this patch to 1.6.x.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

thanks
-- PMM

Not sure how to.

Scratch that, user error.

Built and DESTDIR installed with the default targets using make-4.0

ĸen

Signature · 1 line
das eine Mal als Tragödie, dieses Mal als Farce
#5 lore raw
In reply to Ken Moffat
Quoted 7 lines · Ken Moffat
Quoted 3 lines · Peter Maydell

Forwarding a message from Ken (whose mail client is apparently not very good :-):

No, it was operator error - I somehow fell into editing the
original mail (didn't even know that was an option for received mails) and trashed the header. Anyway.

...you also managed to send to the Envelope-from, not the From.

Quoted 11 lines

Not sure how to. I cloned git://git.qemu.org/qemu.git which was at
commit fc8ead74674b7129e8f31c2595c76658e5622197
Merge: 3551643 7174e54
Author: Anthony Liguori <[email protected]>
Date: Fri Oct 18 10:03:24 2013 -0700

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

Copied the non-dotfiles (cp -av *), applied the patch, got a
message from configure:

Quoted 7 lines

ERROR: DTC not present. Your options:
(1) Preferred: Install the DTC devel package
(2) Fetch the DTC submodule, using:
git submodule update --init dtc

So I went back to git, did the submodule update and copied afresh,
applied the patch, and still got the same error.

I'm not sure what you're trying to achieve with the copy, but it seems likely to cause problems. Just do a build from the git tree. If you don't want to put object files in your git tree, this is what out-of-tree build is for: cd into the directory you want to put the object files in, and run the configure script from there:
mkdir ../build
cd ../build
../qemu.git/configure [usual configure options etc]

thanks
-- PMM

#6 lore raw
Quoted 40 lines · Peter Maydell
Quoted 7 lines · Ken Moffat
Quoted 3 lines · Peter Maydell

Forwarding a message from Ken (whose mail client is apparently not very good :-):

No, it was operator error - I somehow fell into editing the
original mail (didn't even know that was an option for received mails) and trashed the header. Anyway.

...you also managed to send to the Envelope-from, not the From.

Quoted 11 lines

Not sure how to. I cloned git://git.qemu.org/qemu.git which was at
commit fc8ead74674b7129e8f31c2595c76658e5622197
Merge: 3551643 7174e54
Author: Anthony Liguori <[email protected]>
Date: Fri Oct 18 10:03:24 2013 -0700

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

Copied the non-dotfiles (cp -av *), applied the patch, got a
message from configure:

Quoted 7 lines

ERROR: DTC not present. Your options:
(1) Preferred: Install the DTC devel package
(2) Fetch the DTC submodule, using:
git submodule update --init dtc

So I went back to git, did the submodule update and copied afresh,
applied the patch, and still got the same error.

I'm not sure what you're trying to achieve with the copy, but it seems likely to cause problems. Just do a build from the git tree. If you don't want to put object files in your git tree, this is what out-of-tree build is for: cd into the directory you want to put the object files in, and run the configure script from there:
mkdir ../build
cd ../build
../qemu.git/configure [usual configure options etc]

Quoted 2 lines

thanks
-- PMM

Thanks for that info.

ĸen

Signature · 1 line
das eine Mal als Tragödie, dieses Mal als Farce
#7 lore raw
In reply to Peter Maydell

Il 22/10/2013 09:24, Peter Maydell ha scritto:

Quoted 5 lines

Ken -- any chance you could test git master? I think it would be more interesting to make sure that 1.7 works with Make 4.0:
I don't know if anybody will care enough to backport this patch to 1.6.x.

Mike Roth now will. :)

Paolo

Reviewed-by on v1 1/1
#8 lore raw

Re: [Qemu-devel] [PATCH for-1.7] configure: Explicitly set ARFLAGS sowe can build with GNU Make 4.00

In reply to Peter Maydell
Quoted 3 lines · [email protected] writes:

Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules.

s/sowe/so we/

Otherwise good.

Signature · 1 line
Alex Bennée
#9 lore raw
In reply to Peter Maydell

Ping!

thanks
-- PMM

Quoted 54 lines · Peter Maydell

Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules. However we were accidentally relying on the default ARFLAGS ("rv"). This went unnoticed because of a bug in GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS only affected submakes, not the currently running instance. Explicitly set ARFLAGS in config-host.mak, in the same way we handle CFLAGS and LDFLAGS; this will allow us to work with Make 4.0.

Thanks to Paul Smith for analyzing this bug for us.

---
Ken: I think this should work (and it doesn't break building with old makes), but I don't have a make 4.0 to hand; if you could test it I'd appreciate it.

 configure | 5 +++++
 1 file changed, 5 insertions(+)
configure +5 -1
index 57ee62a..4eb3a07 100755
@@ -308,6 +308,9 @@ query_pkg_config() {
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 
+# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
+ARFLAGS="${ARFLAGS-rv}"
+
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
@@ -3664,6 +3667,7 @@ echo "C compiler        $cc"
 echo "Host C compiler   $host_cc"
 echo "C++ compiler      $cxx"
 echo "Objective-C compiler $objcc"
+echo "ARFLAGS           $ARFLAGS"
 echo "CFLAGS            $CFLAGS"
 echo "QEMU_CFLAGS       $QEMU_CFLAGS"
 echo "LDFLAGS           $LDFLAGS"
@@ -4239,6 +4243,7 @@ echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "CXX=$cxx" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "ARFLAGS=$ARFLAGS" >> $config_host_mak
 echo "AS=$as" >> $config_host_mak
 echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
--

1.7.11.4

#10 lore raw

Am 05.11.2013 19:04, schrieb Peter Maydell:

Quoted 1 line

Ping!

A typo in the commit message has been reported, and it has been requested to add Cc: [email protected]. Since you neither CC qemu-trivial nor a particular maintainer that would fix those for you, you'll have to respin.

Andreas

Quoted 60 lines

thanks
-- PMM

Quoted 54 lines · Peter Maydell

Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules. However we were accidentally relying on the default ARFLAGS ("rv"). This went unnoticed because of a bug in GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS only affected submakes, not the currently running instance. Explicitly set ARFLAGS in config-host.mak, in the same way we handle CFLAGS and LDFLAGS; this will allow us to work with Make 4.0.

Thanks to Paul Smith for analyzing this bug for us.

---
Ken: I think this should work (and it doesn't break building with old makes), but I don't have a make 4.0 to hand; if you could test it I'd appreciate it.

 configure | 5 +++++
 1 file changed, 5 insertions(+)
configure +5 -1
index 57ee62a..4eb3a07 100755
@@ -308,6 +308,9 @@ query_pkg_config() {
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 
+# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
+ARFLAGS="${ARFLAGS-rv}"
+
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
@@ -3664,6 +3667,7 @@ echo "C compiler        $cc"
 echo "Host C compiler   $host_cc"
 echo "C++ compiler      $cxx"
 echo "Objective-C compiler $objcc"
+echo "ARFLAGS           $ARFLAGS"
 echo "CFLAGS            $CFLAGS"
 echo "QEMU_CFLAGS       $QEMU_CFLAGS"
 echo "LDFLAGS           $LDFLAGS"
@@ -4239,6 +4243,7 @@ echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "CXX=$cxx" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "ARFLAGS=$ARFLAGS" >> $config_host_mak
 echo "AS=$as" >> $config_host_mak
 echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
--

1.7.11.4

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg