Re: [hatari-devel] ASAN linking problem with Previous |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Subject: Re: [hatari-devel] ASAN linking problem with Previous
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 14 Sep 2025 17:33:59 +0000
- Cc: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.de; s=2017; t=1757871239; bh=C+Vvkr2oO4QUE8FzVkZxTIWERyQLShtZv0RfbQhzW/4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=EEa38TgfELK8Jn7xFqCvAeg0DEvBB//FxnRxFx/jd7JVFCcOT1MkPB9i6isPr1/2z QJuzaz6jH/DzbrEeUAncnJaHINaRo/d5+LwJfnmWCYc+VSqO/C8Mpqij+WLjEGM7jz e7dFHUF//N+1aJO5D6pHEXKfjrZONk9ekxjoo2ejY5UUnrjvj9DZFqQF+gd28/larX umy2VzMUJP8w1KmGrAThFVsLjlzoXPbY4UAydBQweJ5msDQEfOxAs3HiZUWE/mxJcN sOk+cDNSTrXj6Hi76tiqgFyTB9o9BR76WWanXMbgXad25K89N6JGWG2LArV+Qc5k6m l5Ng4VhW/BAWQ==
Am Sat, 13 Sep 2025 21:15:54 +0200
schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
> > Am 13.09.2025 um 20:51 schrieb Thomas Huth <th.huth@xxxxxxxxx>:
> >
> > Am Sat, 13 Sep 2025 09:01:10 +0200
> > schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
> >
> >> Hello all,
> >>
> >> it seems Previous is having a linking problem if ASAN is enabled. When I try to compile I get lots of error from this kind (see below). This happens although I added enable_testing() just like Hatari does.
> >>
> >> Does anyone have an idea what I might do wrong? If I apply the appended patch it seems to work. No problems when compiling Hatari.
> >
> > No clue ... it seems to work when I compile Previous on Linux, so likely
> > something specific to macOS?
> >
> > Thomas
> >
> Interesting! Did you compile trunk?
Ah, well, no, I compiled your softloat branch, out of habit. But looks like
you already commit your fix there. When I compile trunk on Linux, I also
get these linking errors.
I guess it's because you're using C++ code in Previous, so the linking is
done in C++ mode. But the logic in CMakeLists.txt currently only adds the
flag to the CFLAGS, not to the CXXFLAGS.
A patch like this seems to fix the issue, too:
--- CMakeLists.txt (Revision 1727)
+++ CMakeLists.txt (Arbeitskopie)
@@ -216,6 +216,7 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
# enable AddressSanitizer with global variable tracking
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif(ENABLE_ASAN)
# GCC/Clang undefined behavior debugging
HTH,
Thomas