From: Hollis Blanchard <hollisb@us.ibm.com>
To: avi@qumranet.com
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Subject: [PATCH 7 of 7] user: define and use AR in configure scripts and Makefiles
Date: Wed, 29 Oct 2008 13:27:55 -0500 [thread overview]
Message-ID: <fe730487960e35e7b264.1225304875@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1225304868@localhost.localdomain>
libkvm/Makefile uses $(AR), but it's not defined by the top-level configure.
The problem is that when cross-compiling for a 64-bit target on a 32-bit host,
32-bit ar will be used and the 64-bit code will fail to link.
user/Makefile has the same problem, and even uses plain "ar".
Add AR to configure and user/configure, and use it in the Makefiles.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -6,6 +6,7 @@ cc=gcc
cc=gcc
ld=ld
objcopy=objcopy
+ar=ar
want_module=1
qemu_cflags=
qemu_ldflags=
@@ -141,6 +142,7 @@ CC=$cross_prefix$cc
CC=$cross_prefix$cc
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy
+AR=$cross_prefix$ar
EOF
cat <<EOF > kernel/config.kbuild
diff --git a/user/Makefile b/user/Makefile
--- a/user/Makefile
+++ b/user/Makefile
@@ -48,7 +48,7 @@ kvmtrace: $(kvmtrace_objs)
$(CC) $(LDFLAGS) $^ -o $@
$(libcflat): $(cflatobjs)
- ar rcs $@ $^
+ $(AR) rcs $@ $^
%.o: %.S
$(CC) $(CFLAGS) -c -nostdlib -o $@ $^
diff --git a/user/configure b/user/configure
--- a/user/configure
+++ b/user/configure
@@ -5,6 +5,7 @@ cc=gcc
cc=gcc
ld=ld
objcopy=objcopy
+ar=ar
arch=`uname -m | sed -e s/i.86/i386/`
processor="$arch"
cross_prefix=
@@ -70,4 +71,5 @@ CC=$cross_prefix$cc
CC=$cross_prefix$cc
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy
+AR=$cross_prefix$ar
EOF
next prev parent reply other threads:[~2008-10-29 18:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 18:27 [PATCH 0 of 7] kvm-userspace: support multiple processors in the same architecture Hollis Blanchard
2008-10-29 18:27 ` [PATCH 1 of 7] user: consolidate $arch tests and allow $arch to be "<arch>-<processor>" Hollis Blanchard
[not found] ` <f9e70364f32892700c73.1225304869-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-11-02 9:03 ` Avi Kivity
2008-10-29 18:27 ` [PATCH 2 of 7] kvmctl: add --processor option to user/configure Hollis Blanchard
2008-10-29 18:27 ` [PATCH 3 of 7] user: set $PROCESSOR from configure --arch=<arch>-<processor> Hollis Blanchard
2008-10-29 18:27 ` [PATCH 4 of 7] kvmctl: rename config-powerpc-44x.mak Hollis Blanchard
2008-10-29 18:27 ` [PATCH 5 of 7] kvmctl: ppc: use $PROCESSOR to set configuration options Hollis Blanchard
2008-10-29 18:27 ` [PATCH 6 of 7] user: ppc: remove build flags Hollis Blanchard
2008-10-29 18:27 ` Hollis Blanchard [this message]
2008-10-30 12:57 ` [PATCH 0 of 7] kvm-userspace: support multiple processors in the same architecture Christian Ehrhardt
[not found] ` <patchbomb.1225304868-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-11-02 9:06 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe730487960e35e7b264.1225304875@localhost.localdomain \
--to=hollisb@us.ibm.com \
--cc=avi@qumranet.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox