This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Mising Patch #2 from the RISC-V v3 Submission
- From: Andreas Schwab <schwab at suse dot de>
- To: Palmer Dabbelt <palmer at dabbelt dot com>
- Cc: Jim Wilson <jimw at sifive dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Feb 2018 12:11:24 +0100
- Subject: Re: Mising Patch #2 from the RISC-V v3 Submission
- Authentication-results: sourceware.org; auth=none
- References: <mhng-1efd8ecc-a6ed-4ace-a1d3-d553e505b4f1@palmer-si-x1c4>
On Feb 15 2018, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> On Mon, 12 Feb 2018 15:18:39 PST (-0800), Jim Wilson wrote:
>> On 02/12/2018 03:23 AM, Andreas Schwab wrote:
>>> On Feb 06 2017, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>>>
>>>> +/* Because RISC-V only has word-sized atomics, it requries libatomic where
>>>> + others do not. So link libatomic by default, as needed. */
>>>> +#undef LIB_SPEC
>>>> +#ifdef LD_AS_NEEDED_OPTION
>>>> +#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
>>>> + " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
>>>> +#else
>>>> +#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
>>>> +#endif
>>>
>>> Why is -latomic added only with -pthread if --as-needed is supported,
>>> but unconditionally if not? Wouldn't it make sense to add it
>>> unconditionally in both cases?
>>
>> I don't know the history here, but I do know that the most common atomic
>> related bug report we get is for people using pthread, so we were
>> probably thinking about that when this was written.
>
> IIRC that's why it's done this way.
There needs to be some standard way to find -latomic during build, a
couple of libgo configure tests fail because they do not find it.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."