* [PATCH] build: Do not force diagnostics-color flag
@ 2014-12-05 0:49 Mike Auty
2014-12-16 20:46 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Mike Auty @ 2014-12-05 0:49 UTC (permalink / raw)
To: linux-modules
The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache). Instead, since -fdiagnostic-color=auto
by default in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.
Based mostly on the systemd commit f44541bc by Michal Schmidt.
---
Makefile.am | 3 +++
configure.ac | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index ea5cbac..51825f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,9 @@ BUILT_FILES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
+GCC_COLORS ?=
'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+export GCC_COLORS
+
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/libkmod \
diff --git a/configure.ac b/configure.ac
index 2709f08..f28bfed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,6 @@ CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
-Wuninitialized \
-fno-common \
-fdiagnostics-show-option \
- -fdiagnostics-color=auto \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections])
--
2.2.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] build: Do not force diagnostics-color flag
2014-12-05 0:49 [PATCH] build: Do not force diagnostics-color flag Mike Auty
@ 2014-12-16 20:46 ` Lucas De Marchi
2014-12-16 23:27 ` Mike Auty
0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2014-12-16 20:46 UTC (permalink / raw)
To: Mike Auty; +Cc: linux-modules
On Thu, Dec 4, 2014 at 10:49 PM, Mike Auty <ikelos@gentoo.org> wrote:
> The -fdiagnostics-color flag is only available on GCC >= 4.9, for
> older versions this could raise an error in certain circumstances
> (such as when using ccache). Instead, since -fdiagnostic-color=auto
> by default in gcc-4.9, simply set the required environment variable
> to the default one if it's undefined.
>
> Based mostly on the systemd commit f44541bc by Michal Schmidt.
> ---
> Makefile.am | 3 +++
> configure.ac | 1 -
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index ea5cbac..51825f0 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -11,6 +11,9 @@ BUILT_FILES =
> ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
> AM_MAKEFLAGS = --no-print-directory
>
> +GCC_COLORS ?=
> 'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
> +export GCC_COLORS
Do we really need to specify the colors ourselves? Systemd's commit
seems to only export any value in the variable to get the default
ones.
I'm fine with this approach for compatibility with gcc < 4.9, but the
patch is corrupted by your mail client.
Could you send it with git-send-email or attach it.
Thanks.
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] build: Do not force diagnostics-color flag
2014-12-16 20:46 ` Lucas De Marchi
@ 2014-12-16 23:27 ` Mike Auty
2014-12-17 2:44 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Mike Auty @ 2014-12-16 23:27 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: linux-modules
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hiya,
On 16/12/14 20:46, Lucas De Marchi wrote:
> Do we really need to specify the colors ourselves? Systemd's
> commit seems to only export any value in the variable to get the
> default ones.
No, but if the data isn't important anyway, I figured we might as well
load it with the default value as something useful for anyone that
happens to read the line. Submitting what was in the systemd patch
seemed embarrassing, but if you think it's more confusing then I'm
happy to include some bogus text of your choosing.
> I'm fine with this approach for compatibility with gcc < 4.9, but
> the patch is corrupted by your mail client. Could you send it with
> git-send-email or attach it.
Sorry about the mail client! Attached as requested...
Mike 5:)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlSQv9YACgkQu7rWomwgFXqZ8wCgqoHf5FBMg5Q+4puOD97uoRBa
EqMAnjQOnTvmIUy8GELFPP8OT+LhtW5S
=sFB/
-----END PGP SIGNATURE-----
[-- Attachment #2: 0001-build-Do-not-force-diagnostics-color-flag.patch --]
[-- Type: text/x-patch, Size: 1487 bytes --]
>From f14018096ea11757ac783089837d75ef25ac5191 Mon Sep 17 00:00:00 2001
From: Mike Auty <ikelos@gentoo.org>
Date: Fri, 5 Dec 2014 00:49:13 +0000
Subject: [PATCH] build: Do not force diagnostics-color flag
The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache). Instead, since -fdiagnostic-color=auto
by default in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.
Based mostly on the systemd commit f44541bc by Michal Schmidt.
---
Makefile.am | 3 +++
configure.ac | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index ea5cbac..51825f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,9 @@ BUILT_FILES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
+GCC_COLORS ?= 'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+export GCC_COLORS
+
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/libkmod \
diff --git a/configure.ac b/configure.ac
index 2709f08..f28bfed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,6 @@ CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
-Wuninitialized \
-fno-common \
-fdiagnostics-show-option \
- -fdiagnostics-color=auto \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections])
--
2.2.0
[-- Attachment #3: 0001-build-Do-not-force-diagnostics-color-flag.patch.sig --]
[-- Type: application/pgp-signature, Size: 72 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] build: Do not force diagnostics-color flag
2014-12-16 23:27 ` Mike Auty
@ 2014-12-17 2:44 ` Lucas De Marchi
0 siblings, 0 replies; 4+ messages in thread
From: Lucas De Marchi @ 2014-12-17 2:44 UTC (permalink / raw)
To: Mike Auty; +Cc: linux-modules
On Tue, Dec 16, 2014 at 9:27 PM, Mike Auty <ikelos@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hiya,
>
> On 16/12/14 20:46, Lucas De Marchi wrote:
>> Do we really need to specify the colors ourselves? Systemd's
>> commit seems to only export any value in the variable to get the
>> default ones.
>
> No, but if the data isn't important anyway, I figured we might as well
> load it with the default value as something useful for anyone that
> happens to read the line. Submitting what was in the systemd patch
> seemed embarrassing, but if you think it's more confusing then I'm
> happy to include some bogus text of your choosing.
The problem is that then we don't follow whatever the default becomes
when a new gcc is released. A simple "yes" instead of "oh, shiny"
would do the job, too :-)
I'm amending it to your patch and applying.
Thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-17 2:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05 0:49 [PATCH] build: Do not force diagnostics-color flag Mike Auty
2014-12-16 20:46 ` Lucas De Marchi
2014-12-16 23:27 ` Mike Auty
2014-12-17 2:44 ` Lucas De Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).