Message ID | 20160824075705.7148-1-jeremy.rosen@smile.fr |
---|---|
State | New, archived |
Headers |
Received: (qmail 108141 invoked by alias); 24 Aug 2016 07:57:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 108132 invoked by uid 89); 24 Aug 2016 07:57:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=HCc:D*fr, CC, his, Hx-spam-relays-external:ESMTPA X-HELO: idris.smile.fr From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr> To: libc-alpha@sourceware.org Cc: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr> Subject: [PATCH] locale: fix hard-coded reference to gcc -E Date: Wed, 24 Aug 2016 09:57:05 +0200 Message-Id: <20160824075705.7148-1-jeremy.rosen@smile.fr> |
Commit Message
Jérémy Rosen
Aug. 24, 2016, 7:57 a.m. UTC
When new version of compilers are published, they may not be compatible with older versions of software. This is particularly common when software is built with -Werror. Autotools provides a way for a user to specify the name of his compiler using a set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when compiling glibc but the script used to generate transliterations in the locale/ subdirectory directly calls the gcc binary to get the output of the preprocessor instead of using the $CPP variable provided by the build environment. This patch replaces the hard-coded reference to the gcc binary with the proper environment variable, thus allowing a user to override it. --- locale/gen-translit.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 24 Aug 2016 09:57, Jérémy Rosen wrote: > When new version of compilers are published, they may not be compatible with > older versions of software. This is particularly common when software is built > with -Werror. > > Autotools provides a way for a user to specify the name of his compiler using a > set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when > compiling glibc but the script used to generate transliterations in the locale/ > subdirectory directly calls the gcc binary to get the output of the > preprocessor instead of using the $CPP variable provided by the build > environment. > > This patch replaces the hard-coded reference to the gcc binary with the proper > environment variable, thus allowing a user to override it. > > > --- > locale/gen-translit.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl > index 30d3f2f..7b287fa 100644 > --- a/locale/gen-translit.pl > +++ b/locale/gen-translit.pl > @@ -1,5 +1,5 @@ > #!/usr/bin/perl -w > -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file"; > +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file"; should this go even further with: ${CPP:-${CC} -E} -mike
On 24/08/2016 19:39, Mike Frysinger wrote: > On 24 Aug 2016 09:57, Jérémy Rosen wrote: [...] >> >> diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl >> index 30d3f2f..7b287fa 100644 >> --- a/locale/gen-translit.pl >> +++ b/locale/gen-translit.pl >> @@ -1,5 +1,5 @@ >> #!/usr/bin/perl -w >> -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file"; >> +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file"; > should this go even further with: > ${CPP:-${CC} -E} > -mike I'm not sure this is a good idea... $CC and $CPP are normally both set by autotools, so the chance of CC being set and not CPP are pretty low. This happens if someone manually runs the script and explicitely sets $CC but not $CPP. A rare case since the script itself doesn't use $CC anywhere else. moreover, if the script is run manually, the chances are high that $CC won't be set at all. An even more conservative ${CPP:-{CC:-gcc} -E} would cover all bases, but I personally think it makes things unreadable for no real-world gain. This is, of course, a matter of taste and I will gladly submit a V2 with this change if that is the recommanded way Regards Jeremy
Any news ? On 24/08/2016 09:57, Jérémy Rosen wrote: > When new version of compilers are published, they may not be compatible with > older versions of software. This is particularly common when software is built > with -Werror. > > Autotools provides a way for a user to specify the name of his compiler using a > set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when > compiling glibc but the script used to generate transliterations in the locale/ > subdirectory directly calls the gcc binary to get the output of the > preprocessor instead of using the $CPP variable provided by the build > environment. > > This patch replaces the hard-coded reference to the gcc binary with the proper > environment variable, thus allowing a user to override it. > > > --- > locale/gen-translit.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl > index 30d3f2f..7b287fa 100644 > --- a/locale/gen-translit.pl > +++ b/locale/gen-translit.pl > @@ -1,5 +1,5 @@ > #!/usr/bin/perl -w > -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file"; > +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file"; > > > sub cstrlen {
Any news On 02/09/2016 08:54, Jérémy Rosen wrote: > Any news ? > > > On 24/08/2016 09:57, J�r�my Rosen wrote: >> When new version of compilers are published, they may not be compatible with >> older versions of software. This is particularly common when software is built >> with -Werror. >> >> Autotools provides a way for a user to specify the name of his compiler using a >> set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when >> compiling glibc but the script used to generate transliterations in the locale/ >> subdirectory directly calls the gcc binary to get the output of the >> preprocessor instead of using the $CPP variable provided by the build >> environment. >> >> This patch replaces the hard-coded reference to the gcc binary with the proper >> environment variable, thus allowing a user to override it. >> >> >> --- >> locale/gen-translit.pl | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl >> index 30d3f2f..7b287fa 100644 >> --- a/locale/gen-translit.pl >> +++ b/locale/gen-translit.pl >> @@ -1,5 +1,5 @@ >> #!/usr/bin/perl -w >> -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file"; >> +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file"; >> >> >> sub cstrlen { > >
still no news ? This is a simple one-line fix which only affects build time... Thx Jérémy Rosen On 12/09/2016 17:58, Jérémy Rosen wrote: > Any news > > > On 02/09/2016 08:54, Jérémy Rosen wrote: >> Any news ? >> >> >> On 24/08/2016 09:57, J�r�my Rosen wrote: >>> When new version of compilers are published, they may not be >>> compatible with >>> older versions of software. This is particularly common when >>> software is built >>> with -Werror. >>> >>> Autotools provides a way for a user to specify the name of his >>> compiler using a >>> set of variables ($CC $CXX $CPP etc.). Those variables are used >>> correctly when >>> compiling glibc but the script used to generate transliterations in >>> the locale/ >>> subdirectory directly calls the gcc binary to get the output of the >>> preprocessor instead of using the $CPP variable provided by the build >>> environment. >>> >>> This patch replaces the hard-coded reference to the gcc binary with >>> the proper >>> environment variable, thus allowing a user to override it. >>> >>> >>> --- >>> locale/gen-translit.pl | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl >>> index 30d3f2f..7b287fa 100644 >>> --- a/locale/gen-translit.pl >>> +++ b/locale/gen-translit.pl >>> @@ -1,5 +1,5 @@ >>> #!/usr/bin/perl -w >>> -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot >>> preprocess input file"; >>> +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot >>> preprocess input file"; >>> sub cstrlen { >> >> > >
diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl index 30d3f2f..7b287fa 100644 --- a/locale/gen-translit.pl +++ b/locale/gen-translit.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file"; +open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file"; sub cstrlen {