This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb/testsuite/gdb.threads: Make sure TLS tests link against pthreads.
- From: Will Newton <will dot newton at linaro dot org>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Wed, 12 Jun 2013 10:54:10 +0100
- Subject: Re: [PATCH] gdb/testsuite/gdb.threads: Make sure TLS tests link against pthreads.
- References: <51B22910 dot 7010208 at linaro dot org> <CA+=Sn1=K2QkVFW0J7=_dimQ57GgeP44AmrNYqakNDDybL83-Sg at mail dot gmail dot com>
On 12 June 2013 00:02, Andrew Pinski <pinskia@gmail.com> wrote:
> On Fri, Jun 7, 2013 at 11:40 AM, Will Newton <will.newton@linaro.org> wrote:
>>
>> On Ubuntu the compiler passes --as-needed to the linker which means
>> no DT_NEEDED entry is added for libpthread when building the TLS
>> tests. This causes the test to fail as a libpthread is required to
>> look up TLS variables. Add some calls to pthread functions to make
>> sure libpthread is linked.
>
>
> I think this should be an debian/Ubuntu local only patch as the
> default for FSF GCC/binutils is not to pass --as-needed.
I admit the change is a little, erm, weird, but my hope was to avoid
causing pain to people who build gdb on Ubuntu. This isn't just Ubunto
or Debian developers but Ubuntu or Debian users that happen to have
downloaded a gdb tarball from gnu.org. Similar test failures in
binutils have been worked around by adding -Wl,--no-as-needed which we
could also do here, but I was concerned that this may break non-gcc
compilers.
--
Will Newton
Toolchain Working Group, Linaro