Skip to content

Commit

Permalink
Fix build of C mempcpy and stpcpy.
Browse files Browse the repository at this point in the history
This patch fixes the build of C mempcpy and stpcpy by disabling the
redirection to __mempcpy and __stpcpy asm names if
NO_MEMPCPY_STPCPY_REDIRECT is defined, and defining that macro in the
relevant source files.

Tested for powerpc32 that the build is fixed.

	* include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not
	redeclare with asm name.
	[NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise.
	* string/mempcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Define before
	including <string.h>.
	* string/stpcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
	[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
	[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
	[SHARED && !NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
  • Loading branch information
Joseph Myers committed Nov 14, 2014
1 parent bf43838 commit c1b0aad
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2014-11-14 Joseph Myers <joseph@codesourcery.com>

* include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not
redeclare with asm name.
[NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise.
* string/mempcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Define before
including <string.h>.
* string/stpcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
[SHARED && !NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.

2014-11-13 Joseph Myers <joseph@codesourcery.com>

* stdlib/strtol.c (__strtol): Use prototype definition.
Expand Down
3 changes: 2 additions & 1 deletion include/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ libc_hidden_builtin_proto (strspn)
libc_hidden_builtin_proto (strstr)
libc_hidden_builtin_proto (ffs)

#if defined NOT_IN_libc || !defined SHARED
#if (defined NOT_IN_libc || !defined SHARED) \
&& !defined NO_MEMPCPY_STPCPY_REDIRECT
/* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
__mempcpy and __stpcpy if not inlined. */
extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
Expand Down
1 change: 1 addition & 0 deletions string/mempcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */

#define NO_MEMPCPY_STPCPY_REDIRECT
#include <string.h>

#undef mempcpy
Expand Down
1 change: 1 addition & 0 deletions string/stpcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# include <config.h>
#endif

#define NO_MEMPCPY_STPCPY_REDIRECT
#include <string.h>

#undef __stpcpy
Expand Down
1 change: 1 addition & 0 deletions sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */

#ifndef NOT_IN_libc
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
Expand Down
1 change: 1 addition & 0 deletions sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */

#ifndef NOT_IN_libc
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
Expand Down
1 change: 1 addition & 0 deletions sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */

#if defined SHARED && !defined NOT_IN_libc
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
Expand Down

0 comments on commit c1b0aad

Please sign in to comment.