Re: [RFC] builtin functions and `-ffreestanding -nostartfies` with static binaries

2020-01-11 Thread Siddhesh Poyarekar
On 11/01/20 6:55 pm, Segher Boessenkool wrote: > -ffreestanding means you might not have any of the C standard library, > and -nostartfiles means you do not do any of the standard initialisation. > Why then would you expect any ifunc to work? > Agreed, based on Alexander's feedback I have suggest

Re: [RFC] builtin functions and `-ffreestanding -nostartfies` with static binaries

2020-01-11 Thread Segher Boessenkool
Hi! On Fri, Jan 10, 2020 at 09:50:48PM +0530, Siddhesh Poyarekar wrote: > Statically built independent programs that implement their own program > entry points (i.e. -ffreestanding -nostartfiles) and call __builtin_* > functions break when the builtin function in question is implemented as > an IF

Re: [RFC] builtin functions and `-ffreestanding -nostartfies` with static binaries

2020-01-10 Thread Siddhesh Poyarekar
On 10/01/20 10:25 pm, Alexander Monakov wrote: > On Fri, 10 Jan 2020, Siddhesh Poyarekar wrote: > >> I spent some time thinking about this and while it's trivial to fix by >> disabling ifuncs for static glibc, I wanted a solution that wasn't such >> a big hammer. The other alternative I could thi

Re: [RFC] builtin functions and `-ffreestanding -nostartfies` with static binaries

2020-01-10 Thread Alexander Monakov
On Fri, 10 Jan 2020, Siddhesh Poyarekar wrote: > I spent some time thinking about this and while it's trivial to fix by > disabling ifuncs for static glibc, I wanted a solution that wasn't such > a big hammer. The other alternative I could think of is to have an > exported alias (called __builtin

[RFC] builtin functions and `-ffreestanding -nostartfies` with static binaries

2020-01-10 Thread Siddhesh Poyarekar
Hello, Ref: https://bugs.linaro.org/show_bug.cgi?id=5479 Statically built independent programs that implement their own program entry points (i.e. -ffreestanding -nostartfiles) and call __builtin_* functions break when the builtin function in question is implemented as an IFUNC in glibc and the b