From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6597 invoked by alias); 18 Jan 2013 13:00:38 -0000 Received: (qmail 6573 invoked by uid 22791); 18 Jan 2013 13:00:36 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.salomon.at (HELO smtp.salomon.at) (193.186.16.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jan 2013 13:00:27 +0000 Received: from samail03.wamas.com ([172.28.2.2] helo=mailhost.salomon.at) by smtp.salomon.at with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77) (envelope-from ) id 1TwBYW-0008Hx-DL for gcc-patches@gcc.gnu.org; Fri, 18 Jan 2013 14:00:25 +0100 Received: from [172.28.8.170] by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1TwBYW-0006in-Av; Fri, 18 Jan 2013 14:00:24 +0100 Message-ID: <50F94768.8060700@salomon.at> Date: Fri, 18 Jan 2013 13:00:00 -0000 From: Michael Haubenwallner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120327 Thunderbird/10.0.3 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH] Unset M4 environment variable for flex Content-Type: multipart/mixed; boundary="------------040708080209020800010306" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00960.txt.bz2 This is a multi-part message in MIME format. --------------040708080209020800010306 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1841 Hi, not sure if that is intentional though, but gcc-4.8-20130113 snapshot does /not/ ship with gcc/gengtype-lex.c. I've expected the FLEX=/path/to/flex environment variable to be enough, as it is not in PATH here on AIX. But alas, this creates an empty gcc/gengtype-lex.c, resulting in: ld: 0711-317 ERROR: Undefined symbol: lexer_line ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**) ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*) ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done ld: 0711-317 ERROR: Undefined symbol: .yyend() ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status gmake[3]: *** [build/gengtype] Error 1 Searching upwards in the build log (single job), there is: /path/to/flex -ogengtype-lex.c /path/to/src/gcc-4.8-20130113/gcc/gengtype-lex.l && { \ echo '#include "bconfig.h"' > gengtype-lex.c.tmp; \ cat gengtype-lex.c >> gengtype-lex.c.tmp; \ mv gengtype-lex.c.tmp gengtype-lex.c; \ } m4: illegal option -- P Usage: m4 [-els] [-B Number] [-D Name[=Value]]... [-H Number] [-I Directory] [-S Number] [-T Number] [-U Name]... [File...] gmake[3]: [gengtype-lex.c] Error 141 (ignored) Actually, flex does prefer the M4 environment variable over its builtin path to run m4 from. But configure does set M4=m4, found via PATH as /usr/bin/m4, which obviously is not GNU m4. In my opinion, it is more robust to unset M4 environment variable before running $(FLEX) than expecting users to also set M4 when gcc actually tells missing flex only. Thank you! /haubi/ 2013-01-18 Michael Haubenwallner Flex gives M4 environment variable precedence over builtin path to m4. * gcc/Makefile.in: Unset M4 environment variable before running flex. --------------040708080209020800010306 Content-Type: text/x-patch; name="flex-without-m4-env.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="flex-without-m4-env.patch" Content-length: 534 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 55b4d2d..66b4e96 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3990,7 +3990,7 @@ $(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o # bconfig.h because AIX requires _LARGE_FILES to be defined before # any system header is included. gengtype-lex.c : gengtype-lex.l - -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \ + -unset M4; $(FLEX) $(FLEXFLAGS) -o$@ $< && { \ echo '#include "bconfig.h"' > $@.tmp; \ cat $@ >> $@.tmp; \ mv $@.tmp $@; \ --------------040708080209020800010306--