* [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS.
@ 2012-04-19 12:01 Pedro Alves
2012-04-19 12:21 ` Pedro Alves
2012-04-19 13:18 ` Pedro Alves
0 siblings, 2 replies; 3+ messages in thread
From: Pedro Alves @ 2012-04-19 12:01 UTC (permalink / raw)
To: gdb-patches
Building gdbserver for i686-pc-mingw32 with the future gnulib wrapper
showed that both gdbserver and gnulib were checking for the memmem
declaration, and defining HAVE_DECL_MEMMEM.
i686-pc-mingw32-gcc -c -g -O2 -D__USE_MINGW_ACCESS -I../../../src/gdb/gdbserver/../gnulib -Ibuild-gnulib/gnulib -I../../../src/gdb/gdbserver/../../include -I. -I../../../src/gdb/gdbserver -I../../../src/gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror version.c
In file included from ../../../src/gdb/gdbserver/server.h:24:0,
from i386-avx.c:23:
./config.h:28:0: error: "HAVE_DECL_MEMMEM" redefined [-Werror]
../../../src/gdb/gdbserver/build-gnulib/config.h:45:0: note: this is the location of the previous definition
The gdbserver check was made unnecessary when it started using gnulib.
Applied.
2012-04-19 Pedro Alves <palves@redhat.com>
* configure.ac: Remove AC_CHECK_DECLS check for memmem.
* server.h (memmem): Remove declaration.
* config.in: Regenerate.
* configure: Regenerate.
---
gdb/gdbserver/config.in | 4 ----
gdb/gdbserver/configure | 10 ----------
gdb/gdbserver/configure.ac | 2 +-
gdb/gdbserver/server.h | 4 ----
4 files changed, 1 insertions(+), 19 deletions(-)
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index ffa4afb..26742ac 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -22,10 +22,6 @@
you don't. */
#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't.
- */
-#undef HAVE_DECL_MEMMEM
-
/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
*/
#undef HAVE_DECL_PERROR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 25d1812..cdd54f1 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -5139,16 +5139,6 @@ fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_PERROR $ac_have_decl
_ACEOF
-ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
-if test "x$ac_cv_have_decl_memmem" = x""yes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MEMMEM $ac_have_decl
-_ACEOF
ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default"
if test "x$ac_cv_have_decl_vasprintf" = x""yes; then :
ac_have_decl=1
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index ac8223a..96a5f2d 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -167,7 +167,7 @@ AC_TRY_LINK([
[AC_MSG_RESULT(no)])
fi
-AC_CHECK_DECLS([strerror, perror, memmem, vasprintf, vsnprintf])
+AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index a419c36..49f94d0 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -59,10 +59,6 @@ extern void perror (const char *);
#endif
#endif
-#if !HAVE_DECL_MEMMEM
-extern void *memmem (const void *, size_t , const void *, size_t);
-#endif
-
#if !HAVE_DECL_VASPRINTF
extern int vasprintf(char **strp, const char *fmt, va_list ap);
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS.
2012-04-19 12:01 [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS Pedro Alves
@ 2012-04-19 12:21 ` Pedro Alves
2012-04-19 13:18 ` Pedro Alves
1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2012-04-19 12:21 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On 04/19/2012 11:24 AM, Pedro Alves wrote:
> 2012-04-19 Pedro Alves <palves@redhat.com>
>
> * configure.ac: Remove AC_CHECK_DECLS check for memmem.
> * server.h (memmem): Remove declaration.
> * config.in: Regenerate.
> * configure: Regenerate.
This actually breaks the build on Windows ...
../../../src/gdb/gdbserver/server.c: In function 'handle_search_memory_1':
../../../src/gdb/gdbserver/server.c:757:7: error: implicit declaration of function 'memmem' [-Werror=implicit-function-declaration]
../../../src/gdb/gdbserver/server.c:757:17: error: assignment makes pointer from integer without a cast [-Werror]
because nothing is pointing the compiler at gnulib's build directory, which
contains the generated replacement headers (string.h in this case), which contain
the memmem declaration for systems that need it, such as mingw32.
Missed it before because I had originally written that patch against the
new wrapper gnulib, which didn't have this bug.
This fixes it. Applied.
Note GDB does the exact same thing (discounting the source path difference):
INCGNU = -I$(srcdir)/gnulib -Ignulib
2012-04-19 Pedro Alves <palves@redhat.com>
* Makefile.in (INCGNU): Add -Ignulib.
---
gdb/gdbserver/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 94b9cae..1e78f98 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -77,7 +77,7 @@ ustinc = @ustinc@
# gnulib
LIBGNU = gnulib/libgnu.a
-INCGNU = -I$(srcdir)/../gnulib
+INCGNU = -I$(srcdir)/../gnulib -Ignulib
# We build gnulib directly under the gdbserver build directory, but
# its sources don't live directly under gdbserver's source directory.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS.
2012-04-19 12:01 [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS Pedro Alves
2012-04-19 12:21 ` Pedro Alves
@ 2012-04-19 13:18 ` Pedro Alves
1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2012-04-19 13:18 UTC (permalink / raw)
To: gdb-patches
On 04/19/2012 11:24 AM, Pedro Alves wrote:
> 2012-04-19 Pedro Alves <palves@redhat.com>
>
> * configure.ac: Remove AC_CHECK_DECLS check for memmem.
> * server.h (memmem): Remove declaration.
> * config.in: Regenerate.
> * configure: Regenerate.
And ... this breaks the build on Windows due to an already existing bug...
Fixing.
--
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-19 12:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 12:01 [PATCH] memmem removed from gdbserver's AC_CHECK_DECLS Pedro Alves
2012-04-19 12:21 ` Pedro Alves
2012-04-19 13:18 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox