Peter,
Yeah, I was surprised not to see other targets encountering this problem.
However, I don't understand how something under #ifdef TARGET_HEXAGON can break
anything else.
Could you point me to the patch set you mention?
One generic solution I can think of is to reference a target-defined macro in
linux-user/signal.c and let targets optionally define it in their
target_signal.h. So, it would look something like this
> @@ -72,6 +72,14 @@ static uint8_t host_to_target_signal_table[_NSIG] = {
> over a single host signal. */
> [__SIGRTMIN] = __SIGRTMAX,
> [__SIGRTMAX] = __SIGRTMIN,
> +#ifdef TARGET_SIGNAL_TABLE_MODIFY
> + TARGET_SIGNAL_TABLE_MODIFY
Thanks,
Taylor
-----Original Message-----
From: Peter Maydell <[email protected]>
Sent: Tuesday, November 19, 2019 1:31 PM
To: Taylor Simpson <[email protected]>
Cc: Riku Voipio <[email protected]>; Laurent Vivier <[email protected]>; QEMU
Developers <[email protected]>
Subject: Re: [PATCH] Hexagon: Swap SIGRGMAX-1 and SIGRTMIN+1
On Tue, 19 Nov 2019 at 19:07, Taylor Simpson <[email protected]> wrote:
>
> Signed-off-by: Taylor Simpson <[email protected]>
> ---
> linux-user/signal.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c index
> 5ca6d62..ce3d27f 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -72,6 +72,14 @@ static uint8_t host_to_target_signal_table[_NSIG] = {
> over a single host signal. */
> [__SIGRTMIN] = __SIGRTMAX,
> [__SIGRTMAX] = __SIGRTMIN,
> +#ifdef TARGET_HEXAGON
> + /*
> + * Hexagon uses the same signal for pthread cancel as the host pthreads,
> + * so cannot be overridden.
> + * Therefore, we map Hexagon signal to a different host signal.
> + */
> + [__SIGRTMAX - 1] = __SIGRTMIN + 1, #endif
> };
This breaks other stuff, unfortunately, like Go binaries.
(Also, you now have two host signals mapped to the same target signal; notice
that the existing RTMAX/RTMIN is a swap of the two slots.)
We need a generic solution for this, Hexagon is not the only one with the
problem. There's a patchset on list from ages back that had a suggested
approach, but it needed review and work.
thanks
-- PMM