Skip to content

Commit

Permalink
gcc 3.x fixes
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@33 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
bellard committed Mar 18, 2003
1 parent 5dd9488 commit ca73520
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ DEFINES=-DHAVE_BYTESWAP_H

ifeq ($(ARCH),i386)
CFLAGS+=-fomit-frame-pointer
OP_CFLAGS=$(CFLAGS) -malign-functions=0 -mpreferred-stack-boundary=2
OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
ifeq ($(GCC_MAJOR),3)
OP_CFLAGS+= -falign-functions=0
else
OP_CFLAGS+= -malign-functions=0
endif
endif

ifeq ($(ARCH),ppc)
OP_CFLAGS=$(CFLAGS)
endif

ifeq ($(GCC_MAJOR),3)
# very important to generate a return at the end of every operation
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
endif

#########################################################

DEFINES+=-D_GNU_SOURCE
Expand Down
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi

TMPC="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}"
TMPS="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.h"

Expand Down Expand Up @@ -142,6 +143,14 @@ fi

fi

# check gcc version
gcc_major="2"
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in
3.*) gcc_major="3";
;;
esac

if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF
Expand Down Expand Up @@ -181,6 +190,7 @@ echo "prefix=$prefix" >> config.mak
echo "#define CONFIG_GEMU_PREFIX \"$prefix\"" >> $TMPH
echo "MAKE=$make" >> config.mak
echo "CC=$cc" >> config.mak
echo "GCC_MAJOR=$gcc_major" >> config.mak
echo "HOST_CC=$host_cc" >> config.mak
echo "AR=$ar" >> config.mak
echo "STRIP=$strip -s -R .comment -R .note" >> config.mak
Expand Down

0 comments on commit ca73520

Please sign in to comment.