On 18 Aug 2005, Jeremy Dreese prattled cheerily: > We're using RedHat Enterprise Linux (RHEL) on both 64-bit servers and > 32-bit desktop systems. Code that is compiled on the servers must be > able to run on the desktop systems as well. By default RHEL 3 for AMD64 > compiles in 64-bit mode so obviously the generated executables won't run > on our desktop systems. I know that you can compile in 32-bit mode with > the -m32 option, but is there a way to have gcc/g++ compile in 32-bit by > default (without specifying the option every time)? Even creating a > shell alias (e.g. alias gcc="gcc -m32") doesn't take care of the problem > as this alias gets ignored when using gcc in a Makefile. Is there a way > to do what I'm asking? It *is* possible to change GCC's specs files to do what you're asking, but a wrapper shell script named `gcc' (and another named `g++`, et al) that invokes the real GCC would be better. I use this script, in /usr/bin, linked to gcc, g++, c++, and so on, on a sparc biarch system: #!/usr/bin/zsh # # Default to -m32 unless in sparc64 mode or -m64 is specified. # if echo "$@" | grep -E -- '(^| )-m(32|64)( |$)' >/dev/null 2>&1; then exec /usr/bin/wrapped/$(basename $0) "$@" elif uname -m | grep -v 64 >/dev/null 2>&1; then exec /usr/bin/wrapped/$(basename $0) -m32 "$@" else exec /usr/bin/wrapped/$(basename $0) -m64 "$@" fi -- `... published last year in a limited edition... In one of the great tragedies of publishing, it was not a limited enough edition and so I have read it.' --- James Nicoll