diff mbox

[patch/libstdc++-v3] export long double versions of "C" math library on more platforms

Message ID 4C13689C.5090608@ubuntu.com
State New
Headers show

Commit Message

Matthias Klose June 12, 2010, 10:59 a.m. UTC
When libstdc++-v3 is built on a system running glibc-2.11 or newer, a 
libstdc++.so.6 is built not exporting anymore the long double versions of "C" 
math library.  For hppa-linux this is already taken care of.  The missing 
symbols were observed on arm-linux-gnueabi and mips*-linux-gnu builds.  Joseph 
S. Myers mentioned on #gcc that more platforms which did export these in the 
past should export these as well.  It's not clear if the old ARM ABI should 
export these as well.  If the patch is accepted, it should go to the active 
branches as well.

   Matthias
2010-06-12  Matthias Klose  <doko@ubuntu.com>

        * src/compatibility.cc: Export long double versions of "C" math
        library for arm-linux-gnueabi, m68k-linux-gnu (ColdFire),
        mips*-linux-gnu (o32 ABI), sh*-linux-gnu (not 32 bit).

Comments

Paolo Carlini June 15, 2010, 9:03 p.m. UTC | #1
On 06/12/2010 12:59 PM, Matthias Klose wrote:
> When libstdc++-v3 is built on a system running glibc-2.11 or newer, a
> libstdc++.so.6 is built not exporting anymore the long double versions
> of "C" math library.  For hppa-linux this is already taken care of. 
> The missing symbols were observed on arm-linux-gnueabi and
> mips*-linux-gnu builds.  Joseph S. Myers mentioned on #gcc that more
> platforms which did export these in the past should export these as
> well.  It's not clear if the old ARM ABI should export these as well. 
> If the patch is accepted, it should go to the active branches as well.
Thus, do I understand correctly that Joseph is OK with the arm bits of
your patch? Which kind of practical evidence do we have about m68k,
mips, and sh? At least, I would ask the maintainers to have a look...
can you do that?

Thanks,
Paolo.
Paolo Carlini June 15, 2010, 9:04 p.m. UTC | #2
On 06/15/2010 11:03 PM, Paolo Carlini wrote:
> On 06/12/2010 12:59 PM, Matthias Klose wrote:
>   
>> When libstdc++-v3 is built on a system running glibc-2.11 or newer, a
>> libstdc++.so.6 is built not exporting anymore the long double versions
>> of "C" math library.  For hppa-linux this is already taken care of. 
>> The missing symbols were observed on arm-linux-gnueabi and
>> mips*-linux-gnu builds.  Joseph S. Myers mentioned on #gcc that more
>> platforms which did export these in the past should export these as
>> well.  It's not clear if the old ARM ABI should export these as well. 
>> If the patch is accepted, it should go to the active branches as well.
>>     
> Thus, do I understand correctly that Joseph is OK with the arm bits of
> your patch? Which kind of practical evidence do we have about m68k,
> mips, and sh? At least, I would ask the maintainers to have a look...
> can you do that?
>   
Sorry, thus mips should be also fine. We are missing a minimum of data
about m68k and sh.

Paolo.
Joseph Myers June 15, 2010, 10:45 p.m. UTC | #3
On Tue, 15 Jun 2010, Paolo Carlini wrote:

> On 06/12/2010 12:59 PM, Matthias Klose wrote:
> > When libstdc++-v3 is built on a system running glibc-2.11 or newer, a
> > libstdc++.so.6 is built not exporting anymore the long double versions
> > of "C" math library.  For hppa-linux this is already taken care of. 
> > The missing symbols were observed on arm-linux-gnueabi and
> > mips*-linux-gnu builds.  Joseph S. Myers mentioned on #gcc that more
> > platforms which did export these in the past should export these as
> > well.  It's not clear if the old ARM ABI should export these as well. 
> > If the patch is accepted, it should go to the active branches as well.
> Thus, do I understand correctly that Joseph is OK with the arm bits of
> your patch? Which kind of practical evidence do we have about m68k,
> mips, and sh? At least, I would ask the maintainers to have a look...
> can you do that?

The platforms in question - ARM EABI, MIPS o32, ColdFire, SH 32-bit - are 
the ones I listed on IRC as glibc platforms I know of where long double 
has the same representation as double.  I noted that I don't know whether 
this also applies to ARM old-ABI or SH64.  I don't see anything wrong with 
the preprocessor conditionals as representing the conditions I gave, 
although the ChangeLog reference to "not 32 bit" should be "32 bit" or 
"not 64 bit" (and as I said, I don't know whether that 32-bit restriction 
for SH is needed).
Paolo Carlini June 15, 2010, 10:55 p.m. UTC | #4
On 06/16/2010 12:45 AM, Joseph S. Myers wrote:
> The platforms in question - ARM EABI, MIPS o32, ColdFire, SH 32-bit - are
> the ones I listed on IRC as glibc platforms I know of where long double 
> has the same representation as double.  I noted that I don't know whether 
> this also applies to ARM old-ABI or SH64.  I don't see anything wrong with 
> the preprocessor conditionals as representing the conditions I gave, 
> although the ChangeLog reference to "not 32 bit" should be "32 bit" or 
> "not 64 bit" (and as I said, I don't know whether that 32-bit restriction 
> for SH is needed).
>   
Ok, the patch is OK with the small changes to the ChangeLog entry
indicated by Joseph.

Paolo.
Matthias Klose June 16, 2010, 6:13 a.m. UTC | #5
On 16.06.2010 00:55, Paolo Carlini wrote:
> On 06/16/2010 12:45 AM, Joseph S. Myers wrote:
>> The platforms in question - ARM EABI, MIPS o32, ColdFire, SH 32-bit - are
>> the ones I listed on IRC as glibc platforms I know of where long double
>> has the same representation as double.  I noted that I don't know whether
>> this also applies to ARM old-ABI or SH64.  I don't see anything wrong with
>> the preprocessor conditionals as representing the conditions I gave,
>> although the ChangeLog reference to "not 32 bit" should be "32 bit" or
>> "not 64 bit" (and as I said, I don't know whether that 32-bit restriction
>> for SH is needed).
>>
> Ok, the patch is OK with the small changes to the ChangeLog entry
> indicated by Joseph.

Checked in with the suggested ChangeLog change. Will apply it to the branches 
later this week.

   Matthias

         * src/compatibility.cc: Export long double versions of "C" math
         library for arm-linux-gnueabi, m68k-linux-gnu (ColdFire),
         mips*-linux-gnu (o32 ABI), sh*-linux-gnu (32 bit).
diff mbox

Patch

Index: libstdc++-v3/src/compatibility.cc
===================================================================
--- libstdc++-v3/src/compatibility.cc	(revision 160481)
+++ libstdc++-v3/src/compatibility.cc	(working copy)
@@ -410,7 +410,11 @@ 
 // gcc-4.1.0
 // Long double versions of "C" math functions. 
 #if defined (_GLIBCXX_LONG_DOUBLE_COMPAT) \
-    || (defined (__hppa__) && defined (__linux__))
+    || (defined (__arm__) && defined (__linux__) && defined (__ARM_EABI__)) \
+    || (defined (__hppa__) && defined (__linux__)) \
+    || (defined (__m68k__) && defined (__mcoldfire__) && defined (__linux__)) \
+    || (defined (__mips__) && defined (_ABIO32) && defined (__linux__)) \
+    || (defined (__sh__) && defined (__linux__) && __SIZEOF_SIZE_T__ == 4) \
 
 #define _GLIBCXX_MATHL_WRAPPER(name, argdecl, args, ver) \
 extern "C" double						\