This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: atomic update of profile counters (issue7000044)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Rong Xu <xur at google dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, Richard Henderson <rth at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Xinliang David Li <davidxl at google dot com>, Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, <reply at codereview dot appspotmail dot com>
- Date: Wed, 20 Nov 2013 21:04:32 +0000
- Subject: Re: atomic update of profile counters (issue7000044)
- Authentication-results: sourceware.org; auth=none
- References: <20121221064539 dot 0E1A7100704 at rong dot mtv dot corp dot google dot com> <20121221092532 dot GA7055 at kam dot mff dot cuni dot cz> <CAF1bQ=R7pXzBq08E7PiXKwahpM8Lx0gergnXvGtr6wk+M8-nKA at mail dot gmail dot com> <CAF1bQ=Qs8uSHmPp01vwYm-vU4XD+wYrB4cEAcAib8i7LDAS3og at mail dot gmail dot com> <CAAkRFZKPOUdHdF2XZDYkncj8=Z_yg2OosmxN6hyZ=877sqoVxg at mail dot gmail dot com> <CAF1bQ=QE0UPcWzG8U150E8cMK4WrcXwiNBgdeDgZPhV5KUx9wA at mail dot gmail dot com> <CA+=Sn1kK-Ld-K7YBAy1rVTrkBaXhduRH6zE4LA379QTgiY-1wA at mail dot gmail dot com> <CAFiYyc33X_tX6csqC880dVYm=AM51PQ3uZX4Bx+7wi0V1UP6Bg at mail dot gmail dot com> <CAF1bQ=R-5ipC+8+MAqsOpyMJ9DQ2X6fw-S3Z0sMKnQ6B9Zz3XQ at mail dot gmail dot com> <50EB31B7 dot 9090307 at redhat dot com> <CAF1bQ=Svz7rJFrWG6-mBHMFbPef9B_Ls=2bCsahZzHK48+JjBg at mail dot gmail dot com> <CAF1bQ=SunHvCyYjN7k-qcqi7C65kRxp=9RE56EsjzAvJRZYe9w at mail dot gmail dot com> <CA+=Sn1kRScfyveEB4KFd60c+fz+t81xJQ8bA4_o=UrWfs6cLFg at mail dot gmail dot com> <CAF1bQ=R_qgrDHRyOKNr0eaN9BFOWku4bR6tFJeSRz6hoSCrjqQ at mail dot gmail dot com>
On Wed, 20 Nov 2013, Rong Xu wrote:
> I could do this in the SPEC
> -Wl,-Bstatic -latomic -Wl,-Bdynamic
> which would link libatomic statically.
> I works for me. But it looks a little weird in gcc driver.
I think we should generally link libatomic with --as-needed by default on
platforms supporting --as-needed, in line with the general principle that
C code just using language not library facilities (_Atomic in this case)
shouldn't need any special options to link it (libatomic is like libgcc,
which is linked in automatically); the trickier question is what to do
with it on any systems supporting shared libraries but not --as-needed.
--
Joseph S. Myers
joseph@codesourcery.com