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

pugixml update for Emscripten => 3.1.52 #358

Conversation

Jonathhhan
Copy link
Contributor

Needs to be compiled as an .o file instead of a .bc file since Emscripten 3.1.52. See: emscripten-core/emscripten#21128

@danoli3
Copy link
Member

danoli3 commented Mar 12, 2024

@Jonathhhan oh cool!! Yes also can you look into if any issues with the WASM files as well.

We were aware the .a / .bc formats were not going to work in the future.
https://github.com/openframeworks/apothecary/releases/download/bleeding/openFrameworksLibs_bleeding_emscripten.tar.bz2

Many of the libs have been set to compile with the WASM format to fix a lot of these static lib and not runtime systems.

Do we need to make these .wasms / .o ?

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Mar 12, 2024

At least freetype.wasm does not work:

wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Init_FreeType
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_New_Face
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Done_Face
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Set_Char_Size
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Outline_Decompose
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Char_Index
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Load_Glyph
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Render_Glyph
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Char_Index
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Char_Index
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Kerning
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Char_Index
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Char_Index
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: FT_Get_Kerning

It does not matter much in the case of freetype, because it is replaced by the emscripten lib since some time:

-s USE_FREETYPE=1
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/freetype/lib/%

Probably it would work compiled as an .o file, but I was not able to change the script accordingly...
Is it possibly to compile cairo for Emscripten, too?

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Mar 12, 2024

@danoli3 there are also some issues with libxml2 (tried the svgExample):

wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xml_attribute::set_value(char const*)
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xml_attribute::set_value(char const*)
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xml_attribute::set_value(char const*)
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/addons/obj/emscripten/Release/ofxSvg/src/ofxSvg.o: undefined symbol: pugi::xpath_node_set::~xpath_node_set()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_document::xml_document()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::xml_node()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::root() const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_document::xml_document()
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_document::load_string(char const*, unsigned int)
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_parse_result::operator bool() const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::root() const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::root() const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::operator==(pugi::xml_node const&) const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_node::print(std::__2::basic_ostream<char, std::__2::char_traits<char>>&, char const*, unsigned int, pugi::xml_encoding, unsigned int) const
wasm-ld: error: /mnt/c/Users/Jonat/Desktop/of_v20240306_linux64gcc6_release/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.o: undefined symbol: pugi::xml_document::xml_document()
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

Just a guess, but maybe all .wasm / .bc libs need to be compiled as .a / .o since Emscripten 3.1.52?

@danoli3
Copy link
Member

danoli3 commented Mar 13, 2024

Yeah you can see our original discussion here:
#326

libopenFrameworks.o: undefined symbol: FT_Init_FreeType

this looks like it hasn't linked to the freetype code at all.

Cairo is possible to add, however will definitely need our locally compiled FreeType as a dependancy, will have a look later
seems like those XML bugs are still related to pugs

/ofxSvg.o: undefined symbol: pugi::xml_attribute::set_value(char const*)

I will merge this code once finished with Actions changes on bleeding currently

@Jonathhhan
Copy link
Contributor Author

@danoli3 thanks.

@danoli3
Copy link
Member

danoli3 commented Mar 13, 2024

Might have to rebase your commit sorry!

@danoli3
Copy link
Member

danoli3 commented Mar 13, 2024

@Jonathhhan yeah just fetch from upstream, then rebase your commit ontop of bleeding tip

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

Successfully merging this pull request may close these issues.

None yet

2 participants