syam prasad wrote:
Hi,
I am working on gcc version 3.4.4. I successfully compiled all the
source files and able to build .exe and .dll. I am able to debug the
code properly using gdb/ddd. But while I tried to simulate the code, I
am facing problems. It is not able to simulate. .dll is not even
loading into simulator. What might be the problem.
Are you getting a compiler/linker error or a runtime error? Sounds like,
from the above, that you are able to compile but the program fails to
find the dll. If that is the case you need to make sure the
LD_LIBRARY_PATH environment variable is setup so that it has the
location of the DLL in it.
Here is the makefile.mk I am using,
########Makefile.mk
#SHELL = /bin/sh
VIEW_TAG =
PLATFORM = 0
SECURITY_LEVEL_OVERRIDE_FLAG = 0
SIMPPC_TARGET_APP_FLAG = 0
MAKEFILE = Makefile.mk
# Engine Model is replaced by mkmf.pl script
ENG_MODEL = usersb_engctrl
# Engine Model is used to build other symbols
NAME_OIL = $(ENG_MODEL)
NAME_SUBSYSTEM = $(ENG_MODEL)_bdm
DLD_SUBSYSTEM = $(ENG_MODEL)
DLD_SUBSYSTEM_LIB = ss_lib_$(PLATFORM)
DLD_SUBSYSTEM_MEMMAP_TARGET = ss_memmap_ram_$(PLATFORM)
DLD_SUBSYSTEM_MEMMAP_SIMPPC = ss_memmap_simppc_$(PLATFORM)
NAME_HCONV_OPT = $(DLD_SUBSYSTEM)
TUNE_DIR = ./
TUNE_DIR_CE = ./
TUNE_DIR_BE = ./
#-------------------------------------------------------------------------------
# Object library macros.
# Note that if PATH_LIB_OBJ isn't a relative path, then it will be
required to
# use the form: PATH_LIB_OBJ = $(VIEW_TAG)/desired_path
PATH_LIB_OBJ = ../public
# Object Name is replaced by mkmf.pl script based on existing library
object file
NAME_LIB_OBJ = mod_lib_a4
# Define:
# - TARGET_MCU: Target Processor: PPC555
# - TARGET_OBJECT: Target object format: ELF
# - TARGET_FP: Target floating point support: None
# - TARGET_ENV: Target environment libraries: simple
TARGET_MCU = PPC555
TARGET_OBJECT = E
TARGET_FP = N
TARGET_ENV = simple
TARGET_OPTIONS = $(TARGET_MCU)$(TARGET_OBJECT)$(TARGET_FP):$(TARGET_ENV)
#-------------------------------------------------------------------------------
# Suffix rules:
# Remove default suffixes.
# Then, define custom suffixes.
# .o = objects
# .i = preprocessor output only
# .c = C files
# .s = asm files
.SUFFIXES:
.SUFFIXES: .o .c .s .pp .ss
.c.o:
@echo "Compiling $< ..."
$(CC) $(CFLAGS) -c $<
.s.o:
@echo "Assembling $< ..."
$(AS) $(AFLAGS) $<
.c.pp:
@echo "Running preprocessor only..."
$(CC) -P $(CFLAGS) -C -o $@ $<
.c.ss:
@echo "Running assembly only..."
$(CC) -S $(CFLAGS) -Xpass-source -o $@ $<
#-------------------------------------------------------------------------------
GCCPATH = "C:/cygwin/gcc"
CC = $(GCCPATH)/bin/gcc
AS = das
AR = $(GCCPATH)/bin/ar
LD = $(GCCPATH)/bin/ld
DUMPER = ddump
CFLAGS_OPTS = -D _DEBUG -D __WIN32__ -D __NUTC__ -D NDEBUG \
-D SECURITY_LEVEL_OVERRIDE_FLAG=$(SECURITY_LEVEL_OVERRIDE_FLAG) \
-D SIMPPC_TARGET_APP_FLAG=$(SIMPPC_TARGET_APP_FLAG)
CFLAGS = \
-B$(GCCPATH)/bin/ -B$(GCCPATH) \
$(CFLAGS_OPTS) \
-g \
-I. \
-I/cygdrive/D/xxxxx........./public \
AFLAGS = \
-g \
-t$(TARGET_OPTIONS) \
-I$(TUNE_DIR)
ARFLAGS = -ru
LDFLAGS =
DEST = .
EXTHDRS =
HDRS =
INSTALL = install
### Below file is to handle cotrol to simulator.
OBJS = engctrl.o
SRCS = engctrl.c
#-------------------------------------------------------------------------------
# Making executable
prog: $(OBJS) $(MAKEFILE)
$(CC) -o $(DLD_SUBSYSTEM).dll \
-fPIC \
-shared \
$(OBJS) \
/cygdrive/D/xxx/xxx....../xxxx.a \
/cygdrive/D/xxx/xxx....../yyyy.a
#-------------------------------------------------------------------------------
# make Objects only
objects: $(OBJS) $(MAKEFILE)
#-------------------------------------------------------------------------------
# other targets
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# MACRO for preprocessor only.
PPO = $(OBJS:.o=.pp)
ppo: $(PPO) $(MAKEFILE)
#-------------------------------------------------------------------------------
# MACRO for assembly listings only.
SSO = $(OBJS:.o=.ss)
sso: $(SSO) $(MAKEFILE)
touch:; @echo "Touching sources..."
@touch $(SRCS)
clean:; @echo "Removing all targets..."
@rm *.o *.pp *.ss \
*.elf *.mot *.s19
clean_elf:; @echo "Removing *.elf targets..."
@rm *.elf
clean_mot:; @echo "Removing *.mot targets..."
@rm *.mot
clean_s19:; @echo "Removing *.s19 targets..."
@rm *.s19
clean_obj:; @echo "Removing *.o targets..."
@rm *.o
clean_ppo:; @echo "Removing *.pp targets..."
@rm *.pp
clean_sso:; @echo "Removing *.ss targets..."
@rm *.ss
depend:
@echo "Dependencies..." \
@echo $(HDRS) $(SRCS)
index:; @ctags -wx $(HDRS) $(SRCS)
print:; @$(PRINT) $(HDRS) $(SRCS)
tags: $(HDRS) $(SRCS)
@ctags $(HDRS) $(SRCS)
Regards,
Syam.