Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 308653 - =app-editors/emacs-23.1-r3 fails to build with GCC 4.5
Summary: =app-editors/emacs-23.1-r3 fails to build with GCC 4.5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Emacs project
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-4.5
  Show dependency tree
 
Reported: 2010-03-09 14:34 UTC by Daniel J.
Modified: 2010-05-25 04:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,20.05 KB, text/plain)
2010-03-10 15:20 UTC, Daniel J.
Details
emerge --info output (emerge-info.txt,4.91 KB, text/plain)
2010-03-10 15:20 UTC, Daniel J.
Details
lib-src/Makefile (Makefile,12.13 KB, text/plain)
2010-03-10 15:21 UTC, Daniel J.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel J. 2010-03-09 14:34:19 UTC
When building emacs using GCC greater than 4.4.2, the following error occurs:

make -j3 CC=x86_64-pc-linux-gnu-gcc
cd lib-src; make all - --jobserver-fds=3,4 -j                           \
          CC='x86_64-pc-linux-gnu-gcc' CFLAGS='-march=athlon64 -pipe -O2' CPPFLAGS='-D_BSD_SOURCE  ' \
          LDFLAGS='-Wl,-O1 -Wl,-znocombreloc ' MAKE='make'
make[1]: Entering directory `/var/tmp/portage/app-editors/emacs-23.1-r3/work/emacs-23.1/lib-src'
Makefile:148: *** commands commence before first target.  Stop.
make[1]: Leaving directory `/var/tmp/portage/app-editors/emacs-23.1-r3/work/emacs-23.1/lib-src'
make: *** [lib-src] Error 2

This error has apparently already been fixed upstream.  It is related to a change in the way the C preprocessor handles escaped newlines.  A patch for 23.1 can be found at the Red Hat bugzilla URL given above.  I have confirmed that the patch solves the problem.
Comment 1 Ulrich Müller gentoo-dev 2010-03-10 14:10:48 UTC
I cannot reproduce this (I've tried with both gcc 4.4.2 and gcc 4.4.3 on x86 and amd64).

Please attach your build.log and "emerge --info" output.
Comment 2 Ulrich Müller gentoo-dev 2010-03-10 14:13:54 UTC
Attach lib-src/Makefile too, please.
Comment 3 Daniel J. 2010-03-10 15:20:04 UTC
I've been using the GCC 4.5.0 SVN snapshot (from the toolchain overlay), and apparently I can no longer get 4.4.3 to work without rebuilding glibc, which I'm not really prepared to do, so I guess I can't confirm that this fails there.  I was relying on the Fedora bug to give me correct GCC version info.  Since GCC 4.5 is not officially supported by Gentoo, I suppose you could close this bug as WONTFIX, but it *will* come back to haunt us.  The failure happens every time with GCC 4.5.

In any case, I am attaching the three files you requested.
Comment 4 Daniel J. 2010-03-10 15:20:24 UTC
Created attachment 222991 [details]
build.log
Comment 5 Daniel J. 2010-03-10 15:20:42 UTC
Created attachment 222993 [details]
emerge --info output
Comment 6 Daniel J. 2010-03-10 15:21:12 UTC
Created attachment 222997 [details]
lib-src/Makefile
Comment 7 Ulrich Müller gentoo-dev 2010-03-10 16:11:44 UTC
What is the output of the testcase (from the Redhat bug):

    $ cpp --version
    $ echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | cpp
    $ echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | cpp -P
Comment 8 Daniel J. 2010-03-10 16:23:22 UTC
echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | /usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3/cpp
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
obj= foo bar baz

echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0-pre9999/cpp
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
obj= foo
 bar
 baz

echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | /usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3/cpp -P
obj= foo bar baz

echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' | /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0-pre9999/cpp -P
obj= foo bar baz
Comment 9 Daniel J. 2010-03-10 16:25:40 UTC
$ cpp --version
cpp (Gentoo SVN) 4.5.0-pre9999 20100304 (experimental) rev. 157225
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 10 Ulrich Müller gentoo-dev 2010-03-10 18:00:31 UTC
(In reply to comment #8)
> echo -e 'obj=    foo \\\n\tbar \\\n\tbaz\n' |
> /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0-pre9999/cpp
> # 1 "<stdin>"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "<stdin>"
> obj= foo
>  bar
>  baz

Unless I completely misunderstand the C99 standard, this is broken behaviour. For example, http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf says in section 5.1.1.2 "Translation phases":

| Each instance of a backslash character (\) immediately followed by a
| new-line character is deleted, splicing physical source lines to form
| logical source lines.

Reassigning to gcc-porting.
Comment 11 Ulrich Müller gentoo-dev 2010-03-10 19:14:05 UTC
(In reply to comment #10)
> Reassigning to gcc-porting.

Should rather be toolchain since it's a bug in GCC itself.
Comment 12 Daniel J. 2010-03-10 20:09:07 UTC
According to GCC's bugzilla, this is as designed:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41748
Comment 13 Ryan Hill (RETIRED) gentoo-dev 2010-03-10 22:53:02 UTC
gcc-porting bugs should be assigned to the maintainer of the package and block the appropriate gcc-porting tracker.

this has been fixed upstream so it is a bug in the package.  it's up to you if you want to patch it or wait for a new version to be released with this fix before 4.5 is added to the tree.  please leave this bug open if you decide not to so we can track what needs to be done before 4.5 is added.  in the meantime i'll add this patch to the gcc-porting overlay.
Comment 14 Ulrich Müller gentoo-dev 2010-03-11 10:26:22 UTC
(In reply to comment #12)
> According to GCC's bugzilla, this is as designed:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41748

I still think that it violates the standard, which explicitly says that backslash-newline is deleted. Anyway, adding the -P option shouldn't harm, so I've done this now. No revbump because it is a build-time issue.

Could you please verify if all SLOTs (i.e. 18, 21, 22, 23) of app-editors/emacs build with GCC 4.5?
Comment 15 Daniel J. 2010-03-11 13:34:29 UTC
app-editors/emacs:18, app-editors/emacs:21 and app-editors/emacs:22 all build successfully for me with gcc 4.5.
Comment 16 Daniel J. 2010-03-11 13:34:57 UTC
as does 23, of course.  Many thanks!
Comment 17 Ulrich Müller gentoo-dev 2010-03-11 13:47:09 UTC
Thank you for testing, and for reporting the issue.
Comment 18 Michael Weber (RETIRED) gentoo-dev 2010-05-25 01:06:56 UTC
This also affects 23.1-r2, the current stable, -r3 build fine now.
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2010-05-25 04:09:26 UTC
yes, building stable packages with as-yet-unkeyworded compilers can never be expected to work.