Bug 17480 - Failed to create shared library on Windows with __attribute__((__dllexport__, weak))
Summary: Failed to create shared library on Windows with __attribute__((__dllexport__,...
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-13 17:25 UTC by Antony Polukhin
Modified: 2014-10-13 17:25 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antony Polukhin 2014-10-13 17:25:17 UTC
Compiling the following 1 line program:

    __attribute__((__dllexport__, weak)) void* p = 0;

with the following command:

    g++ -shared ld_test.c -LD:\mingw64\lib

produces error:

    Cannot export p: symbol wrong type (2 vs 3)
    collect2.exe: error: ld returned 1 exit status


Mixing same attributes on Windows+MSVC and Clang+Linux, GCC+Linux work well.