Re: [PATCH 04/12] tools/nolibc: use attribute((naked)) if available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 03, 2024 at 08:28:08PM +0200, Thomas Weißschuh  wrote:
> > I think that it can resolve to roughly this:
> >
> > #if defined(__has_attribute) && __has_attribute(naked)
> > #  define __entrypoint __attribute__((naked))
> > #  define __entrypoint_epilogue()
> > #else
> > #  define __entrypoint __attribute__((optimize("Os", "omit-frame-pointer")))
> > #  define __entrypoint_epilogue() __builtin_unreachable()
> > #endif
> 
> We would need to duplicate the define for the
> !defined(__has_attribute) case.

I don't understand why. Above both are tested on the first line.
Am I missing something ?

> I wanted to avoid that duplication.
> > What do you think ?
> 
> With the reasoning above I'll let you choose.

I'm fine with avoiding duplication, I just don't understand why there
should be.

Willy




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux