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

no libasan when using release.sh #4736

Open
tingfengwanxiao opened this issue Mar 7, 2024 · 1 comment
Open

no libasan when using release.sh #4736

tingfengwanxiao opened this issue Mar 7, 2024 · 1 comment

Comments

@tingfengwanxiao
Copy link

tingfengwanxiao commented Mar 7, 2024

[68/118] Compiling C object app/test_cli.exe.p/tests_test_cli.c.obj
<command-line>: warning: no previous prototype for 'SDL_main' [-Wmissing-prototypes]
../app/tests/test_cli.c:164:5: note: in expansion of macro 'main'
  164 | int main(int argc, char *argv[]) {
      |     ^~~~
[69/118] Linking target app/test_binary.exe
FAILED: app/test_binary.exe
"cc"  -o app/test_binary.exe app/test_binary.exe.p/tests_test_binary.c.obj app/test_binary.exe.p/src
_compat.c.obj "-fsanitize=address" "-Wl,--allow-shlib-undefined" "-Wl,--start-group" "D:/msys64/ming
w64/lib/libavformat.dll.a" "D:/msys64/mingw64/lib/libavcodec.dll.a" "D:/msys64/mingw64/lib/libavutil
.dll.a" "D:/msys64/mingw64/lib/libswresample.dll.a" "D:/msys64/mingw64/lib/libmingw32.a" "-mwindows"
 "D:/msys64/mingw64/lib/libSDL2main.a" "D:/msys64/mingw64/lib/libSDL2.dll.a" "D:/msys64/mingw64/lib/
libusb-1.0.dll.a" "-lmingw32" "-lws2_32" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32"
 "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group
"
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe
: cannot find -lasan: No such file or directory
collect2.exe: error: ld returned 1 exit status
[72/118] Linking target app/test_bytebuf.exe
FAILED: app/test_bytebuf.exe
"cc"  -o app/test_bytebuf.exe app/test_bytebuf.exe.p/tests_test_bytebuf.c.obj app/test_bytebuf.exe.p
/src_util_bytebuf.c.obj app/test_bytebuf.exe.p/src_compat.c.obj "-fsanitize=address" "-Wl,--allow-sh
lib-undefined" "-Wl,--start-group" "D:/msys64/mingw64/lib/libavformat.dll.a" "D:/msys64/mingw64/lib/
libavcodec.dll.a" "D:/msys64/mingw64/lib/libavutil.dll.a" "D:/msys64/mingw64/lib/libswresample.dll.a
" "D:/msys64/mingw64/lib/libmingw32.a" "-mwindows" "D:/msys64/mingw64/lib/libSDL2main.a" "D:/msys64/
mingw64/lib/libSDL2.dll.a" "D:/msys64/mingw64/lib/libusb-1.0.dll.a" "-lmingw32" "-lws2_32" "-Wl,--su
bsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "
-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group"
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe
: cannot find -lasan: No such file or directory
collect2.exe: error: ld returned 1 exit status
[77/118] Compiling C object app/test_control_msg...ize.exe.p/tests_test_control_msg_serialize.c.obj
<command-line>: warning: no previous prototype for 'SDL_main' [-Wmissing-prototypes]
../app/tests/test_control_msg_serialize.c:325:5: note: in expansion of macro 'main'
  325 | int main(int argc, char *argv[]) {
      |     ^~~~



D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe
: cannot find -lasan: No such file or directory
collect2.exe: error: ld returned 1 exit status

I meet this error when I use release.sh in windows,It seems lack libasan.a file,do you have this file or it is caused by other problem?

@rom1v
Copy link
Collaborator

rom1v commented Mar 7, 2024

When releasing, tests are compiled with ASAN enabled and run locally (so that they detect memory corruption).

If your compiler/linker do not support it, you can probably just disable ASAN for tests:

diff --git a/release.mk b/release.mk
index 89f3da215..1ac045728 100644
--- a/release.mk
+++ b/release.mk
@@ -53,7 +53,7 @@ clean:
 
 test:
        [ -d "$(TEST_BUILD_DIR)" ] || ( mkdir "$(TEST_BUILD_DIR)" && \
-               meson setup "$(TEST_BUILD_DIR)" -Db_sanitize=address )
+               meson setup "$(TEST_BUILD_DIR)" )
        ninja -C "$(TEST_BUILD_DIR)"
        $(GRADLE) -p server check
 

Refs msys2/MINGW-packages#3163

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

2 participants