Closed mikrosk closed 5 months ago
Is this OK?
I think yes. The configure script checks for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
being defined, and that is set here:
https://github.com/freemint/m68k-atari-mint-gcc/blob/4598322acf7f9abe94721449c100f782185f05df/gcc/c-family/c-cppbuiltin.c#L644-L654
HAVE_atomic_compare_and_swap is defined indirectly by https://github.com/freemint/m68k-atari-mint-gcc/blob/4598322acf7f9abe94721449c100f782185f05df/gcc/config/m68k/sync.md#L21 only for TARGET_CAS, so only for m68020
Falling back to mutexes is of course sub-optimal, but there is actually no other instruction for m68k that guarantees atomic operation. Question is only whether that is relevant on a single-threaded system.
Thanks for the quick check.
Any idea where the flood of warnings comes from?
Maybe something missing in your patch? I don't get that warnings when compiling from my repo.
Edit: see https://github.com/freemint/m68k-atari-mint-gcc/blob/b3351d5c9bd987f52f7ece55713b855656d5cb86/libgcc/config/m68k/mint-atomic.c#L83 vs https://github.com/th-otto/m68k-atari-mint-gcc/blob/25ba96f5a5dff3a9b09ca44d6bb5d23468d36da9/libgcc/config/m68k/mint-atomic.c#L87
It wasn't missing as such, it's just you pushed an updated version of mint-atomic.c into your gcc-13 branch while Vincent backported the original gcc-7 patch into gcc-13.
I see there's a lot of changes (even directly mint-related) in your gcc-13 branch but I'm unable to judge their usefulness (especially if they come from your initial m68k-atari-mintelf commit) so if you can think of similarly useful (and ideally mintelf specific only) we can consider adding it to the official branch as well.
That's why i made up this list : https://github.com/freemint/m68k-atari-mint-gcc/issues/17
BTW, a few day ago, gcc 13.3.0 was released.
FYI, I upgraded my mintelf branch yesterday with GCC 13.3.0, and I rebuilt my Ubuntu binaries.
You can see the build log. And indeed, the many mint-atomic.c
warnings are present.
The mint-atomic.c
file comes from that commit: https://github.com/vinriviere/m68k-atari-mint-gcc/commit/e433e054077fcd2a3c4eda1e8f65ceee209218bd
It mentions @th-otto as author and @mikrosk as committer. I haven't hacked that file.
Yes that file was originally for gcc-7, but when porting it to gcc-13 i think i had to adapt it a bit. But since this functions are not called directly, but by compiler builtins emitting library calls, i think those warnings are harmless, just irritating and annoying.
Edit: i see --with-sysroot=$PWD/sys-root
in the log file. Are you sure this was intended?
Anyway, it's pushed to our branch now, so feel free to fast-forward it.
Edit: i see
--with-sysroot=$PWD/sys-root
in the log file. Are you sure this was intended?
This is a mistake, about another topic discussed in https://github.com/freemint/m68k-atari-mint-gcc/issues/38 . I will fix it later.
Anyway, it's pushed to our branch now, so feel free to fast-forward it.
Thanks, I've just cherry-picked it to my gcc-13-mintelf branch.
I have just noticed this difference: for -m68000 and -mcpu=5475 multilibs the error from title can be seen in config.log. This results in using "checking for lock policy for shared_ptr reference counts ...
mutex
" instead ofatomic
. For -m68020-60 it results inatomic
(and the config.log test succeeds).Is this OK?
Also, while we are at it, mint-atomic.c complains quite a lot during compilation: