stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] STDCXX-507 (or using __declspec(dllexport/dllimport on gcc/cygwin in shared builds)
Date Fri, 07 Dec 2007 18:55:55 GMT
Farid Zaripov wrote:
>   Today I've verified the patch for STDCXX-507 on gcc 4.2.0 and gcc
> 3.4.4.

I get really nervous whenever we start to mess around with the runtime
symbols, especially when changing which ones are exported on Windows
and which ones aren't. Doesn't exporting just members and not the
whole class have an impact on things like RTTI and exceptions?

Have you tested it with the other Windows compilers (Intel C++ and
MSVC)?

Also, I'm more than a little uncomfortable with hardcoding __CYGWIN__
all over the place. Isn't there a single file where we could tweak
_RWSTD_NO_XXX_DEFAULT_CTOR et al macros?

Finally, did you consider STDCXX-408 when enabling dllexport?

Travis, as the other Windows expert, can you take a look at Farid's
patch and let us know what you think?

Thanks!
Martin

> 
>   The patch is here:
> https://issues.apache.org/jira/secure/attachment/12371246/cygwin.patch
> 
> ChangeLog:
> 
>   STDCXX-507
>   * include/rw/_defs.h [__CYGWIN__ && _RWSHARED]: #define _RWSTD_EXPORT
> macro
> using __declspec (dllexport) directiive.
>   * include/typeinfo (bad_cast): Don't declare class as _RWSTD_EXPORT.
>   Declare as _RWSTD_EXPORT the only members, that doesn't already
> present in libc.
>   (bad_typeid): Ditto.
>   * include/exception (exception): Ditto.
>    (bad_exception): Ditto.
>   (set_unexpected): Ditto.
>   (unexpected): Ditto.
>   (set_terminate): Ditto.
>   (terminate): Ditto.
>   (uncaught_exception): Ditto.
>   * include/new (bad_alloc): Ditto.
>   * etc/config/gcc.config [CYGWIN] (SHARED_CPPFLAGS): #define _RWSHARED
> for shared builds.
>   (LDSOFLAGS): turn on exporting of the all symbols (this feature is
> disabled by default
>   due to using __declspec(dllexport)).
>   (LDFLAGS): Force ".exe" executable files extension. 
> 
>   Without using of the -export-all-symbols linker option the some
> examples and
> tests are failed to link due to "undefined reference to the [typeinfo
> for ...]".
> Where ... is std::istream, std::ostream, std::wistream, std::wostream,
> ...
> I don't know why these typeinfo's are not exported and how to explicitly
> export
> them. Also the __rw_atomic_addxx() and __rw_atomic_xcghxx() functions
> are not
> exported because they are defined in assembly file (the gcc and ld
> doesn't have
> the feature like #pragma comment (linker, "/EXPORT=...") in MSVC). So
> the
> -export-all-symbols option is needed to deal with "undefined reference"
> errors.
> 
>   The -force-exe-suffix option is not related to the issue. It's just
> forces, that
> all executable names will end's with ".exe".
> 
> Farid.
> 


Mime
View raw message