|
|
DescriptionManage FreeType symbol visibility using platform specific FT_EXPORT
MSVC does not support the -fvisibility-* option, hence providing
platform specific macros for library export visibility. Also,
suppress unused function warnings on non-Windows platforms only.
BUG=700830
Review-Url: https://codereview.chromium.org/2738383002
Cr-Commit-Position: refs/heads/master@{#456390}
Committed: https://chromium.googlesource.com/chromium/src/+/567ff79ca421beccab0b5babdeef3d6d9b89b9ea
Patch Set 1 #Patch Set 2 : Adjust visibility approach for windows #Patch Set 3 : -Wno-unused-function for clang only #
Total comments: 2
Patch Set 4 : Improve windows visibility matching #
Messages
Total messages: 47 (33 generated)
The CQ bit was checked by drott@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by drott@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Adjust visibility approach for windows
Description was changed from ========== Manage FreeType symbol visibility with ftconfig.h again Go back to the old approach of exporting FreeType symbols by overriding the FT_Export and FT_Export_Def macros in a local ftconfig.h copy. MSVC does not support the -fvisibility-* options and I did not succeed overriding the FT_Export* macros using BUILD.gn defines. BUG=69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. BUG=69876 ==========
The CQ bit was checked by drott@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. BUG=69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress warnings on non-Windows platforms only. BUG=69876 ==========
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress warnings on non-Windows platforms only. BUG=69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=69876 ==========
drott@chromium.org changed reviewers: + bungeman@chromium.org, dpranke@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
-Wno-unused-function for clang only
The CQ bit was checked by drott@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=skia:69876 ==========
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=skia:69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=69876 ==========
bungeman@google.com changed reviewers: + bungeman@google.com
I'm; not sure what the BUG in the current description is, it seems to go somewhere random? https://codereview.chromium.org/2738383002/diff/40001/third_party/freetype/in... File third_party/freetype/include/freetype-custom-config/ftoption.h (right): https://codereview.chromium.org/2738383002/diff/40001/third_party/freetype/in... third_party/freetype/include/freetype-custom-config/ftoption.h:314: #define FT_EXPORT_DEF(x) __declspec(dllexport) x How are you getting away with using only dllexport and not dllimport? Are all the trybots non-component builds? Usually on Windows one sees something more like https://lists.nongnu.org/archive/html/freetype/2009-05/msg00004.html which also takes into account that in a non-component build you don't want to export anything (Chromium doesn't want to expose the FreeType symbols in a non-component build if it can be avoided).
Maybe something like #if ?windows? && ?component_build? #if FT2_BUILD_LIBRARY #define FT_EXPORT(x) extern __declspec(dllexport) x #else #define FT_EXPORT(x) extern __declspec(dllimport) x #endif #endif
Improve windows visibility matching
The CQ bit was checked by drott@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/03/10 at 17:50:08, bungeman wrote: > Maybe something like > > #if ?windows? && ?component_build? > #if FT2_BUILD_LIBRARY > #define FT_EXPORT(x) extern __declspec(dllexport) x > #else > #define FT_EXPORT(x) extern __declspec(dllimport) x > #endif > #endif Yes, slightly different now: if ?windows? // do MSVC style markup if ?component? if ?inside freetype? // dllexport else // dllimport endif endif // if component else // set gcc attribute endif
Thanks for the review, hope this works now. https://codereview.chromium.org/2738383002/diff/40001/third_party/freetype/in... File third_party/freetype/include/freetype-custom-config/ftoption.h (right): https://codereview.chromium.org/2738383002/diff/40001/third_party/freetype/in... third_party/freetype/include/freetype-custom-config/ftoption.h:314: #define FT_EXPORT_DEF(x) __declspec(dllexport) x On 2017/03/10 at 17:02:56, bungeman-skia wrote: > How are you getting away with using only dllexport and not dllimport? Are all the trybots non-component builds? Usually on Windows one sees something more like https://lists.nongnu.org/archive/html/freetype/2009-05/msg00004.html which also takes into account that in a non-component build you don't want to export anything (Chromium doesn't want to expose the FreeType symbols in a non-component build if it can be avoided). Thanks for pointing this out. I am not very familiar with Windows linking, but according to https://msdn.microsoft.com/en-us/library/aa271769(v=vs.60).aspx I can get away without dllimport at the expense of an extra redirect thunk, if I understood correctly. In the updated patch I try to match dllexport/dllimport if it's a component build and don't add any extra qualifications when it's static linkage. On non Windows, I add the gcc-style visibility attribute.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
I haven't had a chance to actually test drive it yet, but lgtm.
The CQ bit was checked by drott@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by drott@chromium.org
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=69876 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=700830 ==========
Ah, and I update the bug number now. The previous one was lacking a 3 at the end from a copy and paste mistake, and was pointing to one of the FreeType unification bugs.
The CQ bit was checked by drott@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1489420291427590, "parent_rev": "aaa07f46771138c6b4f554ee34dba359ebd68813", "commit_rev": "567ff79ca421beccab0b5babdeef3d6d9b89b9ea"}
Message was sent while issue was closed.
Description was changed from ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=700830 ========== to ========== Manage FreeType symbol visibility using platform specific FT_EXPORT MSVC does not support the -fvisibility-* option, hence providing platform specific macros for library export visibility. Also, suppress unused function warnings on non-Windows platforms only. BUG=700830 Review-Url: https://codereview.chromium.org/2738383002 Cr-Commit-Position: refs/heads/master@{#456390} Committed: https://chromium.googlesource.com/chromium/src/+/567ff79ca421beccab0b5babdeef... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/567ff79ca421beccab0b5babdeef...
Message was sent while issue was closed.
On the other hand, we're not even DEPSing in FreeType when on Windows, and if we were we're not currently building it. So the trybots aren't really trying anything here, which explains why all the builds work (nothing really changed). I updated issue 2682803002 to add the DEPS and also build, and it looks like it should work, but I haven't had time to test it yet.
Message was sent while issue was closed.
On 2017/03/13 at 16:09:23, bungeman wrote: > On the other hand, we're not even DEPSing in FreeType when on Windows, and if we were we're not currently building it. So the trybots aren't really trying anything here, which explains why all the builds work (nothing really changed). > > I updated issue 2682803002 to add the DEPS and also build, and it looks like it should work, but I haven't had time to test it yet. I've tried (built & tested) it locally, plus some additional changes. That's why I was coming to the conclusion that we need a change in how we manage the visibility. The results are listed in https://bugs.chromium.org/p/chromium/issues/detail?id=700926 . I plan to update/incorporate 2682803002 as soon as possible, but it's blocked on PDFium rolling FreeType atm. Thanks for the review and your help in testing this CL if you plan to try it locally. |