Re: [RFC PATCH 03/23] Allow glibc to be compiled without EXEC_PAGESIZE

2024-04-10 Thread Florian Weimer
* Sergey Bugaev: > We could define EXEC_PAGESIZE to some conservative value on > aarch64-gnu too, if it turns out that this little workaround is really > required. But it seems cleaner to make sure we don't need to, as > Roland's email suggests, and introducing a new port that doesn't have > a fix

Re: [RFC PATCH 03/23] Allow glibc to be compiled without EXEC_PAGESIZE

2024-03-25 Thread Florian Weimer
* Florian Weimer: > * Sergey Bugaev: > >> diff --git a/elf/dl-support.c b/elf/dl-support.c >> index 2f502c8b..6375dc95 100644 >> --- a/elf/dl-support.c >> +++ b/elf/dl-support.c >> @@ -135,7 +135,11 @@ void *_dl_random; >> #include >> #inclu

Re: [RFC PATCH 03/23] Allow glibc to be compiled without EXEC_PAGESIZE

2024-03-11 Thread Florian Weimer
* Sergey Bugaev: > diff --git a/elf/dl-support.c b/elf/dl-support.c > index 2f502c8b..6375dc95 100644 > --- a/elf/dl-support.c > +++ b/elf/dl-support.c > @@ -135,7 +135,11 @@ void *_dl_random; > #include > #include > > -size_t _dl_pagesize = EXEC_PAGESIZE; > +size_t _dl_pagesize > +#ifdef EX

Re: [RFC PATCH 00/23] aarch64-gnu port

2024-03-11 Thread Florian Weimer
* Joseph Myers: > On Wed, 3 Jan 2024, Sergey Bugaev wrote: > >> To build this, you need an aarch64-gnu toolchain (binutils, GCC, MIG), >> and GNU Mach headers for AArch64. I have posted the patches for >> binutils, GCC, and GNU Mach to the bug-hurd mailing list; no patches >> are required to build

Re: [hurd,commited] hurd: Make error_t an int in C++

2023-08-08 Thread Florian Weimer
* Samuel Thibault via Libc-alpha: > Hello, > > Florian Weimer, le mar. 08 août 2023 16:14:07 +0200, a ecrit: >> > +#ifdef __cplusplus >> > +/* Unfortunately, in C++ int and enum __error_t_codes are not >> > + interoperable... */ >> > +typede

Re: Is Hurd sigprocmask per thread or per process?

2023-07-03 Thread Florian Weimer
* Samuel Thibault: > Florian Weimer, le lun. 03 juil. 2023 16:41:37 +0200, a ecrit: >> It's per-thread on Linux. > >> If it's per-process on Hurd, > > It happens to be per-thread. Great, then it should be an easy change to move pthread_sigmask into libc. 8-)

Is Hurd sigprocmask per thread or per process?

2023-07-03 Thread Florian Weimer
It's per-thread on Linux. If it's per-process on Hurd, it makes sense to explain the difference in the glibc manual. (I'm running into issues porting a test to Hurd because it calls pthread_sigmask; it seems wasteful to link with $(shared-thread-library) in the Makefile.) Thanks, Florian

Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate

2023-06-05 Thread Florian Weimer
* Sergey Bugaev: > * getpt, openpty: Opening an unused pty, which can't be our ctty Please add this as a comment to the open operation. > * shm_open, sem_open: These don't work with ttys > * opendir: Directories are unlikely to be ttys I scrolled through the patch, and it seems to me that all t

Re: [RFC PATCH 1/2] elf: Port ldconfig away from stack-allocated paths

2023-05-25 Thread Florian Weimer
dir_name, direntry->d_name) < 0) > + error (EXIT_FAILURE, errno, _("Could not form library path")); > } > + else > + real_file_name = file_name; Maybe use xstrdup (file_name) here and free unconditionally below? It makes it easier to analyze the code for use-after-free errors. Rest looks okay. Reviewed-by: Florian Weimer Thanks, Florian

Re: [RFC PATCH 0/2] On ldconfig and ld.so.cache

2023-05-19 Thread Florian Weimer
* Sergey Bugaev via Libc-alpha: > Moreover, Debian GNU/Hurd, the primary Hurd-based distribution, has been > shipping ld.so.cache on Hurd as a downstream patch [1] (note that more > changes would be required for x86_64-gnu because of FLAG_X8664_LIB64). > They don't really have a choice, it seems:

Re: [RFC PATCH 1/2] elf: Port ldconfig away from stack-allocated paths

2023-05-19 Thread Florian Weimer
* Sergey Bugaev via Libc-alpha: > @@ -733,25 +723,11 @@ search_dir (const struct dir_entry *entry) >+ 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0) > continue; > } > - len += strlen (entry->path) + 2; > - if (len > file_name_len) > - { >

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-19 Thread Florian Weimer
* Sergey Bugaev: > On Thu, May 18, 2023 at 11:16 PM Joseph Myers wrote: >> Strictly there are two separate issues: (a) calling an exported symbol >> should be done via a hidden alias, to avoid going via the PLT, and (b) >> functions in a standard namespace should not call names in the user's >> n

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: > Do user programs in practice rely on the fact that pthread > cancellation does unwinding and so calls object destructors, runs > @finally clauses, etc? I think so, yes. I don't recall introducing a regression in that part of cancellation, so we don't have good usage data unfor

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: >> If you need async cancellation support, the core cancellation routine >> could be made weak, so that it is linked into the executable only if >> pthread_cancel is ever called. > > Could you please expand on how this all (unwinding, async > cancellation) is relevant? Clearly cal

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Samuel Thibault: > Florian Weimer, le jeu. 11 mai 2023 19:44:42 +0200, a ecrit: >> * Sergey Bugaev: >> > Clearly __pthread_setcancelstate has been pragma weak'd, and used here >> > without a check. This is a statically linked x86_64-gnu (so, Hurd

Re: __pthread_setcancelstate called unconditionally, crashes at 0

2023-05-11 Thread Florian Weimer
* Sergey Bugaev: > Clearly __pthread_setcancelstate has been pragma weak'd, and used here > without a check. This is a statically linked x86_64-gnu (so, Hurd and > HTL) executable. Commit 93d78ec1cba68184931b75bef29afd3aed30f43a > "nptl: Move pthread_setcancelstate into libc" seems to be the culpr

Re: [PATCH v2] hurd: Add expected abilist files for x86_64

2023-03-19 Thread Florian Weimer
* Sergey Bugaev: > On Sun, Mar 19, 2023 at 9:05 PM Florian Weimer wrote: >> You should consider creating a shlib-versions file with a baseline of >> 2.38, so that the obsolete Sun RPC symbols (and many others) are not >> compiled in. > > So *that's* how it'

Re: [RFC PATCH glibc 34/34] hurd: Add expected abilist files for x86_64

2023-03-19 Thread Florian Weimer
* Sergey Bugaev via Libc-alpha: > +GLIBC_2.2.6 __rpc_thread_createerr F > +GLIBC_2.2.6 __rpc_thread_svc_fdset F > +GLIBC_2.2.6 __rpc_thread_svc_max_pollfd F > +GLIBC_2.2.6 __rpc_thread_svc_pollfd F You should consider creating a shlib-versions file with a baseline of 2.38, so that the obsolete Su

Re: [RFC PATCH glibc 11/12] hurd, htl: Add some x86_64-specific code

2023-02-12 Thread Florian Weimer
* Samuel Thibault: > Florian Weimer, le dim. 12 févr. 2023 17:40:58 +0100, a ecrit: >> * Samuel Thibault via Libc-alpha: >> >> > Sergey Bugaev, le dim. 12 févr. 2023 19:25:11 +0300, a ecrit: >> >> On Sun, Feb 12, 2023 at 7:11 PM Samuel Thibault >> &

Re: [RFC PATCH glibc 11/12] hurd, htl: Add some x86_64-specific code

2023-02-12 Thread Florian Weimer
* Samuel Thibault via Libc-alpha: > Sergey Bugaev, le dim. 12 févr. 2023 19:25:11 +0300, a ecrit: >> On Sun, Feb 12, 2023 at 7:11 PM Samuel Thibault >> wrote: >> > Sergey Bugaev, le dim. 12 févr. 2023 14:10:42 +0300, a ecrit: >> > > We should not need a getter routine, because one can simply ins

Re: [hurd, commited] hurd: Use __trivfs_server_name instead of trivfs_server_name

2022-01-01 Thread Florian Weimer
* Samuel Thibault: > Florian Weimer, le sam. 01 janv. 2022 19:48:21 +0100, a ecrit: >> * Samuel Thibault via Libc-alpha: >> >> > + if (&__trivfs_server_name && __trivfs_server_name >> >> > + && __trivfs_server_nam

Re: [hurd, commited] hurd: Use __trivfs_server_name instead of trivfs_server_name

2022-01-01 Thread Florian Weimer
* Samuel Thibault via Libc-alpha: > Florian Weimer, le sam. 01 janv. 2022 18:27:49 +0100, a ecrit: >> > @@ -33,14 +33,14 @@ __getrandom (void *buffer, size_t length, unsigned int >> > flags) >> >size_t amount_read; >> >int fd; >> > >&

Re: [hurd, commited] hurd: Make getrandom a stub inside the random translator

2021-12-31 Thread Florian Weimer
* Samuel Thibault via Libc-alpha: > Joseph Myers, le ven. 31 déc. 2021 20:24:02 +, a ecrit: >> On Fri, 31 Dec 2021, Samuel Thibault wrote: >> >> > +extern char *trivfs_server_name __attribute__((weak)); >> >> This looks like it has caused many linknamespace test failures, of the >> form: >>

Re: [PATCH htl v3 5/5] testrun.sh: Add support for --tool=rpctrace

2021-09-08 Thread Florian Weimer
* Sergey Bugaev: > rpctrace(1) is a Hurd RPC tracer tool, which is used similar to how > strace(1) is used on GNU/Linux. > > Signed-off-by: Sergey Bugaev > --- > Makefile | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index f98d5a9e67..a49

Re: [RFC PATCH htl v2 0/4] Rewrite THREAD_GSCOPE

2021-08-30 Thread Florian Weimer
* Sergey Bugaev: > I can think of two ways this can be handled: > > * Code can be rewritten and reorganized to use port-specific files instead of > conditional compilation. From looking at how glibc source is organized, this > appears to be the generally preferred way. I'm sending one more pat

Re: THREAD_GETMEM support for Hurd in glibc

2020-02-15 Thread Florian Weimer
* Samuel Thibault: > Hello, > > Florian Weimer, le sam. 15 févr. 2020 11:11:02 +0100, a ecrit: >> Is there a way to add fields to the thread descriptor on Hurd? > > Sure! > >> With NPTL, we have THREAD_GETMEM and THREAD_SETMEM to access >> thread-local varia

THREAD_GETMEM support for Hurd in glibc

2020-02-15 Thread Florian Weimer
Is there a way to add fields to the thread descriptor on Hurd? With NPTL, we have THREAD_GETMEM and THREAD_SETMEM to access thread-local variables without relying on the platform TLS implementation. I want to use this for thread-local data in the dynamic loader, specifically for the exception han

Re: /proc/self/fd support on Hurd

2020-02-11 Thread Florian Weimer
* Samuel Thibault: > Samuel Thibault, le mar. 11 févr. 2020 05:47:30 -0800, a ecrit: >> Florian Weimer, le mar. 11 févr. 2020 14:39:23 +0100, a ecrit: >> > Does Hurd support /proc/self/fd, in the sense that the POSIX functions >> > in glibc (such as openat) can deal

/proc/self/fd support on Hurd

2020-02-11 Thread Florian Weimer
Does Hurd support /proc/self/fd, in the sense that the POSIX functions in glibc (such as openat) can deal with such paths? Thanks, Florian

Re: [hurd,commited] hurd sendmsg: Fix warning on calling CMSG_*HDR

2019-12-29 Thread Florian Weimer
* Andreas Schwab: > On Dez 29 2019, Samuel Thibault wrote: > >> diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c >> index 0c19b3223c..3d7317cec4 100644 >> --- a/sysdeps/mach/hurd/sendmsg.c >> +++ b/sysdeps/mach/hurd/sendmsg.c >> @@ -108,7 +108,7 @@ __libc_sendmsg (int fd, con

Re: Upstreaming the glibc Hurd port

2018-04-05 Thread Florian Weimer
On 04/03/2018 11:58 PM, Samuel Thibault wrote: Joseph Myers, on mar. 03 avril 2018 21:48:32 +, wrote: The build for i686-gnu also fails using GCC 6 branch with build-many-glibcs.py: hurdsig.c: In function 'interrupted_reply_port_location.isra.1': hurdsig.c:250:39: error: 'portloc' may be us

Re: Upstreaming the glibc Hurd port

2018-04-02 Thread Florian Weimer
On 04/02/2018 02:10 AM, Samuel Thibault wrote: - elf/check-execstack: We have nested functions which make the stack executable indeed. I looked at the Hurd situation last month. Hurd is always read-implies-exec, I think. So there is no need to make the stacks executable, it does not have

Re: Upstreaming the glibc Hurd port

2018-01-18 Thread Florian Weimer
On 01/18/2018 01:45 PM, Samuel Thibault wrote: Florian Weimer, on jeu. 18 janv. 2018 13:39:51 +0100, wrote: Is it just a matter of someone doing the work of upstreaming all the existing patches? It's mostly that, yes. Good to know, thanks. The question is how we can do this incremen