* [Buildroot] [PATCH] lttng-babeltrace: fix build failure on gcc14
@ 2013-05-28 13:22 Thomas Petazzoni
2013-05-28 13:29 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2013-05-28 13:22 UTC (permalink / raw)
To: buildroot
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>
---
...beltrace-01-no-posix-fallocate-in-uclibc.patch} | 0
...tng-babeltrace-02-fix-build-old-compilers.patch | 27 ++++++++++++++++++++
package/lttng-babeltrace/lttng-babeltrace.mk | 4 +++
3 files changed, 31 insertions(+)
rename package/lttng-babeltrace/{lttng-babeltrace-no-posix-fallocate-in-uclibc.patch => lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch} (100%)
create mode 100644 package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch
diff --git a/package/lttng-babeltrace/lttng-babeltrace-no-posix-fallocate-in-uclibc.patch b/package/lttng-babeltrace/lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch
similarity index 100%
rename from package/lttng-babeltrace/lttng-babeltrace-no-posix-fallocate-in-uclibc.patch
rename to package/lttng-babeltrace/lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch
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
index 0000000..b8f31be
--- /dev/null
+++ b/package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch
@@ -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.mk b/package/lttng-babeltrace/lttng-babeltrace.mk
index 82376a3..a68320c 100644
--- a/package/lttng-babeltrace/lttng-babeltrace.mk
+++ b/package/lttng-babeltrace/lttng-babeltrace.mk
@@ -4,5 +4,9 @@ LTTNG_BABELTRACE_SOURCE = babeltrace-$(LTTNG_BABELTRACE_VERSION).tar.bz2
LTTNG_BABELTRACE_DEPENDENCIES = popt util-linux libglib2
+# We patch configure.ac to fix a problem that appears
+# only with some old host gcc
+HOST_LTTNG_BABELTRACE_AUTORECONF = YES
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] lttng-babeltrace: fix build failure on gcc14
2013-05-28 13:22 [Buildroot] [PATCH] lttng-babeltrace: fix build failure on gcc14 Thomas Petazzoni
@ 2013-05-28 13:29 ` Peter Korsgaard
2013-05-28 13:32 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2013-05-28 13:29 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Thomas> The gcc14 machine has a moderately old host gcc, which was causing a
Thomas> recurrent build failure of host-lttng-babeltrace:
Thomas> http://autobuild.buildroot.org/results/492/49216052c161874f41738e41e6e0c89a6dd04000/build-end.log
Thomas> This commit adds a patch to fix this build failure, related to the
Thomas> access of the ULLONG_MAX define on compilers that did not default to
Thomas> the C99 variant of the C language.
Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas> ---
Thomas> ...beltrace-01-no-posix-fallocate-in-uclibc.patch} | 0
Thomas> ...tng-babeltrace-02-fix-build-old-compilers.patch | 27 ++++++++++++++++++++
Thomas> package/lttng-babeltrace/lttng-babeltrace.mk | 4 +++
Thomas> 3 files changed, 31 insertions(+)
Thomas> rename package/lttng-babeltrace/{lttng-babeltrace-no-posix-fallocate-in-uclibc.patch => lttng-babeltrace-01-no-posix-fallocate-in-uclibc.patch} (100%)
Thomas> create mode 100644 package/lttng-babeltrace/lttng-babeltrace-02-fix-build-old-compilers.patch
Thomas> +++ b/package/lttng-babeltrace/lttng-babeltrace.mk
Thomas> @@ -4,5 +4,9 @@ LTTNG_BABELTRACE_SOURCE = babeltrace-$(LTTNG_BABELTRACE_VERSION).tar.bz2
Thomas> LTTNG_BABELTRACE_DEPENDENCIES = popt util-linux libglib2
Thomas> +# We patch configure.ac to fix a problem that appears
Thomas> +# only with some old host gcc
Thomas> +HOST_LTTNG_BABELTRACE_AUTORECONF = YES
The patch also gets applied for target builds. Don't we need to
autoreconf there as well?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] lttng-babeltrace: fix build failure on gcc14
2013-05-28 13:29 ` Peter Korsgaard
@ 2013-05-28 13:32 ` Thomas Petazzoni
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2013-05-28 13:32 UTC (permalink / raw)
To: buildroot
Dear Peter Korsgaard,
On Tue, 28 May 2013 15:29:42 +0200, Peter Korsgaard wrote:
> Thomas> +# We patch configure.ac to fix a problem that appears
> Thomas> +# only with some old host gcc
> Thomas> +HOST_LTTNG_BABELTRACE_AUTORECONF = YES
>
> The patch also gets applied for target builds. Don't we need to
> autoreconf there as well?
I was focused on the host gcc problem, but if the user decides to use
an old gcc as the cross-compiler, then there may be the same issue.
And anyway, patching configure.ac without doing the autoreconf means
that at build time, the thing will notice that configure.ac is more
recent than configure, and will do some kind of autoreconf.
So yes, adding LTTNG_BABELTRACE_AUTORECONF = YES is probably a good
thing to do.
BTW:
* I've submitted the patch upstream. See
http://lists.lttng.org/pipermail/lttng-dev/2013-May/020542.html and
http://lists.lttng.org/pipermail/lttng-dev/2013-May/020543.html.
* This host/target difference on autoreconf will disappear with the
out-of-tree stuff, since we'll have only one source tree.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-28 13:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28 13:22 [Buildroot] [PATCH] lttng-babeltrace: fix build failure on gcc14 Thomas Petazzoni
2013-05-28 13:29 ` Peter Korsgaard
2013-05-28 13:32 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox