From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: [PATCH 2/2] [RESEND] Enable make files in user dir for cross compile Date: Tue, 09 Oct 2007 00:19:52 -0500 Message-ID: <1191907192.11688.21.camel@laptop> Reply-To: jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-EwT9jUXn/4Z6u1pYTBc/" To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org --=-EwT9jUXn/4Z6u1pYTBc/ Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch enables the user directory make file for cross compiling. Signed-off-by: Jerone Young --=-EwT9jUXn/4Z6u1pYTBc/ Content-Disposition: attachment; filename="[PATCH 2\\2] enable_user_dir_make_cross_compile" Content-Type: text/x-patch; name="[PATCH 2\\2] enable_user_dir_make_cross_compile"; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r e76b2ad97742 user/Makefile --- a/user/Makefile Tue Oct 09 00:03:08 2007 -0500 +++ b/user/Makefile Tue Oct 09 00:03:59 2007 -0500 @@ -1,5 +1,13 @@ include config.mak + +DESTDIR := + +#make sure env CFLAGS variable is not used +CFLAGS = + +#include architecure specific make rules +include config-$(ARCH).mak # cc-option # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) @@ -7,8 +15,8 @@ cc-option = $(shell if $(CC) $(1) -S -o cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall -m$(bits) +CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ + -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "") @@ -17,20 +25,6 @@ CXXFLAGS = $(autodepend-flags) CXXFLAGS = $(autodepend-flags) autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d - -DESTDIR = - -ifeq ($(shell uname -m), x86_64) -LIBDIR = /lib64 -cstart.o = test/cstart64.o -bits = 64 -ldarch = elf64-x86-64 -else -LIBDIR = /lib -cstart.o = test/cstart.o -bits = 32 -ldarch = elf32-i386 -endif all: kvmctl libkvm.a flatfiles @@ -45,11 +39,7 @@ libkvm.a: kvmctl.o flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat -flatfiles-32 = - -flatfiles-64 = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat - -flatfiles: $(flatfiles-common) $(flatfiles-$(bits)) +flatfiles: $(flatfiles-common) $(flatfiles) install: install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.h @@ -60,13 +50,13 @@ install: install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a %.flat: %.o - gcc $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ + $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ test/bootstrap: test/bootstrap.o - gcc -nostdlib -o $@ -Wl,-T,bootstrap.lds $^ + $(CC) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^ %.o: %.S - gcc $(CFLAGS) -c -nostdlib -o $@ $^ + $(CC) $(CFLAGS) -c -nostdlib -o $@ $^ test/irq.flat: test/print.o diff -r 1ec77d7c5e51 user/config-i386.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user/config-i386.mak Thu Oct 04 08:33:37 2007 -0500 @@ -0,0 +1,7 @@ +LIBDIR = /lib +cstart.o = test/cstart.o +bits = 32 +ldarch = elf32-i386 +CFLAGS += -m32 + +flatfiles= diff -r cd1ff95ab7c4 user/config-x86_64.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user/config-x86_64.mak Thu Oct 04 08:35:56 2007 -0500 @@ -0,0 +1,7 @@ +LIBDIR = /lib64 +cstart.o = test/cstart64.o +bits = 64 +ldarch = elf64-x86-64 +CFLAGS += -m64 + +flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat --=-EwT9jUXn/4Z6u1pYTBc/ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --=-EwT9jUXn/4Z6u1pYTBc/ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --=-EwT9jUXn/4Z6u1pYTBc/--