Don't understand german? Read or subscribe to my english-only feed.

zsh and gcc…

One thing that annoyed me at my selfcompiled zsh-binary was that zsh changed path to ‘/’ when starting up. Now I could fix that behaviour:

$ echo $CFLAGS
-O9 -funroll-loops -ffast-math -mcpu=pentium4 -march=pentium4 \
-fomit-frame-pointer -fno-exceptions  -malign-double
$ ls -lah Src/zsh| awk '{print $5}'
566K
$ ./Src/zsh -f -c pwd
/
[...]
$ echo $CFLAGS
-O9 -funroll-loops -ffast-math -mcpu=pentium4 -march=pentium4 \
-fomit-frame-pointer -fno-exceptions
$ ls -lah Src/zsh| awk '{print $5}'
565K
$ ./Src/zsh -f -c pwd
/tmp/zsh-4.2.1

So the problem is the “-malign-double”. But why? According to acovea march=pentium4 implies the option -malign-double and it also implies ‘-mcpu=pentium4, -msse, -msse2, and -mmmx’. gcccpuopt says I should use “-march=pentium4 -mfpmath=sse -msse2 -mmmx”. Ok, give it another try:

$ echo $CFLAGS
-O9 -funroll-loops -ffast-math -fomit-frame-pointer \
-fno-exceptions -malign-double
$ ls -lah Src/zsh | awk '{print $5}'
575K
$ ./Src/zsh -f -c pwd
/
[...]
$ echo $CFLAGS
-O9 -funroll-loops -ffast-math -fomit-frame-pointer \
-fno-exceptions
$ ls -lah Src/zsh | awk '{print $5}'
573K
$ ./Src/zsh -f -c pwd
/tmp/zsh-4.2.1
$ echo $CFLAGS
-march=pentium4 -mfpmath=sse -msse2 -mmmx
$ ls -lah Src/zsh | awk '{print $5}'
518K
$ ./Src/zsh -f -c pwd
/tmp/zsh-4.2.1

Details of my system:

$ gcc --version | head -1
gcc (GCC) 3.3.4 (Debian 1:3.3.4-9)
$ cat /proc/cpuinfo|grep 'model name' | uniq
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz

Very strange behaviour for me.

Comments are closed.