Issue 14636 in skia: m116 coponent+svg build, svg modules uses non-public symbols

3 views
Skip to first unread message

hinta… via monorail

unread,
Jul 23, 2023, 10:18:56 PM7/23/23
to bu...@skia.org
Status: Untriaged
Owner: ----
Priority: Medium
Type: Defect

New issue 14636 by hinta...@gmail.com: m116 coponent+svg build, svg modules uses non-public symbols
https://bugs.chromium.org/p/skia/issues/detail?id=14636

What steps will reproduce the problem?

component build with svg module enabled (I know you don't really support component build, nor new modules...):

bin/gn ... --args='is_official_build=true is_component_build=true skia_enable_svg=true ...'

build is fine, but when trying to use for linking applications, the svg module invokes non-public symbols in libskia:

===
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::~SkDOM()'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkTextBlobRunIterator::SkTextBlobRunIterator(SkTextBlob const*)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::getFirstChild(SkDOMNode const*, char const*) const'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::getName(SkDOMNode const*) const'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkOSPath::Basename(char const*)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::AttrIter::next(char const**)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::getType(SkDOMNode const*) const'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::AttrIter::AttrIter(SkDOM const&, SkDOMNode const*)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::build(SkStream&)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkStrSearch(char const* const*, int, char const*, unsigned long)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkOSPath::Dirname(char const*)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDebugf(char const*, ...)'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::getNextSibling(SkDOMNode const*, char const*) const'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkTextBlobRunIterator::next()'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::SkDOM()'
/usr/bin/ld: /tmp/ft2-demos/skia/out/Shared//libsvg.so: undefined reference to `SkDOM::getRootNode() const'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
===

These are all non-public symbols inside libskia, which are therefore available in non-component builds.

What is the expected output? What do you see instead?

linking should complete without symbol resolution problems

What version of the product are you using? On what operating system?

m116, linux x86_64

Please submit a code sample via fiddle.skia.org showing the issue.

The code is posted to freetype-devel as part of the new OT-SVG hook bridge.


Provide any additional information below.

Of course a static build works, but with 6 binaries depending on the new hook bridge, the size increases from 13MB to 160 MB!

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

hinta… via monorail

unread,
Jul 23, 2023, 10:26:00 PM7/23/23
to bu...@skia.org

Comment #1 on issue 14636 by hinta...@gmail.com: m116 coponent+svg build, svg modules uses non-public symbols
https://bugs.chromium.org/p/skia/issues/detail?id=14636#c1

I have a local diff which I use successfully - by declaring 5 classes/routines public (attached). But I am fairly surely you might like to do it in a different way:

$ cat skia-m116-modules-symbols-svg.diff | grep SK_API
+SK_API int SkStrSearch(const char*const* base, int count, const char target[],
+class SK_API SkTextBlobRunIterator {
+SK_API void SkDebugf(const char format[], ...) {
+class SK_API SkOSPath {
+class SK_API SkDOM : public SkNoncopyable {

Attachments:
skia-m116-modules-symbols-svg.diff 2.1 KB

micha… via monorail

unread,
Jul 24, 2023, 10:29:25 AM7/24/23
to bu...@skia.org
Updates:
Cc: bung...@google.com
Labels: Area-API
Owner: michae...@google.com
Status: Accepted

Comment #2 on issue 14636 by michae...@google.com: m116 coponent+svg build, svg modules uses non-public symbols
https://bugs.chromium.org/p/skia/issues/detail?id=14636#c2

Thank you for the report, but I don't think we will be addressing it at this point. The component build is a way to test how Skia is built within chromium, which does not use any of our other modules. Our modules are also allowed to use internal APIs that should not be made public with SK_API. As such, it's not surprising that is_component_build does not work with the svg module.

Besides SK_API, we have an SK_SPI macro that does roughly the same thing to make symbols available for linking but signals that it's a private API. Could you try testing with that instead. If it works, we'd be more willing to tag those types as SPI so that svg module can be a sharable library.
Reply all
Reply to author
Forward
0 new messages