From: Andrew Jones <andrew.jones@linux.dev>
To: kvm-riscv@lists.infradead.org
Subject: [kvm-unit-tests PATCH v2 3/4] riscv: Fix out-of-tree builds
Date: Thu, 8 Aug 2024 17:42:27 +0200 [thread overview]
Message-ID: <20240808154223.79686-9-andrew.jones@linux.dev> (raw)
In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev>
My riscv compiler doesn't seem to want to create directories as other
compilers are apparently doing. There's only a few of them, so let's
just manually create them in configure. And riscv also needed
'-I lib' in CFLAGS.
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---
configure | 8 ++++++--
riscv/Makefile | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index db15e85d6ac7..27ae9cc89657 100755
--- a/configure
+++ b/configure
@@ -418,12 +418,16 @@ rm -f lib/asm
asm="asm-generic"
if [ -d "$srcdir/lib/$arch/asm" ]; then
asm="$srcdir/lib/$arch/asm"
+ mkdir -p "lib/$arch"
+elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
+ asm="$srcdir/lib/$arch_libdir/asm"
+ mkdir -p "lib/$arch_libdir"
elif [ -d "$srcdir/lib/$testdir/asm" ]; then
asm="$srcdir/lib/$testdir/asm"
+ mkdir -p "lib/$testdir"
fi
-mkdir -p lib
ln -sf "$asm" lib/asm
-
+mkdir -p lib/generated lib/libfdt
# create the config
cat <<EOF > config.mak
diff --git a/riscv/Makefile b/riscv/Makefile
index 7906cef7f199..179a373dbacf 100644
--- a/riscv/Makefile
+++ b/riscv/Makefile
@@ -80,7 +80,7 @@ CFLAGS += -mstrict-align
CFLAGS += -std=gnu99
CFLAGS += -ffreestanding
CFLAGS += -O2
-CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt
+CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib
asm-offsets = lib/riscv/asm-offsets.h
include $(SRCDIR)/scripts/asm-offsets.mak
--
2.45.2
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org
Cc: pbonzini@redhat.com, thuth@redhat.com, atishp@rivosinc.com,
cade.richard@berkeley.edu, jamestiotio@gmail.com
Subject: [kvm-unit-tests PATCH v2 3/4] riscv: Fix out-of-tree builds
Date: Thu, 8 Aug 2024 17:42:27 +0200 [thread overview]
Message-ID: <20240808154223.79686-9-andrew.jones@linux.dev> (raw)
In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev>
My riscv compiler doesn't seem to want to create directories as other
compilers are apparently doing. There's only a few of them, so let's
just manually create them in configure. And riscv also needed
'-I lib' in CFLAGS.
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---
configure | 8 ++++++--
riscv/Makefile | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index db15e85d6ac7..27ae9cc89657 100755
--- a/configure
+++ b/configure
@@ -418,12 +418,16 @@ rm -f lib/asm
asm="asm-generic"
if [ -d "$srcdir/lib/$arch/asm" ]; then
asm="$srcdir/lib/$arch/asm"
+ mkdir -p "lib/$arch"
+elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
+ asm="$srcdir/lib/$arch_libdir/asm"
+ mkdir -p "lib/$arch_libdir"
elif [ -d "$srcdir/lib/$testdir/asm" ]; then
asm="$srcdir/lib/$testdir/asm"
+ mkdir -p "lib/$testdir"
fi
-mkdir -p lib
ln -sf "$asm" lib/asm
-
+mkdir -p lib/generated lib/libfdt
# create the config
cat <<EOF > config.mak
diff --git a/riscv/Makefile b/riscv/Makefile
index 7906cef7f199..179a373dbacf 100644
--- a/riscv/Makefile
+++ b/riscv/Makefile
@@ -80,7 +80,7 @@ CFLAGS += -mstrict-align
CFLAGS += -std=gnu99
CFLAGS += -ffreestanding
CFLAGS += -O2
-CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt
+CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib
asm-offsets = lib/riscv/asm-offsets.h
include $(SRCDIR)/scripts/asm-offsets.mak
--
2.45.2
next prev parent reply other threads:[~2024-08-08 15:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 15:42 [kvm-unit-tests PATCH v2 0/4] riscv: Extend CI Andrew Jones
2024-08-08 15:42 ` Andrew Jones
2024-08-08 15:42 ` [kvm-unit-tests PATCH v2 1/4] lib: Add limits.h Andrew Jones
2024-08-08 15:42 ` Andrew Jones
2024-08-08 15:42 ` [kvm-unit-tests PATCH v2 2/4] riscv: Build with explicit ABI Andrew Jones
2024-08-08 15:42 ` Andrew Jones
2024-08-08 15:42 ` Andrew Jones [this message]
2024-08-08 15:42 ` [kvm-unit-tests PATCH v2 3/4] riscv: Fix out-of-tree builds Andrew Jones
2024-08-08 15:42 ` [kvm-unit-tests PATCH v2 4/4] riscv: Extend gitlab CI Andrew Jones
2024-08-08 15:42 ` Andrew Jones
2024-08-12 13:53 ` [kvm-unit-tests PATCH v2 0/4] riscv: Extend CI Andrew Jones
2024-08-12 13:53 ` Andrew Jones
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=20240808154223.79686-9-andrew.jones@linux.dev \
--to=andrew.jones@linux.dev \
--cc=kvm-riscv@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.