Skip to contentSkip to conversation

scripts/update-linux-headers: Handle __aligned_u64

PATCH New Peter Maydell 1 participant 1 message May 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/update-linux-headers: Handle __aligned_u64

We'll currently replace any 'u64' with a 'uint64_t' including when it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t' which doesn't exist. We need to instead expand out the kernel's definition of __aligned_u64:
#define __aligned_u64 __u64 __attribute__((aligned(8)))
before we convert the __u64 to uint64_t.

---
Alex's "scripts/update-linux-headers: Update handling of __aligned_u64" patch also addresses this problem, but I think we need to take this approach, because the resulting header is supposed to be host-OS-portable.

 scripts/update-linux-headers.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/update-linux-headers.sh +2 -1
index 947dec2852..1fe54f8ab1 100755
@@ -51,7 +51,8 @@ cp_portable() {
     fi
 
     header=$(basename "$f");
-    sed -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \
+    sed -e 's/__aligned_u64/__u64 __attribute__((aligned(8)))/g' \
+        -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \
         -e 's/u\([0-9][0-9]*\)/uint\1_t/g' \
         -e 's/__s\([0-9][0-9]*\)/int\1_t/g' \
         -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \
Signature · 1 line
2.17.0