-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix the libjpeg and libjxl pc files #79
Conversation
Hi @DDoS,
Fixed in commit 4dc513a. I'll discuss this patch upstream later.
This doesn't seem correct. You'll need to ensure that your executable is compiled with |
Nice!
With that change, aom is now in the list of libraries (thanks for mentioning the EDIT: Emscripten is adding I also get these warnings, if you happen to know anything about these.
|
Also I think at this point this is better off as an issue than a PR, so I'm closing this. |
Please see: lovell/sharp#2731 (comment).
Are you compiling with the same Emscripten version as wasm-vips? Emscripten doesn't guarantee ABI stability between versions, so the versions need to be aligned for compatibility.
The signature mismatch warnings for $ rm -rf build/{cargo-cache,ccache,deps,emcache,target} This ensures that all dependencies are rebuilt. |
Looks like I was using a slightly newer version (3.1.68 instead of 3.1.64). I downgraded my project, but the error remains :/
In fact I don't need SVG support, so I'll just disable it. |
Hmm, weird. Could you reproduce this issue even when Lines 481 to 483 in 7b3657e
Note to self: |
Yes, once I added the
That's where it's coming from. I have checked all the library archives generated by the build and haven't found anything else. I'm pretty sure that the problem is there are multiple versions of # Remove libc++ from pkg-config, because it conflicts with multithreaded
# libc++ from emscripten
get_target_property(vips_libraries PkgConfig::vips INTERFACE_LINK_LIBRARIES)
list(FILTER vips_libraries EXCLUDE REGEX [[libc\+\+]])
set_target_properties(PkgConfig::vips PROPERTIES
INTERFACE_LINK_LIBRARIES "${vips_libraries}") |
Just a sanity check, are you also linking with It may also be worth checking that you are not accidentally linking with the |
Here's the full command line ~/Sources/Cadre/emsdk/upstream/emscripten/em++ -O2 -g -DNDEBUG --preload-file=~/Sources/Cadre/encre/test_data@/ -sSAFE_HEAP=1 -sASSERTIONS=2 --bind -sENVIRONMENT=web,worker -sALLOW_MEMORY_GROWTH=1 -sABORTING_MALLOC=0 -sMALLOC=mimalloc -sSTACK_SIZE=256KB -sALLOW_TABLE_GROWTH -sTEXTDECODER=2 -sFORCE_FILESYSTEM -sEXCEPTION_STACK_TRACES "-sPTHREAD_POOL_SIZE='Math.max(navigator.hardwareConcurrency,6)'" -pthread -fexceptions -msimd128 -sWASM_BIGINT js/CMakeFiles/js_encre.dir/src/js_encre.cpp.o -o js/js_encre.js -L~/Sources/wasm-vips/build/target/lib -Wl,--whole-archive core/libencre.a -Wl,--no-whole-archive vcpkg_installed/wasm32-emscripten-pthread/lib/libglm.a vcpkg_installed/wasm32-emscripten-pthread/lib/libqhullstatic_r.a vcpkg_installed/wasm32-emscripten-pthread/lib/libqhullcpp.a -lvips-cpp -lvips -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lffi -lexpat -limagequant -lcgif -lexif -lspng -lwebpmux -lwebpdemux -ltiff -lwebp -ljpeg -lz -lwebp -ljpeg -lz -lheif ~/Sources/Cadre/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc++.a -laom -lsharpyuv -ljxl -lhwy -lbrotlienc -lbrotlidec -lbrotlicommon -ljxl_cms ~/Sources/Cadre/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc++.a -laom -lsharpyuv -ljxl -lhwy -lbrotlienc -lbrotlidec -lbrotlicommon -ljxl_cms -llcms2 -ljxl_threads -lm libc++ is being passed as an absolute path, instead of |
Indeed, it seems to be linking against I tried several things to reproduce this but without success. The only way I could trigger a similar --- a/build.sh
+++ b/build.sh
@@ -511,6 +511,7 @@ EOL
stage "Compiling JS bindings"
mkdir $DEPS/wasm-vips
cd $DEPS/wasm-vips
+ CXXFLAGS=${CXXFLAGS/ -pthread/} \
emcmake cmake $SOURCE_DIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="$SOURCE_DIR/lib" \
-DENVIRONMENT=${ENVIRONMENT//,/;} -DENABLE_MODULES=$MODULES -DENABLE_WASMFS=$WASM_FS
make Are you able to provide a complete, standalone code sample that allows someone else to reproduce this issue? |
I stripped down my project to the bare essentials: repro.zip Build steps:
Thanks for the help with this! |
Thanks for the standalone reproduction! I'm still investigating the root cause (which I suspect is a CMake quirk), but this patch resolves the issue for me: Details--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -13,7 +13,7 @@
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/FindEmsdkToolchain.cmake",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
- "PKG_CONFIG_ARGN": "--define-variable=prefix=$env{WASM_VIPS_ROOT}/build/target;--static",
+ "PKG_CONFIG_ARGN": "--define-variable=prefix=$env{WASM_VIPS_ROOT}/build/target",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"environment": {
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -21,17 +21,8 @@ target_sources(encre PRIVATE
)
find_package(PkgConfig REQUIRED)
-pkg_search_module(vips REQUIRED IMPORTED_TARGET "vips-cpp")
-
-# Remove libc++ from pkg-config, because it conflicts with multithreaded
-# libc++ from emscripten
-# \/ UNCOMMENT TO FIX \/
-# get_target_property(vips_libraries PkgConfig::vips INTERFACE_LINK_LIBRARIES)
-# list(FILTER vips_libraries EXCLUDE REGEX [[libc\+\+]])
-# set_target_properties(PkgConfig::vips PROPERTIES
-# INTERFACE_LINK_LIBRARIES "${vips_libraries}")
-# /\ UNCOMMENT TO FIX /\
+pkg_check_modules(VIPS vips-cpp REQUIRED)
# Add missing library directory
-target_link_directories(PkgConfig::vips INTERFACE ${vips_LIBRARY_DIRS})
-target_link_libraries(encre PRIVATE PkgConfig::vips)
+target_include_directories(encre PRIVATE ${VIPS_INCLUDE_DIRS})
+target_link_libraries(encre PRIVATE ${VIPS_STATIC_LDFLAGS}) (the change in |
Thanks, I'll give it a try later this weekend. |
Hi, I've been trying to use wasm-vips in a project, and came upon a couple of build errors when linking to my executable. I thought I'd share the fixes.
lc++
to private libs to fixwasm-ld: error: --shared-memory is disallowed by hash.o because it was not compiled with 'atomics' or 'bulk-memory'
Build was done with
--disable-bindings --disable-modules --enable-libvips-cpp
.