This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: Don't set GLRO(dl_platform) to NULL [BZ #22299]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 13 Dec 2017 04:06:28 -0800
- Subject: Re: [PATCH] x86-64: Don't set GLRO(dl_platform) to NULL [BZ #22299]
- Authentication-results: sourceware.org; auth=none
- References: <20171017154436.GA29035@gmail.com> <460065513.644164.1508256542062@mail.yahoo.com> <CAMe9rOo4e3i76K3OzSBLWnAJPBYL-i8cBqyaKXVizShHE721JQ@mail.gmail.com> <1616746650.107335.1508308101304@mail.yahoo.com> <CAMe9rOoLJGwUCnkCzSp9T0YVbaVy1BrDzu+fQ4LY+uNLr0+XYw@mail.gmail.com> <210199060.225015.1508419635063@mail.yahoo.com> <CAMe9rOoES-UP4uMBKFoxbFpTftFAnzDCRzY0V9GswDfE4t9b=Q@mail.gmail.com> <8b475ef3-ae8d-b731-3bc3-923aee864e1a@redhat.com> <CAMe9rOpa28W-SdYM7KTquq2Szn3eFW+OSp2F5wOMi2L60=KOvw@mail.gmail.com> <20171213084849.GA24639@aurel32.net>
On Wed, Dec 13, 2017 at 12:48 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> [ Sorry to come back so late about this commit ]
>
> On 2017-10-19 08:27, H.J. Lu wrote:
>> On Thu, Oct 19, 2017 at 7:51 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>
>> >> +ifneq (no,$(have-tunables))
>> >> +tests += tst-platform-1
>> >> +modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
>> >> +CFLAGS-tst-platform-1.c = -mno-avx
>> >> +CFLAGS-tst-platformmod-1.c = -mno-avx
>> >> +CFLAGS-tst-platformmod-2.c = -mno-avx
>> >> +LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
>> >> +$(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
>> >> +$(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
>> >> +# Turn off AVX512F_Usable and AVX2_Usable so that GLRO(dl_platform) is
>> >> +# always set to x86_64.
>> >> +tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so
>> >> \
>> >> + GLIBC_TUNABLES=glibc.tune.hwcaps=-AVX512F_Usable,-AVX2_Usable
>> >> +endif
>> >
>> >
>> > Does this build $(objpfx)/tst-platformmod-2.so? I think this would
>>
>> No. x86_64/tst-platformmod-2, not tst-platformmod-2, is added to
>> modules-names.
>>
>> [hjl@gnu-6 build-x86_64-linux]$ find -name tst-platformmod-2.so
>> ./elf/x86_64/tst-platformmod-2.so
>> [hjl@gnu-6 build-x86_64-linux]$
>
> This assumes that the platform for sysdeps/x86_64 is always "x86_64".
> This is actually wrong for x32 for where it is set to i686. This causes
> the test to fail on x32.
>
It is wrong for kernel to set AT_PLATFORM to i686. Should we fix it
in glibc or in kernel?
--
H.J.