开发者

Problem With Setting Compiler Flags

I'm trying to configure my cross compiler (mipseb-linux-g++) to generate binaries with the MIPSI ISA. There is a flag for this "-mips1". I have this flag in my make file and for some reason g++ is still generating MIPSII instructions (which I assume is default?). Am I doing anything wrong? Here's my process flow:

  • write c++ program
  • compile using mipseb-linux-g++
  • generate a hex dump with mipseb-linux-objdump
  • look in HEX dump to see if there are any MIPS II instructions (like beqzl)

Here is my makefile:

##############################################################################
#  \author acc@cs.rochester.edu
#  \version 0.01
#  \brief
##############################################################################

# Environment variables which should already be set in your path
# ACC_PATH ?= $(shell `pwd | awk 'BEGIN{FS="benchmarks/acc"} {print $1}'`)
# BENCHDIR ?= $(ACC_PATH)/benchmarks
# SESCSOURCEDIR ?= $(ACC_PATH)/sesc
# SESCBUILDDIR ?= $(ACC_PATH)/build
XTOOLSPREFIX ?= /home/seas/gr开发者_JS百科ad/dasnyder/cmplrs

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

# Compiler and linker
CC     = $(XTOOLSPREFIX)/bin/mipseb-linux-gcc
CXX    = $(XTOOLSPREFIX)/bin/mipseb-linux-g++
LD     = $(XTOOLSPREFIX)/bin/mipseb-linux-gcc
AR     = $(XTOOLSPREFIX)/bin/mipseb-linux-ar
RANLIB = $(XTOOLSPREFIX)/bin/mipseb-linux-ranlib

# Common compiler flags
CFLAGS = -O3 -funroll-loops -fsched-interblock \
         -finline-functions -fomit-frame-pointer -funroll-loops \
         -mips1 -mabi=32 -mtune=r2000 -static -Wa,-non_shared \
         -mno-abicalls -fno-PIC -freduce-all-givs \
         -I. -I$(XTOOLSPREFIX)/mipseb-linux/include

# C++ flags
CXXFLAGS = ${CFLAGS} -I$(XTOOLSPREFIX)/mipseb-linux/include/c++/3.2 \
         -I$(XTOOLSPREFIX)/mipseb-linux/include/c++/3.2/mips-linux-gnu \
         -mips1 -mabi=32 -mtune=r2000 -msoft-float -funroll-loops \
         -fdelayed-branch

# Common linker flags
# LDFLAGS = -Wl,--script=$(SESCSOURCEDIR)/src/libapp/mint.x \
#         -L$(SESCBUILDDIR)/obj/mipseb_obj -L$(XTOOLSPREFIX)/mipseb-linux/lib

LDFLAGS = -L$(XTOOLSPREFIX)/mipseb-linux/lib -lstdc++ -lm


# Common libs
LIBS    =

# Common definitions
DEFS    =

# Emacs tags
EMACSTAGS = TAGS
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜