public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* MicroBlaze symver attribute support
@ 2023-02-20 13:55 Vincent Fazio
  2023-02-20 14:54 ` Joel Sherrill
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Fazio @ 2023-02-20 13:55 UTC (permalink / raw)
  To: gcc; +Cc: eager

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

Michael, all,

Regarding:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110

If I understand correctly, since the GCC MicroBlaze targets generate ELF
images, it would seem there's no technical reason why `__attribute__
((symver ...))` cannot be supported?

The issue seems to be that the MicroBlaze targets in config.gcc do not
include elfos.h
https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369

Which defines `ASM_OUTPUT_SYMVER_DIRECTIVE`
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259

Which is necessary for
https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260

Changing the targets to include elfos.h leads to a number of conflicts with
the target specific header (config/microblaze/microblaze.h).

Should `ASM_OUTPUT_SYMVER_DIRECTIVE` be copied into
config/microblaze/microblaze.h or should the MicroBlaze targets and header
be reworked to support elfos.h?

I'm asking because I've seen a number of projects run into this issue (xz,
elfutils, libfuse, libkcapi, cryptsetup).

Thanks,
-Vincent

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MicroBlaze symver attribute support
  2023-02-20 13:55 MicroBlaze symver attribute support Vincent Fazio
@ 2023-02-20 14:54 ` Joel Sherrill
  2023-02-21  1:35   ` Michael Eager
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Sherrill @ 2023-02-20 14:54 UTC (permalink / raw)
  To: Vincent Fazio; +Cc: gcc, eager

[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]

On Mon, Feb 20, 2023 at 7:56 AM Vincent Fazio via Gcc <gcc@gcc.gnu.org>
wrote:

> Michael, all,
>
> Regarding:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110
>
> If I understand correctly, since the GCC MicroBlaze targets generate ELF
> images, it would seem there's no technical reason why `__attribute__
> ((symver ...))` cannot be supported?
>
> The issue seems to be that the MicroBlaze targets in config.gcc do not
> include elfos.h
> https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369
>
> Which defines `ASM_OUTPUT_SYMVER_DIRECTIVE`
> https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259
>
> Which is necessary for
> https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260
>
> Changing the targets to include elfos.h leads to a number of conflicts with
> the target specific header (config/microblaze/microblaze.h).
>
> Should `ASM_OUTPUT_SYMVER_DIRECTIVE` be copied into
> config/microblaze/microblaze.h or should the MicroBlaze targets and header
> be reworked to support elfos.h?
>

IMO reworked to include elfos.h. During the RTEMS port, we noticed that
some quirks on the microblaze gcc because it isn't using elfos.h. This
likely
will mean it will be updated as a side-effect of normal GCC maintenance
instead of being an odd singleton which doesn't share.

>
> I'm asking because I've seen a number of projects run into this issue (xz,
> elfutils, libfuse, libkcapi, cryptsetup).
>

And RTEMS.

--joel

>
> Thanks,
> -Vincent
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MicroBlaze symver attribute support
  2023-02-20 14:54 ` Joel Sherrill
@ 2023-02-21  1:35   ` Michael Eager
  2023-03-03 19:35     ` Vincent Fazio
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2023-02-21  1:35 UTC (permalink / raw)
  To: joel, Vincent Fazio; +Cc: gcc

On 2/20/23 06:54, Joel Sherrill wrote:
> 
> 
> On Mon, Feb 20, 2023 at 7:56 AM Vincent Fazio via Gcc <gcc@gcc.gnu.org 
> <mailto:gcc@gcc.gnu.org>> wrote:
> 
>     Michael, all,
> 
>     Regarding:
>     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
>     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766>
>     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110
>     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110>
> 
>     If I understand correctly, since the GCC MicroBlaze targets generate ELF
>     images, it would seem there's no technical reason why `__attribute__
>     ((symver ...))` cannot be supported?
> 
>     The issue seems to be that the MicroBlaze targets in config.gcc do not
>     include elfos.h
>     https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369
>     <https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369>
> 
>     Which defines `ASM_OUTPUT_SYMVER_DIRECTIVE`
>     https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259 <https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259>
> 
>     Which is necessary for
>     https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260
>     <https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260>
> 
>     Changing the targets to include elfos.h leads to a number of
>     conflicts with
>     the target specific header (config/microblaze/microblaze.h).
> 
>     Should `ASM_OUTPUT_SYMVER_DIRECTIVE` be copied into
>     config/microblaze/microblaze.h or should the MicroBlaze targets and
>     header
>     be reworked to support elfos.h?
> 
> 
> IMO reworked to include elfos.h. During the RTEMS port, we noticed that
> some quirks on the microblaze gcc because it isn't using elfos.h. This 
> likely
> will mean it will be updated as a side-effect of normal GCC maintenance
> instead of being an odd singleton which doesn't share.
> 
> 
>     I'm asking because I've seen a number of projects run into this
>     issue (xz,
>     elfutils, libfuse, libkcapi, cryptsetup).
> 
> 
> And RTEMS.
> 
> --joel


Joel -- do you have a patch to add elfos.h to MicroBlaze?

-- 
Michael Eager

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MicroBlaze symver attribute support
  2023-02-21  1:35   ` Michael Eager
@ 2023-03-03 19:35     ` Vincent Fazio
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent Fazio @ 2023-03-03 19:35 UTC (permalink / raw)
  To: Michael Eager; +Cc: joel, gcc

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

All

On Mon, Feb 20, 2023 at 7:35 PM Michael Eager <eager@eagercon.com> wrote:

> On 2/20/23 06:54, Joel Sherrill wrote:
> >
> >
> > On Mon, Feb 20, 2023 at 7:56 AM Vincent Fazio via Gcc <gcc@gcc.gnu.org
> > <mailto:gcc@gcc.gnu.org>> wrote:
> >
> >     Michael, all,
> >
> >     Regarding:
> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
> >     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766>
> >     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110
> >     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102110>
> >
> >     If I understand correctly, since the GCC MicroBlaze targets generate
> ELF
> >     images, it would seem there's no technical reason why `__attribute__
> >     ((symver ...))` cannot be supported?
> >
> >     The issue seems to be that the MicroBlaze targets in config.gcc do
> not
> >     include elfos.h
> >     https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369
> >     <https://github.com/gcc-mirror/gcc/blob/master/gcc/config.gcc#L2369>
> >
> >     Which defines `ASM_OUTPUT_SYMVER_DIRECTIVE`
> >
> https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259 <
> https://github.com/gcc-mirror/gcc/blob/master/gcc/config/elfos.h#L259>
> >
> >     Which is necessary for
> >     https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260
> >     <https://github.com/gcc-mirror/gcc/blob/master/gcc/varasm.cc#L6260>
> >
> >     Changing the targets to include elfos.h leads to a number of
> >     conflicts with
> >     the target specific header (config/microblaze/microblaze.h).
> >
> >     Should `ASM_OUTPUT_SYMVER_DIRECTIVE` be copied into
> >     config/microblaze/microblaze.h or should the MicroBlaze targets and
> >     header
> >     be reworked to support elfos.h?
> >
> >
> > IMO reworked to include elfos.h. During the RTEMS port, we noticed that
> > some quirks on the microblaze gcc because it isn't using elfos.h. This
> > likely
> > will mean it will be updated as a side-effect of normal GCC maintenance
> > instead of being an odd singleton which doesn't share.
> >
> >
> >     I'm asking because I've seen a number of projects run into this
> >     issue (xz,
> >     elfutils, libfuse, libkcapi, cryptsetup).
> >
> >
> > And RTEMS.
> >
> > --joel
>
>
> Joel -- do you have a patch to add elfos.h to MicroBlaze?
>
>

I have a very crude commit here off of 11.3.0:

https://github.com/vfazio/gcc/commit/e65fea47b881b136f6753001791ebf68a4874dd6

I've tested it as a patch on Buildroot's toolchain and dropped the patch we
used to hack
around the previous lack of symver support for XZ. I was able to boot the
resultant kernel
and rootfs via qemu-system-microblaze and the symbol versions XZ expects
are included
based on discussions with the maintainer
https://github.com/tukaani-project/xz/pull/32#issuecomment-1424531920

I doubt the work is "complete" but it's a starting point.

-- 
> Michael Eager
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-03 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 13:55 MicroBlaze symver attribute support Vincent Fazio
2023-02-20 14:54 ` Joel Sherrill
2023-02-21  1:35   ` Michael Eager
2023-03-03 19:35     ` Vincent Fazio

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 read-only IMAP folder(s) and NNTP newsgroup(s).