GNU bug report logs - #9705
24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2

Previous Next

Package: emacs;

Reported by: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>

Date: Sat, 8 Oct 2011 21:12:01 UTC

Severity: normal

Tags: notabug

Merged with 11236

Found in versions 24.0.90, 24.1.50

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9705 in the body.
You can then email your comments to 9705 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Sat, 08 Oct 2011 21:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 08 Oct 2011 21:12:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
Date: Sat, 8 Oct 2011 23:08:20 +0200
Hello!

It works to compile GNU Emacs 24.0.90 with standard GCC 4.5.3 on Mac  
OS X 10.5.8 (Leopard) with PowerPC 7447A, but not with the Apple  
modified compilers (with support for Apple frameworks, for compilation  
for a few different architectures at the same time, -fast optimiser  
switch, etc.). The configure command was:

	env LANG=C PATH=/sw/bin:$PATH ./configure --without-sound --without- 
dbus --without-pop --without-gconf --without-gpm --without-gsettings -- 
without-gif --without-jpeg --without-png --without-rsvg --without-tiff  
--without-xpm --with-wide-int --with-x-toolkit=athena --x-libraries=/ 
usr/X11/lib --x-includes=/usr/X11/include --enable-locallisppath=/ 
Library/Application\ Support/Emacs/calendar24:/Library/Application\  
Support/Emacs CFLAGS="-g -H -pipe -fPIC -fno-common -mcpu=7450 - 
mtune=7450 -maltivec -faltivec -mabi=altivec -fast -mfused-madd - 
mmultiple -ftree-vectorize -mpowerpc-gfxopt" LDFLAGS="-Wl,- 
dead_strip_dylibs -Wl,-bind_at_load -Wl,-t"

Here are start and finish of the compilations:

cd lib; gmake all -k                           \
	  CC='gcc-4.0 -std=gnu99 -I/sw/include -L/sw/lib' CFLAGS='-g -H -pipe  
-fPIC -fno-common -mcpu=7450 -mtune=7450 -maltivec -faltivec - 
mabi=altivec -fast -mfused-madd -mmultiple -ftree-vectorize -mpowerpc- 
gfxopt' CPPFLAGS='' \

Loading loadup.el (source)...
Using load-path (.../emacs-24.0.90/lisp .../emacs-24.0.90/lisp/emacs- 
lisp .../emacs-24.0.90/lisp/language .../emacs-24.0.90/lisp/ 
international .../emacs-24.0.90/lisp/textmodes)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version.el (source)...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading cus-start...
Loading international/mule...
Loading international/mule-conf...
Loading env...
Loading format...
Loading bindings...
Loading window...
Loading files...
Loading cus-face...
Loading faces...
Loading button...
Loading startup...
Loading .../emacs-24.0.90/lisp/loaddefs.el (source)...
Maximum buffer size exceeded
gmake[1]: *** [bootstrap-emacs] Error 1
gmake[1]: Target `all' not remade because of errors.
gmake: *** [src] Error 2
gmake: Target `all' not remade because of errors.


cd lib; gmake all -k                           \
	  CC='gcc-4.2 -std=gnu99 -I/sw/include -L/sw/lib' CFLAGS='-g -H -pipe  
-fPIC -fno-common -mcpu=7450 -mtune=7450 -maltivec -faltivec - 
mabi=altivec -fast -mfused-madd -mmultiple -ftree-vectorize -mpowerpc- 
gfxopt' CPPFLAGS='' \
	  LDFLAGS='-Wl,-dead_strip_dylibs -Wl,-bind_at_load -Wl,-t -L/usr/X11/ 
lib' MAKE='gmake'

Loading loadup.el (source)...
Using load-path (.../emacs-24.0.90/lisp .../emacs-24.0.90/lisp/emacs- 
lisp .../emacs-24.0.90/lisp/language .../emacs-24.0.90/lisp/ 
international .../emacs-24.0.90/lisp/textmodes)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version.el (source)...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading cus-start...
Loading international/mule...
Loading international/mule-conf...
Loading env...
Loading format...
Loading bindings...
Loading window...
Loading files...
Loading cus-face...
Loading faces...
Loading button...
Loading startup...
Loading .../emacs-24.0.90/lisp/loaddefs.el (source)...
Maximum buffer size exceeded
gmake[1]: *** [bootstrap-emacs] Error 1
gmake[1]: Target `all' not remade because of errors.
gmake: *** [src] Error 2
gmake: Target `all' not remade because of errors.


I'll try with -O0…

--
Greetings

  Pete                           <]
             o        __o         |__    o       HPV, the real
    ___o    /I       -\<,         |o \  -\),-%     high speed!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Sat, 08 Oct 2011 23:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 9705 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 9705 <at> debbugs.gnu.org
Subject: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
Date: Sun, 9 Oct 2011 01:26:48 +0200
Both compilers compile OK when used with -O0 and -Os. So it's  
something that -fast adds or -Os removes. I'll continue my experiments  
next morning!

http://developer.apple.com/library/mac/#documentation/DeveloperTools/ 
gcc-4.2.1/gcc/index.html
http://developer.apple.com/library/mac/#documentation/DeveloperTools/ 
gcc-4.0.1/gcc/index.html

--
Greetings

  Pete

America believes in education: the average professor earns more money  
in a year than a professional athlete earns in a whole week.
				– Evan Esar





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Sun, 09 Oct 2011 10:34:01 GMT) Full text and rfc822 format available.

Message #11 received at 9705 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 9705 <at> debbugs.gnu.org
Subject: Re: 24.0.90;
	cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
Date: Sun, 9 Oct 2011 12:31:14 +0200
Am 09.10.2011 um 01:26 schrieb Peter Dyballa:

> Both compilers compile OK when used with -O0 and -Os.

They work OK with -O3.


The documentation for both Apple modified compilers describes:

	http://developer.apple.com/library/mac/#documentation/DeveloperTools/ 
gcc-4.2.1/gcc/index.html
	http://developer.apple.com/library/mac/#documentation/DeveloperTools/ 
gcc-4.0.1/gcc/index.html
	
	4.2.1				4.0.1
	=====				=====
	-O turns on the following optimization flags:
	
	-fdefer-pop			-fdefer-pop
	-fdelayed-branch		-fdelayed-branch
	-fguess-branch-probability	-fguess-branch-probability
	-fcprop-registers		-fcprop-registers
					-floop-optimize
	-fif-conversion			-fif-conversion
	-fif-conversion2		-fif-conversion2
	-ftree-ccp			-ftree-ccp
	-ftree-dce			-ftree-dce
	-ftree-dominator-opts		-ftree-dominator-opts
	-ftree-dse			-ftree-dse
	-ftree-ter			-ftree-ter
	-ftree-lrs			-ftree-lrs
	-ftree-sra			-ftree-sra
	-ftree-copyrename		-ftree-copyrename
	-ftree-fre			-ftree-fre
	-ftree-ch			-ftree-ch
	-fmerge-constants		-fmerge-constants
	-funit-at-a-time
	
	-O also turns on -fomit-frame-pointer on machines where doing so does  
not interfere with debugging.
	
	
	-O2 turns on all optimization flags specified by -O. It also turns on  
the following optimization flags:
	
	-fthread-jumps			-fthread-jumps
	-fcrossjumping			-fcrossjumping
	-foptimize-sibling-calls	-foptimize-sibling-calls
	-fcse-follow-jumps		-fcse-follow-jumps
	-fcse-skip-blocks		-fcse-skip-blocks
	-fgcse				-fgcse
	-fgcse-lm			-fgcse-lm
	-fexpensive-optimizations	-fexpensive-optimizations
					-fstrength-reduce
	-frerun-cse-after-loop		-frerun-cse-after-loop
					-frerun-loop-opt
	-fcaller-saves			-fcaller-saves
					-fforce-mem
	-fpeephole2			-fpeephole2
	-fschedule-insns		-fschedule-insns
	-fschedule-insns2		-fschedule-insns2
	-fsched-interblock		-fsched-interblock
	-fsched-spec			-fsched-spec
	-fregmove			-fregmove
	-fstrict-aliasing		-fstrict-aliasing
	-fstrict-overflow
	-fdelete-null-pointer-checks	-fdelete-null-pointer-checks
	-freorder-blocks		-freorder-blocks
	-freorder-functions		-freorder-functions
					-funit-at-a-time
	-falign-functions		-falign-functions
	-falign-jumps			-falign-jumps
	-falign-loops			-falign-loops
	-falign-labels			-falign-labels
	-ftree-vrp
	-ftree-pre			-ftree-pre
	
	Please note the warning under -fgcse about invoking -O2 on programs  
that use computed gotos.
	
	
	-O3 turns on all optimizations specified by -O2 and also turns on
	
	-finline-functions		-finline-functions
	-funswitch-loops		-funswitch-loops
	-fgcse-after-reload		-fgcse-after-reload
	
	
	-Os enables all -O2 optimizations that do not typically increase code  
size. It also performs further optimizations designed to reduce code  
size. -Os disables the following optimization flags:
	
	-falign-functions		-falign-functions
	-falign-jumps			-falign-jumps
	-falign-loops			-falign-loops
	-falign-labels			-falign-labels
	-freorder-blocks		-freorder-blocks
	-freorder-blocks-and-partition	-freorder-blocks-and-partition
	-fprefetch-loop-arrays		-fprefetch-loop-arrays
	-ftree-vect-loop-version
	
	
	-fast
	Optimize for maximum performance. -fast changes the overall  
optimization strategy of GCC in order to produce the fastest possible  
running code for PPC7450 and G5 architectures. By default, -fast  
optimizes for G5. Programs optimized for G5 will not run on PPC7450.  
To optimize for PPC7450, add -mcpu=7450 on command line.
	-fast currently enables the following optimization flags (for G5 and  
PPC7450). These flags may change in the future. You cannot override  
any of these options if you use -fast except by setting -mcpu=7450 (or  
-fPIC, see below).
	
	-O3				-O3
	-falign-loops-max-skip=15	-falign-loops-max-skip=15
	-falign-jumps-max-skip=15	-falign-jumps-max-skip=15
	-falign-loops=16		-falign-loops=16
	-falign-jumps=16		-falign-jumps=16
	-falign-functions=16		-falign-functions=16
	-malign-natural (except when…)	-malign-natural (except when -fastf is  
specified)
	-ffast-math			-ffast-math
	-fstrict-aliasing		-fstrict-aliasing
	-funroll-loops			-funroll-loops
	-ftree-loop-linear		-ftree-loop-linear
	-ftree-loop-memset		-ftree-loop-memset
	-mcpu=G5			-mcpu=G5
	-mpowerpc-gpopt			-mpowerpc-gpopt
	-mtune=G5  (unless -mtune=G4… )	-mtune=G5  (unless -mtune=G4 is  
specified).
	-fsched-interblock		-fsched-interblock
	-fgcse-sm			-fgcse-sm
	-mpowerpc64			-mpowerpc64
	
	To build shared libraries with -fast, specify -fPIC on the command  
line as -fast turns on -mdynamic-no-pic otherwise.
	
	Important notes: -ffast-math results in code that is not necessarily  
IEEE-compliant. -fstrict-aliasing is highly likely to break non- 
standard-compliant programs. -malign-natural only works properly if  
the entire program is compiled with it, and none of the standard  
headers/libraries contain any code that changes alignment when this  
option is used.
	
	On Intel target, -fast currently enables the following optimization  
flags:
	
	-O3				-O3
	-fomit-frame-pointer		-fomit-frame-pointer
	-fstrict-aliasing		-fstrict-aliasing
	-momit-leaf-frame-pointer	-momit-leaf-frame-pointer
	-fno-tree-pre			-fno-tree-pre
	-falign-loops			-falign-loops
	
	All choices of flags enabled by -fast are subject to change without  
notice.


My recent series of tests is with:

	env LANG=C PATH=/sw/bin:$PATH ./configure --without-sound --without- 
dbus --without-pop --without-gconf --without-gpm --without-gsettings -- 
without-gif --without-jpeg --without-png --without-rsvg --without-tiff  
--without-xpm --with-wide-int --with-x-toolkit=athena --x-libraries=/ 
usr/X11/lib --x-includes=/usr/X11/include --enable-locallisppath=/ 
Library/Application\ Support/Emacs/calendar24:/Library/Application\  
Support/Emacs

While

	LDFLAGS="-Wl,-dead_strip_dylibs -Wl,-bind_at_load -Wl,-t" CC=gcc-4.2  
CPP=cpp-4.2 PKG_CONFIG_PATH=/sw/lib/xft2/lib/pkgconfig:/sw/share/ 
pkgconfig:/sw/lib/pkgconfig:/usr/X11/lib/pkgconfig:/usr/X11/share/ 
pkgconfig:/usr/lib/pkgconfig

stay unchanged I modify

	CFLAGS="-g -H -pipe -fPIC -fno-common -mcpu=7450 -mtune=G4 -maltivec - 
faltivec -mabi=altivec -O3 -falign-loops-max-skip=15 -falign-loops=16 - 
falign-jumps=16 -falign-functions=16 -ffast-math -fstrict-aliasing - 
mfused-madd -mmultiple -ftree-vectorize -mpowerpc-gfxopt"

Now, at high noon, I already found that -malign-natural produces the  
failure – the documentation warns about its use!


(I wonder whether the sequence of the flags passed to the compiler  
plays a role. I'll also try an additional test à la '-fast -mcpu=7450 - 
mtune=G4' or '-fast -mcpu=7450 -mtune=7450' to be sure that non-G4  
options are effectively suppressed. -fastf is also an option I should  
consider and read again about it.)

--
Greetings

  Pete
              <\
                \__     O                       __O
                | O\   _\\/\-%                _`\<,
                '()-'-(_)--(_)               (_)/(_)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Sun, 09 Oct 2011 15:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 9705 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 9705 <at> debbugs.gnu.org
Subject: Re: 24.0.90;
	cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
Date: Sun, 9 Oct 2011 17:47:40 +0200
Am 09.10.2011 um 12:31 schrieb Peter Dyballa:

> Now, at high noon, I already found that -malign-natural produces the  
> failure – the documentation warns about its use!


Besides -malign-natural also -mpowerpc64 triggers the failure, though  
I did not test -mcpu=G5, which obviously cannot be right on a G4  
machine.

I presume GCC 4.0.1 behaves in this case exactly like GCC 4.2.1 so I  
stop further testing – for the X client variant. I'll try again with  
the NS/Cocoa/Aqua variant.

--
Greetings

  Pete

A mathematician is a device for turning coffee into theorems.
				– Erdős Pál





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Sun, 09 Oct 2011 21:11:01 GMT) Full text and rfc822 format available.

Message #17 received at 9705 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 9705 <at> debbugs.gnu.org
Subject: Re: 24.0.90;
	cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
Date: Sun, 9 Oct 2011 23:07:48 +0200
Am 09.10.2011 um 12:31 schrieb Peter Dyballa:

> (I wonder whether the sequence of the flags passed to the compiler  
> plays a role. I'll also try an additional test à la '-fast - 
> mcpu=7450 -mtune=G4' or '-fast -mcpu=7450 -mtune=7450' to be sure  
> that non-G4 options are effectively suppressed.


This makes no difference, -fast does not work! I also made the cross  
check leaving out the configure option --with-wide-int and produced  
the same failure. So GNU Emacs 24.0.90 cannot be compiled with -fast  
and the Apple modified compilers. Before it was possible. Used in  
February… (since then compiled with GCC 4.4 or 4.5 or other C compilers)

(I can try to restore the GNU Emacs 24.0.50 source code from backups  
to check when -fast started to fail.)

--
Greetings

  Pete

Hard Disk, n.:
	A device that allows users to delete vast quantities of data with  
simple mnemonic commands.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9705; Package emacs. (Mon, 16 Apr 2012 22:23:02 GMT) Full text and rfc822 format available.

Message #20 received at 9705 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 9705 <at> debbugs.gnu.org
Subject: Re: bug#9705: Acknowledgement (24.0.90;
	cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2)
Date: Tue, 17 Apr 2012 00:19:43 +0200
This bug report is similar to bug#11236: the Apple compiler switch -fast is used. GCC 4.5.3 is not modified by Apple, so it misses the -fast switch, optimisation is then achieved by -Os

--
Greetings

  Pete

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
				– Albert Einstein





Merged 9705 11236. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 Apr 2012 23:39:01 GMT) Full text and rfc822 format available.

Added tag(s) notabug. Request was from Andreas Schwab <schwab <at> linux-m68k.org> to control <at> debbugs.gnu.org. (Mon, 23 Apr 2012 09:39:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 29 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.