qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: thuth@redhat.com, cohuck@redhat.com
Subject: [PATCH 1/4] update-linux-headers: fix forwarding to asm-generic headers
Date: Mon,  3 Jun 2024 15:11:38 +0200	[thread overview]
Message-ID: <20240603131141.834241-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20240603131141.834241-1-pbonzini@redhat.com>

Afer commit 3efc75ad9d9 ("scripts/update-linux-headers.sh: Remove
temporary directory inbetween", 2024-05-29), updating linux-headers/
results in errors such as

   cp: cannot stat '/tmp/tmp.1A1Eejh1UE/headers/include/asm/bitsperlong.h': No such file or directory

because Loongarch does not have an asm/bitsperlong.h file and uses the
generic version.  Before commit 3efc75ad9d9, the missing file would
incorrectly cause stale files to be included in linux-headers/.  The files
were never committed to qemu.git, but were wrong nevertheless. The build
would just use the system version of the files, which is opposite to
the idea of importing Linux header files into QEMU's tree.

Create forwarding headers, resembling the ones that are generated during a
kernel build by scripts/Makefile.asm-generic, if a file is only installed
under include/asm-generic/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/update-linux-headers.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 23afe8c08ad..ae34d18572b 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -118,7 +118,14 @@ for arch in $ARCHLIST; do
     rm -rf "$output/linux-headers/asm-$arch"
     mkdir -p "$output/linux-headers/asm-$arch"
     for header in kvm.h unistd.h bitsperlong.h mman.h; do
-        cp "$hdrdir/include/asm/$header" "$output/linux-headers/asm-$arch"
+        if test -f "$hdrdir/include/asm/$header"; then
+            cp "$hdrdir/include/asm/$header" "$output/linux-headers/asm-$arch"
+        elif test -f "$hdrdir/include/asm-generic/$header"; then
+            # not installed as <asm/bitsperlong.h>, but used as such in kernel sources
+            cat <<EOF >$output/linux-headers/asm-$arch/$header
+#include <asm-generic/$header>
+EOF
+        fi
     done
 
     if [ $arch = mips ]; then
-- 
2.45.1



  reply	other threads:[~2024-06-03 13:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 13:11 [PATCH 0/4] update-linux-headers: prepare for updating to 6.9+ and for SNP patches Paolo Bonzini
2024-06-03 13:11 ` Paolo Bonzini [this message]
2024-06-03 14:54   ` [PATCH 1/4] update-linux-headers: fix forwarding to asm-generic headers Thomas Huth
2024-06-03 13:11 ` [PATCH 2/4] update-linux-headers: move pvpanic.h to correct directory Paolo Bonzini
2024-06-03 14:58   ` Thomas Huth
2024-06-03 13:11 ` [PATCH 3/4] linux-headers: Update to current kvm/next Paolo Bonzini
2024-06-03 15:58   ` Cornelia Huck
2024-06-03 16:01     ` Paolo Bonzini
2024-06-03 16:25       ` Cornelia Huck
2024-06-03 16:40         ` Paolo Bonzini
2024-06-03 13:11 ` [PATCH 4/4] update-linux-headers: import linux/kvm_para.h header Paolo Bonzini
2024-06-03 15:05   ` Thomas Huth
2024-06-04  8:31 ` [PATCH 0/4] update-linux-headers: prepare for updating to 6.9+ and for SNP patches Cornelia Huck

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=20240603131141.834241-2-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).