Re: ld.so: -fno-builtin?

2016-12-23 Thread Philip Guenther
On Fri, Dec 23, 2016 at 12:11 PM, Joerg Sonnenberger wrote: > On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote: >> This is a form we use inside _libc_ so that calls to those functions >> generated by gcc will be redirected to aliases with hidden visibility >> and thus

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote: > This is a form we use inside _libc_ so that calls to those functions > generated by gcc will be redirected to aliases with hidden visibility > and thus be local calls, without using the PLT. If that won't work > with clang, then

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 06:43:42PM +0100, Mark Kettenis wrote: > > Date: Fri, 23 Dec 2016 18:13:45 +0100 > > From: Joerg Sonnenberger > > > > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > > I'm assuming clang handles asm names like gcc, such that declaring >

Re: ld.so: -fno-builtin?

2016-12-23 Thread Philip Guenther
On Fri, Dec 23, 2016 at 9:13 AM, Joerg Sonnenberger wrote: > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: >> I'm assuming clang handles asm names like gcc, such that declaring >>void *memcpy(void *__restrict, const void *__restrict, __size_t) >> __dso_hidden

Re: ld.so: -fno-builtin?

2016-12-23 Thread Theo de Raadt
> On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > I'm assuming clang handles asm names like gcc, such that declaring > >void *memcpy(void *__restrict, const void *__restrict, __size_t) > > __dso_hidden __asm("_dl_memcpy"); > > > > will make even internally generated

Re: ld.so: -fno-builtin?

2016-12-23 Thread Mark Kettenis
> Date: Fri, 23 Dec 2016 18:13:45 +0100 > From: Joerg Sonnenberger > > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > I'm assuming clang handles asm names like gcc, such that declaring > >void *memcpy(void *__restrict, const void *__restrict, __size_t) >

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > I'm assuming clang handles asm names like gcc, such that declaring >void *memcpy(void *__restrict, const void *__restrict, __size_t) > __dso_hidden __asm("_dl_memcpy"); > > will make even internally generated calls go to

Re: ld.so: -fno-builtin?

2016-12-22 Thread Philip Guenther
On Thu, Dec 22, 2016 at 12:33 PM, Joerg Sonnenberger wrote: > On Thu, Dec 22, 2016 at 05:47:05PM +0100, Christian Weisgerber wrote: >> Building ld.so with clang on amd64 fails with undefined references >> to memset and memcpy. That is odd, since neither function appears >> in the

Re: ld.so: -fno-builtin?

2016-12-22 Thread Joerg Sonnenberger
On Thu, Dec 22, 2016 at 05:47:05PM +0100, Christian Weisgerber wrote: > Building ld.so with clang on amd64 fails with undefined references > to memset and memcpy. That is odd, since neither function appears > in the source. Apparently clang optimizes the _dl_memset and > _dl_bcopy functions into

ld.so: -fno-builtin?

2016-12-22 Thread Christian Weisgerber
Building ld.so with clang on amd64 fails with undefined references to memset and memcpy. That is odd, since neither function appears in the source. Apparently clang optimizes the _dl_memset and _dl_bcopy functions into calls to memset and memcpy, respectively. I tentatively propose to add