Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Build C::B against wx3.02 with gcc 5.2 under Windows
ollydbg:
--- Quote from: ollydbg on October 17, 2015, 05:02:26 pm ---OK, now the patches(git style patch serials) are in Code::Blocks / Tickets / #239 reduce exported symbols from codeblocks.dll
I mainly do the following things in those patches:
1, only one pch file is used to build C::B.
2, some symbols in static libraries(such as some symbols in sqplus) are marked as "dllexport", and he symbols are exported in codeblocks.dll. So that all the src and plugin target only need to link against codeblocks.dll. No need to link to those static library(such as sqplus.a).
(Note that also build wxWidgets 3.0.2 library with the change of only export the dllexport maked symbol, which reduce the dll size, see build wxWidgets dll without __declspec(dllexport) for MinGW target - Google Groups for more details.
--- End quote ---
@Morten and other devs, I'm going to commit parts of the above serials, which only add the add DLLIMPORT or EVTIMPORT decorations to some symbols in our code base, this currently doesn't affect the build system, since we still export all symbols from the SDK dll. But this can make it much easier if we later only export the necessary symbols from the SDK dll.
Do you have any objections?
oBFusCATed:
--- Quote from: ollydbg on October 29, 2015, 02:50:11 pm ---Do you have any objections?
--- End quote ---
Can you wait couple of days, so I can find some time to test them?
MortenMacFly:
--- Quote from: oBFusCATed on October 29, 2015, 08:15:44 pm ---Can you wait couple of days, so I can find some time to test them?
--- End quote ---
I am not even able to test them due to the format, unfortunately...
oBFusCATed:
Morten: There you go https://github.com/obfuscated/codeblocks_sf/tree/ollydbg/visibility_hidden
I've tried to do similar work on enabling -fvisibility=hidden on linux. The patches can be found in this branch https://github.com/obfuscated/codeblocks_sf/tree/visibility_hidden Some of them are similar to yours.
ollydbg: These patches fail to compile on linux (I've fixed it in the branch). Also they do stuff that they should not.
Like:
1. The patch that changes the link to wx3-debug should not be pushed
2. Exporting functions/classes from tinyxml is wrong. Same for the other static libraries. Project needing the libs should link directly. Squirrel stuff was tricky, because of globals.
3. Why do you need the workaround commits? Just include the settings.h header?
ollydbg:
--- Quote from: oBFusCATed on October 30, 2015, 08:12:24 am ---ollydbg: These patches fail to compile on linux (I've fixed it in the branch). Also they do stuff that they should not.
Like:
1. The patch that changes the link to wx3-debug should not be pushed
--- End quote ---
Sure, I won't plan to push this commit to our svn repo. On my test, C::B crashes if it link to wx3 release library(build with g++ -O2) under Windows XP, so I have to use the debug version of wx3(build with g++ -O0).
--- Quote ---2. Exporting functions/classes from tinyxml is wrong. Same for the other static libraries. Project needing the libs should link directly. Squirrel stuff was tricky, because of globals.
--- End quote ---
Under Windows, all the static libraries are build with all symbol exported(Note this option is enabled by default), and later those symbols were exported through codeblocks.dll(the sdk target). That's the current way we have used for many years.
I have said that before in this thread. Those kinds of static libraries are quite similar as shared libraries. And you will see that all the plugins are only need to link the the codeblocks.dll, and they don't need static to link to tinyxml like libraries.
My change on those static libraries is that I use explicitly symbol export, which means all the symbols needed to export from the codeblocks.dll is need to be decorated as "__declspec(dllexport)", This reduce the export table of the codeblocks.dll, and make resolution of the symbols a bit faster.
--- Quote ---3. Why do you need the workaround commits? Just include the settings.h header?
--- End quote ---
The macro "WXEXPORT" is defined as empty in wxWidgets header, which make all the symbols were exported from wxWidgets shared dll. (This issue is solved by a recent commit in wx's trunk https://groups.google.com/d/msg/wx-users/BLeNygSYyx0/-57vTa3CAwAJ I have mentioned before.
The reason why I don't use settings.h is that it does not works OK, see below:
--- Code: ---#ifndef SETTINGS_H
#define SETTINGS_H
/*
Exclude VC++, because it has silly constraints on importing/exporting classes
from DLLs. Instead, we build "sdk" as a static library
*/
#if defined(__WXMSW__)
#ifndef DLLIMPORT
#if defined(EXPORT_LIB)
#define DLLIMPORT __declspec (dllexport)
#else
#define DLLIMPORT __declspec (dllimport)
#endif // EXPORT_LIB
#endif // DLLIMPORT
#ifndef EVTIMPORT
#if defined(EXPORT_EVENTS)
#define EVTIMPORT __declspec (dllexport)
#else
#define EVTIMPORT __declspec (dllimport)
#endif // EXPORT_EVENTS
#endif // EVTIMPORT
#else
#define DLLIMPORT
#define EVTIMPORT
#endif
#endif // SETTINGS_H
--- End code ---
When building the static libraries mentioned before, __WXMSW__ is not defined(no wx header is included to build the static libraries). This still make the DLLIMPORT as an empty string. Unless you change the __WXMSW__ to some other windows specific macros, like _WIN32 or others.
EDIT: look at the code: "#ifndef DLLIMPORT", here DLLIMPORT is defined as empty inside the wxwdigets' header files, actually we need to overwrite this definition.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version