New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elfutils: add patch that fixes compilation under gcc8 #40705
Conversation
a32ae35
to
be54e77
Compare
Success on x86_64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
patches = [ | ||
./debug-info-from-env.patch | ||
# From: https://patchwork.openembedded.org/patch/149575/ | ||
./0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use
# From: https://patchwork.openembedded.org/patch/149575/
(fetchpatch {
name = "0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch";
url = https://patchwork.openembedded.org/patch/149575/raw/;
sha256 = "0000000000000000000000000000000000000000000000000000000000000000";
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that also possible if it's a patch within a patch? (The patch that is linked adds a patch file, it isn't just the patch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant part of the linked patch:
diff --git a/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch b/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch
new file mode 100644
index 0000000000..cf4d1dfe75
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch
@@ -0,0 +1,34 @@
+From 732913a8c35c7b25c0cbf6903cab1ad6b602b525 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 22 Mar 2018 22:44:03 -0700
+Subject: [PATCH] Ensure that packed structs follow the gcc memory layout
+
+Partial backport of
+https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d
+
+Helps fixing alignment errors e.g.
+linux-core-note.c:116:1: error: alignment 2 of 'struct m68k_prstatus
+' is less than 4 [-Werror=packed-not-aligned]
+ ;
+ ^
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ backends/linux-core-note.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
+index 5f06c896..9faae4c3 100644
+--- a/backends/linux-core-note.c
++++ b/backends/linux-core-note.c
+@@ -111,7 +111,7 @@ struct EBLHOOK(prstatus)
+ FIELD (INT, pr_fpvalid);
+ }
+ #ifdef ALIGN_PRSTATUS
+- __attribute__ ((packed, aligned (ALIGN_PRSTATUS)))
++ attribute_packed __attribute__ ((aligned (ALIGN_PRSTATUS)))
+ #endif
+ ;
+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be54e77
to
8787699
Compare
Success on x86_64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
@jtojnar Better? |
patches = ./debug-info-from-env.patch; | ||
patches = [ | ||
./debug-info-from-env.patch | ||
(fetchpatch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchurl
should be enough here, it is just a static file.
url = http://git.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch?id=49aae1d75ff1c6a9643c30a8cc5776a2ffa83dd3; | ||
sha256 = "09y4x1yaqm84w7cy1sf57a6g8ah49b0349dsj2a81wy4flw8ih5j"; | ||
}) | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please dedent this.
patches = ./debug-info-from-env.patch; | ||
patches = [ | ||
./debug-info-from-env.patch | ||
(fetchpatch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep the source comment, or mention that it is for GCC 8, or something
Success on x86_64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: elfutils Partial log (click to expand)
|
This reverts commit b12448c.
Motivation for this change
Was failing: https://hydra.nixos.org/build/73828348/nixlog/2
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)