This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
extern "C" for libstdc++ building
- From: Dan Schatzberg <dschatz at bu dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 12 Sep 2012 09:50:32 -0400
- Subject: extern "C" for libstdc++ building
Hi,
I am building a gcc toolchain targeted to my custom kernel. I've added
a thread model for my system to the build and provided a header for
the threading in libgcc/config
In this header I define the minimal necessary gthread functions. Most
of them call out to extern functions which I will then link in when
building a binary.
For example:
#ifdef __cplusplus
extern "C" {
#endif
extern int ebbos_gthread_active_p(void);
static inline int
__gthread_active_p(void)
{
return ebbos_gthread_active_p();
}
#ifdef __cplusplus
}
#endif
This builds fine, but libstdc++ has mangled symbol names for
ebbos_gthread_active_p while libgcc does not. What can I do to make it
so all the libraries are built with non mangled symbol names? I would
have thought the #ifdef __cplusplus would work, but I seem to be
mistaken.
---
Dan Schatzberg