lttng-babeltrace: fix build failure on gcc14
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 28 May 2013 08:21:29 +0000 (08:21 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 28 May 2013 18:47:29 +0000 (20:47 +0200)
The gcc14 machine has a moderately old host gcc, which was causing a
recurrent build failure of host-lttng-babeltrace:

 http://autobuild.buildroot.org/results/492/49216052c161874f41738e41e6e0c89a6dd04000/build-end.log

This commit adds a patch to fix this build failure, related to the
access of the ULLONG_MAX define on compilers that did not default to
the C99 variant of the C language.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/lttng-babeltrace/lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch [new file with mode: 0644]
package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch [new file with mode: 0644]
package/lttng-babeltrace/lttng-babeltrace-no-posix-fallocate-in-uclibc.patch [deleted file]
package/lttng-babeltrace/lttng-babeltrace.mk

diff --git a/package/lttng-babeltrace/lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch b/package/lttng-babeltrace/lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch
new file mode 100644 (file)
index 0000000..d77825f
--- /dev/null
@@ -0,0 +1,37 @@
+Do not call posix_fallocate() on uClibc
+
+uClibc does not implement posix_fallocate(), and posix_fallocate() is
+mostly only an hint to the kernel that we will need such or such
+amount of space inside a file. So we just don't call posix_fallocate()
+when building against uClibc.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Peter: add #include <features.h>
+---
+ formats/ctf/ctf.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+Index: lttng-babeltrace-0.8/formats/ctf/ctf.c
+===================================================================
+--- lttng-babeltrace-0.8.orig/formats/ctf/ctf.c
++++ lttng-babeltrace-0.8/formats/ctf/ctf.c
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <features.h>
+ #include <glib.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+@@ -384,9 +385,11 @@
+               }
+               pos->content_size = -1U;        /* Unknown at this point */
+               pos->packet_size = WRITE_PACKET_LEN;
++#ifndef __UCLIBC__
+               off = posix_fallocate(pos->fd, pos->mmap_offset,
+                                     pos->packet_size / CHAR_BIT);
+               assert(off >= 0);
++#endif
+               pos->offset = 0;
+       } else {
+       read_next_packet:
diff --git a/package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch b/package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch
new file mode 100644 (file)
index 0000000..b8f31be
--- /dev/null
@@ -0,0 +1,27 @@
+Support old compilers
+
+Some old compilers do not use C99 as their default C language variant,
+for example gcc 4.3.x, which is used on some old machines. When such a
+compiler is used, by default, ULLONG_MAX is not visible. Adding
+-std=gnu99 is needed to make this definition visible.
+
+In autoconf speak, this translates into the need of using
+AC_PROC_CC_STDC instead of AC_PROG_CC. See
+http://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/C-Compiler.html
+for more details.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,7 +17,7 @@
+ AC_SYS_LARGEFILE
+ # Checks for programs.
+-AC_PROG_CC
++AC_PROG_CC_STDC
+ AC_PROG_MAKE_SET
+ LT_INIT
+ AC_PROG_YACC
diff --git a/package/lttng-babeltrace/lttng-babeltrace-no-posix-fallocate-in-uclibc.patch b/package/lttng-babeltrace/lttng-babeltrace-no-posix-fallocate-in-uclibc.patch
deleted file mode 100644 (file)
index d77825f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-Do not call posix_fallocate() on uClibc
-
-uClibc does not implement posix_fallocate(), and posix_fallocate() is
-mostly only an hint to the kernel that we will need such or such
-amount of space inside a file. So we just don't call posix_fallocate()
-when building against uClibc.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-[Peter: add #include <features.h>
----
- formats/ctf/ctf.c |    3 +++
- 1 file changed, 3 insertions(+)
-
-Index: lttng-babeltrace-0.8/formats/ctf/ctf.c
-===================================================================
---- lttng-babeltrace-0.8.orig/formats/ctf/ctf.c
-+++ lttng-babeltrace-0.8/formats/ctf/ctf.c
-@@ -32,6 +32,7 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <dirent.h>
-+#include <features.h>
- #include <glib.h>
- #include <unistd.h>
- #include <stdlib.h>
-@@ -384,9 +385,11 @@
-               }
-               pos->content_size = -1U;        /* Unknown at this point */
-               pos->packet_size = WRITE_PACKET_LEN;
-+#ifndef __UCLIBC__
-               off = posix_fallocate(pos->fd, pos->mmap_offset,
-                                     pos->packet_size / CHAR_BIT);
-               assert(off >= 0);
-+#endif
-               pos->offset = 0;
-       } else {
-       read_next_packet:
index 82376a3fe55d634f429b0aed75ff5a746e759803..d3bfc83d9f1876c63e9b550b1ab6fa9983196a8b 100644 (file)
@@ -4,5 +4,9 @@ LTTNG_BABELTRACE_SOURCE  = babeltrace-$(LTTNG_BABELTRACE_VERSION).tar.bz2
 
 LTTNG_BABELTRACE_DEPENDENCIES = popt util-linux libglib2
 
+# One patch touches configure.ac
+LTTNG_BABELTRACE_AUTORECONF = YES
+HOST_LTTNG_BABELTRACE_AUTORECONF = YES
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))