views:

36

answers:

0

I chopped down my make file so I can compile a C++ program with very few, but some flags set to see if I can determine if they are working. The following is my make file section on C++ flags:

# Common compiler flags
CFLAGS = -mips1 -Wa,-non_shared \
         -mno-abicalls \
         -I. -I$(SESCSOURCEDIR)/src/libapp \
         -I$(SESCSOURCEDIR)/src/libacc \
         -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 \
        -I$(MINTTOOLSPREFIX)/libapp/

When I compile a program using this makefile I then run readelf on the elf file. This is the file's header:

ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x10000030
  Start of program headers:          52 (bytes into file)
  Start of section headers:          3611896 (bytes into file)
  Flags:                             0x10001001, noreorder, o32, mips2
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         31
  Section header string table index: 28

Note that the flags do not match. Why is this? Is there some sort of default configuration that I must override for the correct flags to take affect? Note that the output of make says that the correct flags have been applied although the ELF file doesn't represent this.

Make output:

/home/seas/grad/dasnyder/cmplrs/bin/mipseb-linux-g++ -mips1 -Wa,-non_shared -mno-abicalls -I. -I/src/libapp -I/src/libacc -I/home/seas/grad/dasnyder/cmplrs/mipseb-linux/include -I/home/seas/grad/dasnyder/cmplrs/mipseb-linux/include/c++/3.2 -I/home/seas/grad/dasnyder/cmplrs/mipseb-linux/include/c++/3.2/mips-linux-gnu -I/home/seas/grad/dasnyder/sesc//libapp/ -c test.cpp -o test.o
/home/seas/grad/dasnyder/cmplrs/bin/mipseb-linux-gcc test.o -Wl,--script=/home/seas/grad/dasnyder/dan/mint.x -L/home/seas/grad/dasnyder/cmplrs/src/mipseb-linux/lib -lstdc++ -lm -L/obj/mipseb_obj -L/home/seas/grad/dasnyder/cmplrs/mipseb-linux/lib -L/home/seas/grad/dasnyder/cmplrs/mipseb-linux/lib -lstdc++ -lm -o test