Build Make error:emmake Make在尝试构建libxml2时导致错误,can';找不到libxml.so.2

Build Make error:emmake Make在尝试构建libxml2时导致错误,can';找不到libxml.so.2,build,webassembly,libxml2,emscripten,emmake,Build,Webassembly,Libxml2,Emscripten,Emmake,我的目标是用emscripten(我通过emsdk安装)将我的C程序编译成wasm。它使用libxml2。我将按照这里概述的步骤进行构建 使用适当的emscripten参数从源代码获取libxml2。 当我运行emmake make时,会收到以下警告和错误: ... CCLD libxml2.la emcc: warning: linking a library with `-shared` will emit a static object file. This is a form

我的目标是用emscripten(我通过emsdk安装)将我的C程序编译成wasm。它使用libxml2。我将按照这里概述的步骤进行构建 使用适当的emscripten参数从源代码获取libxml2。 当我运行
emmake make
时,会收到以下警告和错误:

...

CCLD     libxml2.la
emcc: warning: linking a library with `-shared` will emit a static object file.
This is a form of emulation to support existing build systems.  
If you want to build a runtime shared library use the SIDE_MODULE setting. [-Wemcc]
emcc: warning: ignoring unsupported linker flag: `--version-script=./libxml2.syms` [-Wlinkflags]
wasm-ld: error: cannot open libxml2.so.2: No such file or directory
emcc: error: '/home/willy/emsdk/upstream/bin/wasm-ld -o .libs/libxml2.so.2.9.9 .libs/SAX.o .libs/entities.o .libs/encoding.o -L/home/willy/emsdk/upstream/emscripten/system/local/lib .libs/error.o -L/home/willy/emsdk/upstream/emscripten/system/lib .libs/parserInternals.o -L/home/willy/emsdk/upstream/emscripten/cache/wasm .libs/parser.o .libs/tree.o .libs/hash.o .libs/list.o .libs/xmlIO.o .libs/xmlmemory.o .libs/uri.o .libs/valid.o .libs/xlink.o .libs/HTMLparser.o .libs/HTMLtree.o .libs/debugXML.o .libs/xpath.o .libs/xpointer.o .libs/xinclude.o .libs/nanohttp.o .libs/nanoftp.o .libs/catalog.o .libs/globals.o .libs/threads.o .libs/c14n.o .libs/xmlstring.o .libs/buf.o .libs/xmlregexp.o .libs/xmlschemas.o .libs/xmlschemastypes.o .libs/xmlunicode.o .libs/xmlreader.o .libs/relaxng.o .libs/dict.o .libs/SAX2.o .libs/xmlwriter.o .libs/legacy.o .libs/chvalid.o .libs/pattern.o .libs/xmlsave.o .libs/xmlmodule.o .libs/schematron.o .libs/xzlib.o /home/willy/emsdk/upstream/emscripten/cache/wasm/libc.a libxml2.so.2 --relocatable -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
make[2]: *** [Makefile:1065: libxml2.la] Error 1
make[2]: Leaving directory '/home/willy/CWasmSandbox/libxml2-2.9.9'
make[1]: *** [Makefile:1484: all-recursive] Error 1
make[1]: Leaving directory '/home/willy/CWasmSandbox/libxml2-2.9.9'
make: *** [Makefile:897: all] Error 2

根据我对emscripten有限的理解,我唯一能收集到的是它试图访问
libxml2.so.2
,在正常情况下,它将从
libxml2.la
生成。但是没有生成
libxml2.so.2
,因为emscripten不生成共享对象。这个估计正确吗?我尝试将选项
CFLAGS=“-s SIDE_MODULE=1”
传递到
make
,但它没有修复错误,可能是我对构建系统的有限知识所产生的一个愚蠢想法。我还尝试将以前安装的libxml2.so.2复制到相应的目录中,但运气不好,而且有点愚蠢,因为emscripten不会使用.so文件?我的下一步应该是什么?

最简单的方法是退出共享库

共享一(side模块)有一个重要的限制:如果要在主应用程序中使用线程,它将不起作用

所以只需更改
/script/libxml2

-emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no
+emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no --enable-shared=no

构建并将
/Build/.libs/libxml2.a
链接到主应用程序。

最简单的方法是退出共享库

共享一(side模块)有一个重要的限制:如果要在主应用程序中使用线程,它将不起作用

所以只需更改
/script/libxml2

-emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no
+emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no --enable-shared=no
构建并将
/Build/.libs/libxml2.a
链接到主应用程序