From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: buildroot@buildroot.org
Cc: Vincent Fazio <vfazio@gmail.com>,
Vincent Fazio <vfazio@xes-inc.com>,
Giulio Benetti <giulio.benetti@benettiengineering.com>,
Romain Naour <romain.naour@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Neal Frager <neal.frager@amd.com>,
Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>,
Angelo Compagnucci <angelo.compagnucci@gmail.com>
Subject: [Buildroot] [PATCH v2 1/2] package/gcc: add symver attribute support to MicroBlaze
Date: Tue, 24 Nov 2026 09:59:23 +0100 [thread overview]
Message-ID: <20261124085924.2250690-1-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <CAOrEah6tmVYxKe4C0N0GV2YvaOt22uPaRCFB1scc01ezwtBetw@mail.gmail.com>
From: Vincent Fazio <vfazio@gmail.com>
While the MicroBlaze architecture does generate ELFs, it does not
leverage elfos.h to define common attributes; symver being one of them.
By adding symver support, there should no longer be any need to patch
packages to account for this architecture quirk.
Fixes: https://autobuild.buildroot.net/results/29c/29c76e02becedf922bd7dc0533338c078bf77d2a/
Fixes: https://autobuild.buildroot.net/results/1e9/1e965d83d75615f35308440c5db044314a349357/
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
Changes v1 -> v2:
- rebase on GCC 14.4.0, 15.3.0 and 16.2.0, the versions in master
- Upstream: tag points to the bug report comment with the patch
- autobuild URLs in the current form, in the trailer block
Supersedes v1: https://patchwork.buildroot.org/project/buildroot/patch/20240228165300.4158751-1-vfazio@gmail.com/
...e-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch | 56 +++++++++++++++++++
...e-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch | 56 +++++++++++++++++++
...e-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch | 56 +++++++++++++++++++
3 files changed, 168 insertions(+)
create mode 100644 package/gcc/14.4.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
create mode 100644 package/gcc/15.3.0/0005-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
create mode 100644 package/gcc/16.2.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
diff --git a/package/gcc/14.4.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch b/package/gcc/14.4.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
new file mode 100644
index 0000000000..51459f5763
--- /dev/null
+++ b/package/gcc/14.4.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
@@ -0,0 +1,56 @@
+From 99873bdc294aabd19861786f51c6be01ecaee59c Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <vfazio@xes-inc.com>
+Date: Tue, 20 Feb 2024 16:49:06 -0600
+Subject: [PATCH] microblaze: define ASM_OUTPUT_SYMVER_DIRECTIVE
+
+The MicroBlaze target architecture generates ELF binary objects, however
+it does not leverage elfos.h like other ELF generating architectures
+(see gcc/config.gcc).
+
+Due to this quirk, the architecture does not receive "free" updates for
+new features that get added for ELF objects. One such feature being
+symver support [0].
+
+Now, the macro necessary to emit symver directives is defined.
+
+Packages such as attr, xz, libkcapi, et al which use this directive
+should now compile on MicroBlaze without needing a patch to account
+for this lack of support.
+
+This patch has not been submitted upstream as discussion [1] around
+the approach has leaned toward a full migration to elfos.h which is
+non-trivial.
+
+[0]: https://github.com/gcc-mirror/gcc/commit/d7ddfbcb7
+[1]: https://gcc.gnu.org/pipermail/gcc/2023-February/240752.html
+Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766#c6
+Signed-off-by: Vincent Fazio <vfazio@gmail.com>
+---
+ gcc/config/microblaze/microblaze.h | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
+index c88a87c..e0847e4 100644
+--- a/gcc/config/microblaze/microblaze.h
++++ b/gcc/config/microblaze/microblaze.h
+@@ -832,6 +832,17 @@ do { \
+ fputc ('\n', FILE); \
+ } while (0)
+
++#define ASM_OUTPUT_SYMVER_DIRECTIVE(FILE, NAME, NAME2) \
++ do \
++ { \
++ fputs ("\t.symver\t", (FILE)); \
++ assemble_name ((FILE), (NAME)); \
++ fputs (", ", (FILE)); \
++ assemble_name ((FILE), (NAME2)); \
++ fputc ('\n', (FILE)); \
++ } \
++ while (0)
++
+ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+ #undef UNIQUE_SECTION_P
+ #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+--
+2.43.0
+
diff --git a/package/gcc/15.3.0/0005-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch b/package/gcc/15.3.0/0005-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
new file mode 100644
index 0000000000..519fe8673c
--- /dev/null
+++ b/package/gcc/15.3.0/0005-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
@@ -0,0 +1,56 @@
+From 99873bdc294aabd19861786f51c6be01ecaee59c Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <vfazio@xes-inc.com>
+Date: Tue, 20 Feb 2024 16:49:06 -0600
+Subject: [PATCH] microblaze: define ASM_OUTPUT_SYMVER_DIRECTIVE
+
+The MicroBlaze target architecture generates ELF binary objects, however
+it does not leverage elfos.h like other ELF generating architectures
+(see gcc/config.gcc).
+
+Due to this quirk, the architecture does not receive "free" updates for
+new features that get added for ELF objects. One such feature being
+symver support [0].
+
+Now, the macro necessary to emit symver directives is defined.
+
+Packages such as attr, xz, libkcapi, et al which use this directive
+should now compile on MicroBlaze without needing a patch to account
+for this lack of support.
+
+This patch has not been submitted upstream as discussion [1] around
+the approach has leaned toward a full migration to elfos.h which is
+non-trivial.
+
+[0]: https://github.com/gcc-mirror/gcc/commit/d7ddfbcb7
+[1]: https://gcc.gnu.org/pipermail/gcc/2023-February/240752.html
+Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766#c6
+Signed-off-by: Vincent Fazio <vfazio@gmail.com>
+---
+ gcc/config/microblaze/microblaze.h | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
+index 2390542..59f8a53 100644
+--- a/gcc/config/microblaze/microblaze.h
++++ b/gcc/config/microblaze/microblaze.h
+@@ -829,6 +829,17 @@ do { \
+ fputc ('\n', FILE); \
+ } while (0)
+
++#define ASM_OUTPUT_SYMVER_DIRECTIVE(FILE, NAME, NAME2) \
++ do \
++ { \
++ fputs ("\t.symver\t", (FILE)); \
++ assemble_name ((FILE), (NAME)); \
++ fputs (", ", (FILE)); \
++ assemble_name ((FILE), (NAME2)); \
++ fputc ('\n', (FILE)); \
++ } \
++ while (0)
++
+ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+ #undef UNIQUE_SECTION_P
+ #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+--
+2.43.0
+
diff --git a/package/gcc/16.2.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch b/package/gcc/16.2.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
new file mode 100644
index 0000000000..408a05c533
--- /dev/null
+++ b/package/gcc/16.2.0/0004-microblaze-define-ASM_OUTPUT_SYMVER_DIRECTIVE.patch
@@ -0,0 +1,56 @@
+From 99873bdc294aabd19861786f51c6be01ecaee59c Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <vfazio@xes-inc.com>
+Date: Tue, 20 Feb 2024 16:49:06 -0600
+Subject: [PATCH] microblaze: define ASM_OUTPUT_SYMVER_DIRECTIVE
+
+The MicroBlaze target architecture generates ELF binary objects, however
+it does not leverage elfos.h like other ELF generating architectures
+(see gcc/config.gcc).
+
+Due to this quirk, the architecture does not receive "free" updates for
+new features that get added for ELF objects. One such feature being
+symver support [0].
+
+Now, the macro necessary to emit symver directives is defined.
+
+Packages such as attr, xz, libkcapi, et al which use this directive
+should now compile on MicroBlaze without needing a patch to account
+for this lack of support.
+
+This patch has not been submitted upstream as discussion [1] around
+the approach has leaned toward a full migration to elfos.h which is
+non-trivial.
+
+[0]: https://github.com/gcc-mirror/gcc/commit/d7ddfbcb7
+[1]: https://gcc.gnu.org/pipermail/gcc/2023-February/240752.html
+Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766#c6
+Signed-off-by: Vincent Fazio <vfazio@gmail.com>
+---
+ gcc/config/microblaze/microblaze.h | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
+index 8d1bcba..53d8245 100644
+--- a/gcc/config/microblaze/microblaze.h
++++ b/gcc/config/microblaze/microblaze.h
+@@ -829,6 +829,17 @@ do { \
+ fputc ('\n', FILE); \
+ } while (0)
+
++#define ASM_OUTPUT_SYMVER_DIRECTIVE(FILE, NAME, NAME2) \
++ do \
++ { \
++ fputs ("\t.symver\t", (FILE)); \
++ assemble_name ((FILE), (NAME)); \
++ fputs (", ", (FILE)); \
++ assemble_name ((FILE), (NAME2)); \
++ fputc ('\n', (FILE)); \
++ } \
++ while (0)
++
+ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+ #undef UNIQUE_SECTION_P
+ #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+--
+2.43.0
+
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-11-24 8:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 16:53 [Buildroot] [PATCH 1/1] package/gcc: add symver attribute support to MicroBlaze Vincent Fazio
2026-11-23 17:30 ` Angelo Compagnucci
2026-11-23 17:44 ` Vincent Fazio
2026-11-23 20:09 ` Angelo Compagnucci
2026-11-23 20:57 ` Thomas Petazzoni via buildroot
2026-11-23 22:35 ` Vincent Fazio
2026-11-24 8:59 ` Angelo Compagnucci [this message]
2026-11-24 8:59 ` [Buildroot] [PATCH v2 2/2] package/elfutils: drop the microblaze workaround Angelo Compagnucci
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=20261124085924.2250690-1-angelo.compagnucci@gmail.com \
--to=angelo.compagnucci@gmail.com \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=ibai.erkiaga-elorza@amd.com \
--cc=neal.frager@amd.com \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vfazio@gmail.com \
--cc=vfazio@xes-inc.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