This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC help


Hi ,

I am new to gcc and shell commands. I am trying to compile my code using gcc 3.3.2 provided with AMD Au1550 development CD. When I compile my code, I get an error message with undefined references to printf and other file i/o functions. I saw a couple of emails in the forum with the same problem.But, I think I have problem with the makefile I am using. I never wrote a make file before and I am using the makefile from the hello World example given with Au1550 CD. It works for that example, but it crashes with my code.
I am attching the makefile with this email..

# Program name
NAME = test

# Endian
ifndef ENDIAN
ENDIAN = EL
endif

# Tool-chain used for compilation of code
# Win32 Cygwin toolchain
TOOLCHAIN = cygwin
# Monta Vista Hard Hat Linux toolchain
#TOOLCHAIN = hhl

ifeq ($(TOOLCHAIN),cygwin)
TOOLSDIR = /usr/local/comp/mips-elf/gcc-3.3.2
AS = $(TOOLSDIR)/bin/mips-elf-as 
CC = $(TOOLSDIR)/bin/mips-elf-gcc -fno-builtin
LD = $(TOOLSDIR)/bin/mips-elf-ld 
OD = $(TOOLSDIR)/bin/mips-elf-objdump
OC = $(TOOLSDIR)/bin/mips-elf-objcopy

#STRIP = $(TOOLSDIR)/bin/mips-elf-strip
endif

ifeq ($(TOOLCHAIN),hhl)
TOOLSDIR = /opt/hardhat/devkit/mips/fp_le
AS = $(TOOLSDIR)/bin/mips_fp_le-as 
CC = $(TOOLSDIR)/bin/mips_fp_le-gcc -fno-pic -mno-abicalls
LD = $(TOOLSDIR)/bin/mips_fp_le-ld 
OD = $(TOOLSDIR)/bin/mips_fp_le-objdump
OC = $(TOOLSDIR)/bin/mips_fp_le-objcopy
#STRIP = $(TOOLSDIR)/bin/mips_fp_le-strip
endif

RM = rm -f

#
# GCC options valid for Au1000
#
CFLAGS = -mips32 -G 0 -O2 -$(ENDIAN) -D$(ENDIAN) -Wa,-G0,-non_shared -I. 

#
# Default rules for compiling/assembling
#
.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

.S.o:
	$(CC) -c $(CFLAGS) -D_ASSEMBLER_ $< -o $@

#
# Files to compile
#
OBJS =	\
	test.o

#
# Rule for making
#
all: $(OBJS)
	$(LD) -$(ENDIAN) -T test.ld -G 0 $(OBJS) -o $(NAME).elf
	$(OD) -D $(NAME).elf > $(NAME).dis
	$(OC) -O srec $(NAME).elf $(NAME).rec

clean:
	$(RM) *.o
	$(RM) *.dis
	$(RM) *.rec
	$(RM) *.elf
	$(RM) *~

I got the linnker directive from the hello world example.I assume the problem is with the linker and with the test.ld file from the hello world example.

I used SDE toolchain before with the same code ,but a different make file but I never got this problem before.

I really need help on this immediately.

Thanks in advance - Pati
--
Sent from the gcc - Help forum at Nabble.com:
http://www.nabble.com/GCC-help-t647448.html#a1721245


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]