stupid red zone...

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

stupid red zone...

Post by bluemoon »

After debugging a whole day for error that my application generating #PF with unallocated/not present memory upon second printf(), I realized that my newlib compilation did not include -Mno-red-zone, which caused all sort of trouble.

So, if anyone plan to play with 64-bit soon, remember to add it to the build configuration.

Code: Select all

> cat build64.sh
#!/bin/sh

mkdir build-x86_64
cd build-x86_64
../src/configure --target=x86_64-elf --prefix=`pwd`/../../../libc/ \
CFLAGS="-mno-red-zone" CPPFLAGS="-mno-red-zone" 

make
make install
cd ..
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: stupid red zone...

Post by xenos »

...or include "-mno-red-zone" in your Makefile, configure script, configure.ac or whatever config file you use to set your CFLAGS ;)
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Post Reply