unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Peter Dyballa <Peter_Dyballa@Freenet.DE>
To: 9705@debbugs.gnu.org
Subject: bug#9705: 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	[thread overview]
Message-ID: <FB21D642-5214-4E4C-AE39-4AAD0C885585@Freenet.DE> (raw)
In-Reply-To: <2781AD58-A4D5-4C4B-942E-C8B53CA1680B@Freenet.DE>


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






  reply	other threads:[~2011-10-09 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FB21D642-5214-4E4C-AE39-4AAD0C885585@Freenet.DE \
    --to=peter_dyballa@freenet.de \
    --cc=9705@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).