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: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Feb 2018 12:23:12 +0100
- Subject: Re: Mising Patch #2 from the RISC-V v3 Submission
- Authentication-results: sourceware.org; auth=none
- References: <20170205183824.13727-1-palmer@dabbelt.com> <20170206185341.13798-1-palmer@dabbelt.com> <CANs6eMnF1H=p9Offfy=AkQu_NkOxSvYXogGe5WEew2SqLXAedg@mail.gmail.com>
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?
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."