[RFC PATCH glibc 13/34] x86-64: Disable prefer_map_32bit_exec tunable on non-Linux

H.J. Lu hjl.tools@gmail.com
Mon Apr 3 19:02:12 GMT 2023


On Mon, Apr 3, 2023 at 3:10 AM Sergey Bugaev <bugaevc@gmail.com> wrote:
>
> On Mon, Apr 3, 2023 at 2:09 AM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > Sergey Bugaev, le dim. 19 mars 2023 18:09:56 +0300, a ecrit:
> > > While we could/should implement MAP_32BIT for the Hurd port by setting
> > > all the high bits of mask in a vm_map () call, neither MAP_32BIT nor
> > > glibc.cpu.prefer_map_32bit_exec exist on the Hurd as of now. Compile
> > > this code out to fix build failures.
> >
> > Rather use defined(MAP_32BIT)? That way it will nicely work for BSD
> > ports as well, and when hurd eventually supports MAP_32BIT.
>
> Not really. What breaks compilation here is not missing MAP_32BIT, but
> rather the undefined set_prefer_map_32bit_exec tunable. It is defined
> declaratively in sysdeps/unix/sysv/linux/x86_64/64/dl-tunables.list
> (see commit 317f1c0a8a71a862b1e600ff5386b08e02cf4b95); so as-is, it
> really is x86_64 Linux specific.
>
> Is there some way to check if a specific tunable is defined, like #if
> HAVE_TUNABLE (prefer_map_32bit_exec)? AFAICS the generated
> dl-tunable-list.h defines the C enum members, but not any checkable
> preprocessor macros.
>
> Alternatively: maybe this part of cpu-features.c should be moved into
> sysdeps/unix/sysv/linux/x86_64/64/cpu-features.c and #include_next the
> common cpu-features.c?
>

Or something like this.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-64-Make-glibc.cpu.prefer_map_32bit_exec-Linux-sp.patch
Type: text/x-patch
Size: 4378 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20230403/2e3de247/attachment.bin>


More information about the Libc-alpha mailing list