18.09.2023 17:05, Helge Deller wrote:
On 9/12/23 12:34, Michael Tokarev wrote:
12.09.2023 12:45, Helge Deller:
/usr/bin/ld:
/usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/libc.a(abort.o): in
function `abort':
(.text.unlikely+0x0): multiple definition of `abort';
libqemu-aarch64-linux-user.fa.p/linux-user_signal.c.o:/srv/_build/../../home/cvs/qemu/qemu/linux-user/signal.c:723:
first defined here
[PATCH v4 03/10] linux-user: Use die_with_signal with abort
Sigh.
I'd be double-cautious when overriding system functions like this, - it's
almost always a bad idea.
Richard, I'm not sure, but with that change:
-void abort(void)
+void __attribute__((weak)) abort(void)
it will at least successfully link the binary. Not sure which effects it has,
but probably not worse than before your patch series...
With weak here, ld should peak abort() from glibc, basically reverting this
patch:
linux-user: Use die_with_signal with abort
+/*
+ * The system abort() will raise SIGABRT, which will get caught and deferred
+ * by host_signal_handler. Returning into system abort will try harder.
+ * Eventually, on x86, it will execute HLT, which raises SIGSEGV. This goes
+ * back into host_signal_handler, through a different path which may longjmp
+ * back to the main loop. This often explodes.
+ */
+void abort(void)
+{
+ die_with_signal(SIGABRT);
+}
+
I think it's better to revert it now.