win32: avoid discarding the exception handler
In all likelihood, the compiler with lto doesn't see the function being used, from assembly macro __try1. Help it by marking the function has being used. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1904 Fixes: commitd89f30b4df
("win32: wrap socket close() with an exception handler") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> (cherry picked from commit75b773d84c
) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (mjt: trivial context fixup in include/qemu/compiler.h)
This commit is contained in:
parent
1e5839828d
commit
ab6314506d
@ -197,4 +197,10 @@
|
||||
#define BUILTIN_SUBCLL_BROKEN
|
||||
#endif
|
||||
|
||||
#if __has_attribute(used)
|
||||
# define QEMU_USED __attribute__((used))
|
||||
#else
|
||||
# define QEMU_USED
|
||||
#endif
|
||||
|
||||
#endif /* COMPILER_H */
|
||||
|
@ -479,7 +479,7 @@ int qemu_bind_wrap(int sockfd, const struct sockaddr *addr,
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXCEPTION_DISPOSITION
|
||||
QEMU_USED EXCEPTION_DISPOSITION
|
||||
win32_close_exception_handler(struct _EXCEPTION_RECORD *exception_record,
|
||||
void *registration, struct _CONTEXT *context,
|
||||
void *dispatcher)
|
||||
|
Loading…
Reference in New Issue
Block a user