m68k: Fix build with -mcpu=68040 or higher (BZ 30740)

GCC currently does not define __mc68020__ for -mcpu=68040 or higher,
which memcpy/memmove assumptions.  Since this memory copy optimization
seems only intended for m68020, disable for other m680X0 variants.

Checked on a build for m68k-linux-gnu target mc68020 and mc68040.
This commit is contained in:
Adhemerval Zanella 2023-08-18 14:59:51 -03:00
parent 3d9265467e
commit b85880633f
2 changed files with 21 additions and 1 deletions

View File

@ -1 +0,0 @@
/* Empty, not needed. */

21
sysdeps/m68k/wordcopy.c Normal file
View File

@ -0,0 +1,21 @@
/* Definitions for memory copy functions. Motorola 680X0 version
Copyright (C) 2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
#ifndef __mc68020__
# include <string/wordcopy.c>
#endif