Malkverbena / mysql

MySQL connector to Godot Engine.
61 stars 8 forks source link

Problem compiling Godot with MySQL module #25

Open majenkotech opened 10 months ago

majenkotech commented 10 months ago

Platform: Arch Linux Godot Version: Git HEAD 9b522ac1a85cab1a7a867b7a9f3bb102d9376ac2 Compile command: scons platform=linuxbsd target=editor production=yes lto=full GCC version: 13.2.1 20230801

Normal Godot compilation is fine. As soon as I add the MySQL module to modules/ compilation fails with linking errors:

/usr/bin/ld: /tmp/ccpg2Gn7.ltrans24.ltrans.o: in function `TextServerAdvanced::FontForSizeAdvanced::~FontForSizeAdvanced() [clone .lto_priv.0]':
<artificial>:(.text+0x646f5): undefined reference to `FT_Done_Face'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `ft_move_to(FT_Vector_ const*, void*) [clone .lto_priv.0]':
<artificial>:(.text+0x7441): undefined reference to `msdfgen::Shape::addContour()'
/usr/bin/ld: <artificial>:(.text+0x7479): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `ft_line_to(FT_Vector_ const*, void*) [clone .lto_priv.0]':
<artificial>:(.text+0x7501): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x750c): undefined reference to `msdfgen::Vector2::operator!=(msdfgen::Vector2 const&) const'
/usr/bin/ld: <artificial>:(.text+0x756c): undefined reference to `msdfgen::LinearSegment::LinearSegment(msdfgen::Vector2, msdfgen::Vector2, msdfgen::EdgeColor)'
/usr/bin/ld: <artificial>:(.text+0x7577): undefined reference to `msdfgen::EdgeHolder::EdgeHolder(msdfgen::EdgeSegment*)'
/usr/bin/ld: <artificial>:(.text+0x7582): undefined reference to `msdfgen::Contour::addEdge(msdfgen::EdgeHolder const&)'
/usr/bin/ld: <artificial>:(.text+0x758a): undefined reference to `msdfgen::EdgeHolder::~EdgeHolder()'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `ft_conic_to(FT_Vector_ const*, FT_Vector_ const*, void*) [clone .lto_priv.0]':
<artificial>:(.text+0x761e): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x765b): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x7688): undefined reference to `msdfgen::QuadraticSegment::QuadraticSegment(msdfgen::Vector2, msdfgen::Vector2, msdfgen::Vector2, msdfgen::EdgeColor)'
/usr/bin/ld: <artificial>:(.text+0x7693): undefined reference to `msdfgen::EdgeHolder::EdgeHolder(msdfgen::EdgeSegment*)'
/usr/bin/ld: <artificial>:(.text+0x769e): undefined reference to `msdfgen::Contour::addEdge(msdfgen::EdgeHolder const&)'
/usr/bin/ld: <artificial>:(.text+0x76a6): undefined reference to `msdfgen::EdgeHolder::~EdgeHolder()'
/usr/bin/ld: <artificial>:(.text+0x76db): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `ft_cubic_to(FT_Vector_ const*, FT_Vector_ const*, FT_Vector_ const*, void*) [clone .lto_priv.0]':
<artificial>:(.text+0x7783): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x77c5): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x7803): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x783d): undefined reference to `msdfgen::CubicSegment::CubicSegment(msdfgen::Vector2, msdfgen::Vector2, msdfgen::Vector2, msdfgen::Vector2, msdfgen::EdgeColor)'
/usr/bin/ld: <artificial>:(.text+0x7848): undefined reference to `msdfgen::EdgeHolder::EdgeHolder(msdfgen::EdgeSegment*)'
/usr/bin/ld: <artificial>:(.text+0x7853): undefined reference to `msdfgen::Contour::addEdge(msdfgen::EdgeHolder const&)'
/usr/bin/ld: <artificial>:(.text+0x785b): undefined reference to `msdfgen::EdgeHolder::~EdgeHolder()'
/usr/bin/ld: <artificial>:(.text+0x7890): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `TextServerAdvanced::_generateMTSDF_threaded(void*, unsigned int)':
<artificial>:(.text+0x7913): undefined reference to `msdfgen::OverlappingContourCombiner<msdfgen::MultiAndTrueDistanceSelector>::OverlappingContourCombiner(msdfgen::Shape const&)'
/usr/bin/ld: <artificial>:(.text+0x791b): undefined reference to `msdfgen::Shape::edgeCount() const'
/usr/bin/ld: <artificial>:(.text+0x7998): undefined reference to `msdfgen::PseudoDistanceSelectorBase::EdgeCache::EdgeCache()'
/usr/bin/ld: <artificial>:(.text+0x7a3e): undefined reference to `msdfgen::Vector2::Vector2(double, double)'
/usr/bin/ld: <artificial>:(.text+0x7a49): undefined reference to `msdfgen::Projection::unproject(msdfgen::Vector2 const&) const'
/usr/bin/ld: <artificial>:(.text+0x7a64): undefined reference to `msdfgen::OverlappingContourCombiner<msdfgen::MultiAndTrueDistanceSelector>::reset(msdfgen::Vector2 const&)'
/usr/bin/ld: <artificial>:(.text+0x7acd): undefined reference to `msdfgen::OverlappingContourCombiner<msdfgen::MultiAndTrueDistanceSelector>::edgeSelector(int)'
/usr/bin/ld: <artificial>:(.text+0x7af0): undefined reference to `msdfgen::EdgeHolder::operator msdfgen::EdgeSegment const*() const'
/usr/bin/ld: <artificial>:(.text+0x7b03): undefined reference to `msdfgen::EdgeHolder::operator msdfgen::EdgeSegment const*() const'
/usr/bin/ld: <artificial>:(.text+0x7b2b): undefined reference to `msdfgen::EdgeHolder::operator msdfgen::EdgeSegment const*() const'
/usr/bin/ld: <artificial>:(.text+0x7b47): undefined reference to `msdfgen::MultiDistanceSelector::addEdge(msdfgen::PseudoDistanceSelectorBase::EdgeCache&, msdfgen::EdgeSegment const*, msdfgen::EdgeSegment const*, msdfgen::EdgeSegment const*)'
/usr/bin/ld: <artificial>:(.text+0x7b88): undefined reference to `msdfgen::OverlappingContourCombiner<msdfgen::MultiAndTrueDistanceSelector>::distance() const'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `TextServerAdvanced::_font_get_face_count(RID const&) const':
<artificial>:(.text+0x8e6e): undefined reference to `FT_Open_Face'
/usr/bin/ld: <artificial>:(.text+0x8ec1): undefined reference to `FT_Done_Face'
/usr/bin/ld: <artificial>:(.text+0x8f20): undefined reference to `FT_Init_FreeType'
/usr/bin/ld: <artificial>:(.text+0x8f49): undefined reference to `FT_Property_Set'
/usr/bin/ld: <artificial>:(.text+0x900c): undefined reference to `FT_Error_String'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `TextServerAdvanced::_font_set_style(RID const&, BitField<TextServer::FontStyle>)':
<artificial>:(.text+0x19045): undefined reference to `FT_Open_Face'
/usr/bin/ld: <artificial>:(.text+0x19069): undefined reference to `FT_Done_Face'
/usr/bin/ld: <artificial>:(.text+0x1909e): undefined reference to `FT_Open_Face'
/usr/bin/ld: <artificial>:(.text+0x191ad): undefined reference to `FT_Select_Size'
/usr/bin/ld: <artificial>:(.text+0x1923c): undefined reference to `FT_MulFix'
/usr/bin/ld: <artificial>:(.text+0x19286): undefined reference to `FT_MulFix'
/usr/bin/ld: <artificial>:(.text+0x19300): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1936a): undefined reference to `FT_Get_Var_Design_Coordinates'
/usr/bin/ld: <artificial>:(.text+0x19623): undefined reference to `FT_Set_Var_Design_Coordinates'
/usr/bin/ld: <artificial>:(.text+0x1966c): undefined reference to `FT_Done_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x197c0): undefined reference to `FT_Set_Pixel_Sizes'
/usr/bin/ld: <artificial>:(.text+0x1983c): undefined reference to `FT_Done_Face'
/usr/bin/ld: <artificial>:(.text+0x1987b): undefined reference to `FT_Error_String'
/usr/bin/ld: <artificial>:(.text+0x19928): undefined reference to `FT_Init_FreeType'
/usr/bin/ld: <artificial>:(.text+0x1995d): undefined reference to `FT_Property_Set'
/usr/bin/ld: <artificial>:(.text+0x19c5b): undefined reference to `FT_Get_Sfnt_Table'
/usr/bin/ld: <artificial>:(.text+0x1a356): undefined reference to `FT_Error_String'
/usr/bin/ld: <artificial>:(.text+0x1a579): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1a702): undefined reference to `FT_Done_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1bf7e): undefined reference to `FT_Get_Var_Design_Coordinates'
/usr/bin/ld: /tmp/ccpg2Gn7.ltrans25.ltrans.o: in function `TextServerAdvanced::_font_get_style(RID const&) const':
<artificial>:(.text+0x1c553): undefined reference to `FT_Open_Face'
/usr/bin/ld: <artificial>:(.text+0x1c577): undefined reference to `FT_Done_Face'
/usr/bin/ld: <artificial>:(.text+0x1c5ab): undefined reference to `FT_Open_Face'
/usr/bin/ld: <artificial>:(.text+0x1c6bf): undefined reference to `FT_Select_Size'
/usr/bin/ld: <artificial>:(.text+0x1c74e): undefined reference to `FT_MulFix'
/usr/bin/ld: <artificial>:(.text+0x1c798): undefined reference to `FT_MulFix'
/usr/bin/ld: <artificial>:(.text+0x1c810): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1c883): undefined reference to `FT_Get_Var_Design_Coordinates'
/usr/bin/ld: <artificial>:(.text+0x1cb44): undefined reference to `FT_Set_Var_Design_Coordinates'
/usr/bin/ld: <artificial>:(.text+0x1cb8d): undefined reference to `FT_Done_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1ccc0): undefined reference to `FT_Set_Pixel_Sizes'
/usr/bin/ld: <artificial>:(.text+0x1cd3d): undefined reference to `FT_Done_Face'
/usr/bin/ld: <artificial>:(.text+0x1cd7e): undefined reference to `FT_Error_String'
/usr/bin/ld: <artificial>:(.text+0x1ce28): undefined reference to `FT_Init_FreeType'
/usr/bin/ld: <artificial>:(.text+0x1ce5e): undefined reference to `FT_Property_Set'
/usr/bin/ld: <artificial>:(.text+0x1d145): undefined reference to `FT_Get_Sfnt_Table'
/usr/bin/ld: <artificial>:(.text+0x1d849): undefined reference to `FT_Error_String'
/usr/bin/ld: <artificial>:(.text+0x1da69): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1dbe8): undefined reference to `FT_Done_MM_Var'
/usr/bin/ld: <artificial>:(.text+0x1f45e): undefined reference to `FT_Get_Var_Design_Coordinates'
... etc ...

I believe these errors are coming from the text_server_adv module which is being broken by the MySQL module in some way.

Malkverbena commented 10 months ago

It's probably a problem with the linker. I will refactor the third-party compilation and solve this in the process.

Malkverbena commented 10 months ago

@majenkotech Is it working on Arch Linux now?

majenkotech commented 10 months ago

Alas not, I am still seeing the same FT_* linker problem.

Malkverbena commented 10 months ago

Have you tried without production and lto options?

majenkotech commented 10 months ago

Originally I had tried many permutations. I shall try more later on tonight with the new version.

majenkotech commented 10 months ago

With no production and no LTO (just scons platform=linuxbsd target=editor) it's still failing. Here's the full error - it's a bit long I'm afraid....

log.txt

Malkverbena commented 10 months ago

I can't reproduce it on ubuntu. I'm thinking about letting each user compile third-party libraries on their own. It's too painfull compile for each system.

majenkotech commented 10 months ago

Maybe it would be simpler if I just knock up an Ubuntu VM for compilation purposes. I'm more than happy to run purely with system-installed libraries if that's a simpler thing to arrange. I don't need portability for what I do with Godot.

Malkverbena commented 10 months ago

You can guide scons to the folder containing the compiled Boost and Oopenssl libraries. Open the config.cfg file, mark all options as false. After that, open Scsub. set the paths to the libs and includes on your system and compile again. It should be enought to compile the module on your system.

majenkotech commented 10 months ago

Hmm, no, that doesn't seem to make any difference. I'm trying in an Ubuntu VM at the moment to see if that is more successful.

majenkotech commented 10 months ago

Aha! I have some success!

I switched to LLVM and LLD instead (and it took a good hour to link... :( ) and it looks like it has actually compiled! Now to do more experiments...

My working command line:

scons platform=linuxbsd  target=editor production=yes use_llvm=yes linker=lld use_static_cpp=no
Malkverbena commented 10 months ago

It's a linker issue. Seems Gold is not properly set.

Malkverbena commented 10 months ago

You said that portability doesn't matter, you are probably using this module on your server, correct?

majenkotech commented 10 months ago

Kind of. I am using Godot on my streaming PC to create interactive overlays. I'm the only one using that installation of Godot and what I write is for internal use only and won't be shared with anyone. The database is for saving request queues and state information.

Malkverbena commented 9 months ago

@majenkotech I made few changes. Could you confirm if you are able to compile now?

majenkotech commented 9 months ago

Still fails in the same way with gcc and ld (I just tested mold and that works).

Also, I don't know if this is intentional or not, but it seems to recompile boost every single time now, which makes incremental builds impossible....

Malkverbena commented 9 months ago

@majenkotech I've tried with gcc\gold + gold, lld and mold but I still can't reproduce this on Ubuntu.

Still fails in the same way with gcc and ld (I just tested mold and that works).

.

There is a config.cfg file where you can't desable the compilations of openssl and/or boost. I'll make it an option of scons in the future.

Also, I don't know if this is intentional or not, but it seems to recompile boost every single time now, which makes incremental builds impossible....

Malkverbena commented 9 months ago

Godot has some issues with module compilation. I need check it out.