Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols when linking main binary #4908

Open
500-internal-server-error opened this issue Dec 30, 2024 · 0 comments
Open

Undefined symbols when linking main binary #4908

500-internal-server-error opened this issue Dec 30, 2024 · 0 comments

Comments

@500-internal-server-error

I'm aware of the lack of support for MinGW builds, but I figured it was worth trying to ask in case it ends up being something simple.

I'm trying to build Aseprite with MinGW, it seems to have had support for it in the past which is why I was hopeful it would be simple to reenable. Aseprite's dependencies (other than Skia) compile fine out-of-the-box, or with only very minor changes. For Skia, my starting point is mingw-w64-skia's patches and PKGBUILD. For the rest, my starting point is the Arch AUR PKGBUILD.

Aseprite and System version:

  • Aseprite version: beta
  • System: Windows, MSYS2 CLANG64 environment, git clone

Building the main branch worked fine, being based on m102 (mingw-w64-skia has m108, so somewhat close). However, while the beta branch compiled fine, it resulted in undefined symbols when linking the main binary:

Errors
ld.lld: error: undefined symbol: SkFont::refTypefaceOrDefault() const
>>> referenced by libskshaper.a(libskshaper.SkShaper.o):(SkShaper::MakeFontMgrRunIterator(char const*, unsigned long long, SkFont const&, sk_sp<SkFontMgr>, char const*, SkFontStyle, SkShaper::LanguageRunIterator const*))
>>> referenced by libskshaper.a(libskshaper.SkShaper.o):(FontMgrRunIterator::FontMgrRunIterator(char const*, unsigned long long, SkFont const&, sk_sp<SkFontMgr>))
>>> referenced by libskshaper.a(libskshaper.SkShaper.o):(FontMgrRunIterator::FontMgrRunIterator(char const*, unsigned long long, SkFont const&, sk_sp<SkFontMgr>))

ld.lld: error: undefined symbol: SkFontMgr::RefDefault()
>>> referenced by libskshaper.a(libskshaper.SkShaper_harfbuzz.o):((anonymous namespace)::ShaperHarfBuzz::shape(char const*, unsigned long long, SkFont const&, bool, float, SkShaper::RunHandler*) const)

ld.lld: error: undefined symbol: SkFont::getTypefaceOrDefault() const
>>> referenced by libskshaper.a(libskshaper.SkShaper_primitive.o):(SkShaperPrimitive::shape(char const*, unsigned long long, SkShaper::FontRunIterator&, SkShaper::BiDiRunIterator&, SkShaper::ScriptRunIterator&, SkShaper::LanguageRunIterator&, float, SkShaper::RunHandler*) const)

ld.lld: error: undefined symbol: u_errorName_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: u_getIntPropertyValue_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: u_iscntrl_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: u_isspace_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: u_isWhitespace_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: u_strToUpper_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_close_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_getDirection_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_getLength_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_getLevelAt_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_openSized_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_reorderVisual_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubidi_setPara_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubrk_close_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubrk_current_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubrk_first_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: undefined symbol: ubrk_following_74
>>> referenced by libskunicode.a(libskunicode.SkUnicode_icu_builtin.o):(SkLoadICULib())

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

It seems to have something to do with the deprecations and removals made along the way somewhere around m120, Aseprite beta using m124. Unfortunately, I'm not familiar enough with with Google's build systems to troubleshoot further on why it's trying to reference supposedly removed symbols, or why it compiles fine and only produces errors when being linked.

Any ideas on where I should look into to fix this? My current efforts can be found here.

PS: Would PRs to improve MinGW support be accepted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant