unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
@ 2011-10-08 21:08 Peter Dyballa
  2011-10-08 23:26 ` Peter Dyballa
       [not found] ` <handler.9705.B.13181082828030.ack@debbugs.gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Dyballa @ 2011-10-08 21:08 UTC (permalink / raw)
  To: 9705

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_________________






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
  2011-10-08 21:08 bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2 Peter Dyballa
@ 2011-10-08 23:26 ` Peter Dyballa
  2011-10-09 10:31   ` Peter Dyballa
       [not found] ` <handler.9705.B.13181082828030.ack@debbugs.gnu.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Dyballa @ 2011-10-08 23:26 UTC (permalink / raw)
  To: 9705

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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
  2011-10-08 23:26 ` Peter Dyballa
@ 2011-10-09 10:31   ` Peter Dyballa
  2011-10-09 15:47     ` Peter Dyballa
  2011-10-09 21:07     ` Peter Dyballa
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Dyballa @ 2011-10-09 10:31 UTC (permalink / raw)
  To: 9705


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\   _\\/\-%                _`\<,
                 '()-'-(_)--(_)               (_)/(_)






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
  2011-10-09 10:31   ` Peter Dyballa
@ 2011-10-09 15:47     ` Peter Dyballa
  2011-10-09 21:07     ` Peter Dyballa
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2011-10-09 15:47 UTC (permalink / raw)
  To: 9705


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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2
  2011-10-09 10:31   ` Peter Dyballa
  2011-10-09 15:47     ` Peter Dyballa
@ 2011-10-09 21:07     ` Peter Dyballa
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2011-10-09 21:07 UTC (permalink / raw)
  To: 9705


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.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9705: Acknowledgement (24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2)
       [not found] ` <handler.9705.B.13181082828030.ack@debbugs.gnu.org>
@ 2012-04-16 22:19   ` Peter Dyballa
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2012-04-16 22:19 UTC (permalink / raw)
  To: 9705

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






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-16 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-08 21:08 bug#9705: 24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2 Peter Dyballa
2011-10-08 23:26 ` Peter Dyballa
2011-10-09 10:31   ` Peter Dyballa
2011-10-09 15:47     ` Peter Dyballa
2011-10-09 21:07     ` Peter Dyballa
     [not found] ` <handler.9705.B.13181082828030.ack@debbugs.gnu.org>
2012-04-16 22:19   ` bug#9705: Acknowledgement (24.0.90; cannot compile GNU Emacs with Apple modified GCC 4.0 and 4.2) Peter Dyballa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).