This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] RISC-V: Fix elfutils testsuite unwind failures.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jim Wilson <jimw at sifive dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 14 Jan 2019 14:38:15 +0100
- Subject: Re: [PATCH] RISC-V: Fix elfutils testsuite unwind failures.
- References: <20190113234809.4818-1-jimw@sifive.com>
* Jim Wilson:
> -int
> -main (void)
> +static void *
> +func (void *a)
> {
> /* Arrange for this test to be killed if _Unwind_Backtrace runs into an
> endless loop. We cannot use the test driver because the complete
> call chain needs to be compiled with -funwind-tables so that
> - _Unwind_Backtrace is able to reach _start. */
> + _Unwind_Backtrace is able to reach the start routine. */
> alarm (DEFAULT_TIMEOUT);
> _Unwind_Backtrace (callback, 0);
> + return a;
> +}
> +
> +int
> +main (void)
> +{
> +#if USE_PTHREADS
> + pthread_t thr;
> + int rc = pthread_create (&thr, NULL, &func, NULL);
> + if (rc)
> + error (1, rc, "pthread_create");
> + rc = pthread_join (thr, NULL);
> + if (rc)
> + error (1, rc, "pthread_join");
> +#else
> + func (NULL);
> +#endif
Do you expect func to be inlined, to preserve the pattern of the
original test?
I wonder if it is preferable to have separate, new file for this.
Thanks,
Florian