Hi everybody.
I'm using Embedded Linux Development Kit and I have some errors
when I try to execute the makefile to rebuild the lejos firmware.
I so use the arm-linx-gcc tool (please don't ask me why, i'm in training
course and it's imposed).
Then, when I try to execute the following:
.SUFFIXES:
default: def_target
include environment.mak
include targetdef.mak
RAM_TARGET := $(TARGET)_ram.elf
ROM_TARGET := $(TARGET)_rom.elf
SAMBA_TARGET := $(TARGET)_samba_ram.bin
ROMBIN_TARGET := $(TARGET)_rom.bin
RAM_LDSCRIPT := $(TARGET)_ram.ld
ROM_LDSCRIPT := $(TARGET)_rom.ld
SAMBA_LDSCRIPT := $(TARGET)_samba.ld
S_OBJECTS := $(S_SOURCES:.s=.o)
C_OBJECTS := $(C_SOURCES:.c=.o) $(C_RAMSOURCES:.c=.oram)
C_OPTIMISATION_FLAGS = -Os
#C_OPTIMISATION_FLAGS = -O0
CFLAGS = -c -ffreestanding -fsigned-char -mcpu=arm7tdmi \
$(C_OPTIMISATION_FLAGS) -g \
-Winline -Wall -Werror-implicit-function-declaration \
-I. -I$(VM_DIR) \
-mthumb -mthumb-interwork -ffunction-sections -fdata-sections
LDFLAGS = -Map [EMAIL PROTECTED] -L$(LIBPREFIX) -lm -cref --gc-sections $(LIBC)
ASFLAGS = -mthumb-interwork -mfpu=softfpa
def_target: all
ALL_TARGETS := $(RAM_TARGET) $(ROM_TARGET) $(ROMBIN_TARGET) $(SAMBA_TARGET)
.PHONY: all
all: BuildMessage $(ALL_TARGETS)
PHONY: TargetMessage
TargetMessage:
@echo ""
@echo "Building: $(ALL_TARGETS)"
@echo ""
@echo "C sources: $(C_SOURCES) to $(C_OBJECTS)"
@echo ""
@echo "Assembler sources: $(S_SOURCES) to $(S_OBJECTS)"
@echo ""
@echo "LD source: $(LDSCRIPT_SOURCE)"
@echo ""
PHONY: BuildMessage
BuildMessage: TargetMessage EnvironmentMessage
$(SAMBA_LDSCRIPT): $(LDSCRIPT_SOURCE)
cat $< | sed -e 's/^SAMBA_ONLY//' -e '/^RAM_ONLY/d' -e'/^ROM_ONLY/d' >$@
$(RAM_LDSCRIPT): $(LDSCRIPT_SOURCE)
cat $< | sed -e 's/^RAM_ONLY//' -e'/^ROM_ONLY/d' -e'/^SAMBA_ONLY/d' >$@
$(ROM_LDSCRIPT): $(LDSCRIPT_SOURCE)
cat $< | sed -e 's/^ROM_ONLY//' -e'/^RAM_ONLY/d' -e'/^SAMBA_ONLY/d' >$@
$(SAMBA_TARGET)_elf: $(C_OBJECTS) $(S_OBJECTS) $(SAMBA_LDSCRIPT)
@echo "Linking $@"
$(LD) -o $@ $(C_OBJECTS) $(S_OBJECTS) -T $(SAMBA_LDSCRIPT) $(LIBC)
$(GCC_LIB) $(LDFLAGS)
$(RAM_TARGET): $(C_OBJECTS) $(S_OBJECTS) $(RAM_LDSCRIPT)
@echo "Linking $@"
$(LD) -o $@ $(C_OBJECTS) $(S_OBJECTS) -T $(RAM_LDSCRIPT) $(LIBC)
$(GCC_LIB) $(LDFLAGS)
$(ROM_TARGET): $(C_OBJECTS) $(S_OBJECTS) $(ROM_LDSCRIPT)
@echo "Linking $@"
$(LD) -o $@ $(C_OBJECTS) $(S_OBJECTS) -T $(ROM_LDSCRIPT) $(LIBC)
$(GCC_LIB) $(LDFLAGS)
$(ROMBIN_TARGET): $(ROM_TARGET)
@echo "Generating binary file $@"
$(OBJCOPY) -O binary $< $@
$(SAMBA_TARGET): $(SAMBA_TARGET)_elf
@echo "Generating binary file $@"
$(OBJCOPY) -O binary $< $@
%.o: %.s
@echo "Assembling $< to $@"
$(AS) $(ASFLAGS) -o $@ $<
%.o: %.c
@echo "Compiling $< to $@"
$(CC) $(CFLAGS) -o $@ $<
%.oram: %.c
@echo "Compiling $< to $@"
$(CC) $(CFLAGS) -o $@ $<
.PHONY: clean
clean:
@echo "Removing All Objects"
@rm -f $(S_OBJECTS) $(C_OBJECTS) *.o
@echo "Removing generated ld scripts"
@rm -f *.ld
@echo "Removing target"
@rm -f $(ALL_TARGETS)
@echo "Removing map files"
@ rm -f *map
-include $(C_SOURCES:.c=.d)
With the environment.bak:
GCC_VERSION :=4.0.0
COMP_PATH := /opt/eldk
LIBPREFIX := $(COMP_PATH)/arm/lib
GCC_LIB := $(COMP_PATH)/usr/lib/gcc/arm-linux/$(GCC_VERSION)/libgcc.a
LIBC := $(COMP_PATH)/arm/lib/libc.a
TARGET_PREFIX :=arm-linux
INC_PATH := $(COMP_PATH)/arm/usr/include
CC := $(COMP_PATH)/usr/bin/$(TARGET_PREFIX)-gcc
AS := $(COMP_PATH)/usr/bin/$(TARGET_PREFIX)-as
AR := $(COMP_PATH)/usr/bin/$(TARGET_PREFIX)-ar
LD := $(COMP_PATH)/usr/bin/$(TARGET_PREFIX)-ld
OBJCOPY := $(COMP_PATH)/usr/bin/$(TARGET_PREFIX)-objcopy
PHONY: EnvironmentMessage
EnvironmentMessage:
@echo " CC $(CC)"
@echo " AS $(AS)"
@echo " AR $(AR)"
@echo " LD $(LD)"
@echo " OBJCOPY $(OBJCOPY)"
and the same target source:
# TARGET is the base name for the outputs.
# C_RAMSOURCES are the C files that must always be located in RAM.
# C_SOURCES are the rest of the C files
# S_SOURCES are the assembler files
VM_DIR := ../../javavm
TARGET := lejos_nxt
C_RAMSOURCES := flashprog.c
C_PLATFORM_SOURCES := \
uart.c \
byte_fifo.c \
aic.c \
systick.c \
udp.c \
twi.c \
nxt_spi.c \
nxt_motors.c \
data_abort.c \
display.c \
i2c.c \
sound.c \
bt.c
C_HOOK_SOURCES := \
main.c \
nxt_avr.c \
sensors.c \
nxt_lcd.c \
native.c \
platform_hooks.c
C_VM_SOURCES := \
$(VM_DIR)/interpreter.c \
$(VM_DIR)/threads.c \
$(VM_DIR)/exceptions.c \
$(VM_DIR)/memory.c \
$(VM_DIR)/language.c \
$(VM_DIR)/poll.c
C_SOURCES := $(C_PLATFORM_SOURCES) $(C_VM_SOURCES) $(C_HOOK_SOURCES)
S_SOURCES := init.s interrupts.s vectors.s irq.s
LDSCRIPT_SOURCE := sam7.lds
I've got these errors:
[EMAIL PROTECTED]:~/Documents/lejos_nxj/src/nxtvm/platform/nxt$ make
Building: lejos_nxt_ram.elf lejos_nxt_rom.elf lejos_nxt_rom.bin
lejos_nxt_samba_ram.bin
C sources: uart.c byte_fifo.c aic.c systick.c udp.c twi.c nxt_spi.c
nxt_motors.c data_abort.c display.c i2c.c sound.c bt.c
../../javavm/interpreter.c ../../javavm/threads.c
../../javavm/exceptions.c ../../javavm/memory.c ../../javavm/language.c
../../javavm/poll.c main.c nxt_avr.c sensors.c nxt_lcd.c native.c
platform_hooks.c to uart.o byte_fifo.o aic.o systick.o udp.o twi.o
nxt_spi.o nxt_motors.o data_abort.o display.o i2c.o sound.o bt.o
../../javavm/interpreter.o ../../javavm/threads.o
../../javavm/exceptions.o ../../javavm/memory.o ../../javavm/language.o
../../javavm/poll.o main.o nxt_avr.o sensors.o nxt_lcd.o native.o
platform_hooks.o flashprog.oram
Assembler sources: init.s interrupts.s vectors.s irq.s to init.o
interrupts.o vectors.o irq.o
LD source: sam7.lds
CC /opt/eldk/usr/bin/arm-linux-gcc
AS /opt/eldk/usr/bin/arm-linux-as
AR /opt/eldk/usr/bin/arm-linux-ar
LD /opt/eldk/usr/bin/arm-linux-ld
OBJCOPY /opt/eldk/usr/bin/arm-linux-objcopy
Linking lejos_nxt_ram.elf
/opt/eldk/usr/bin/arm-linux-ld -o lejos_nxt_ram.elf uart.o byte_fifo.o
aic.o systick.o udp.o twi.o nxt_spi.o nxt_motors.o data_abort.o display.o
i2c.o sound.o bt.o ../../javavm/interpreter.o ../../javavm/threads.o
../../javavm/exceptions.o ../../javavm/memory.o ../../javavm/language.o
../../javavm/poll.o main.o nxt_avr.o sensors.o nxt_lcd.o native.o
platform_hooks.o flashprog.oram init.o interrupts.o vectors.o irq.o -T
lejos_nxt_ram.ld /opt/eldk/arm/lib/libc.a
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a -Map lejos_nxt_ram.elf.map
-L/opt/eldk/arm/lib -lm -cref --gc-sections /opt/eldk/arm/lib/libc.a
/opt/eldk/usr/bin/arm-linux-ld: ERROR: init.o uses FPA instructions,
whereas lejos_nxt_ram.elf does not
/opt/eldk/usr/bin/arm-linux-ld: failed to merge target specific data of
file init.o
/opt/eldk/usr/bin/arm-linux-ld: ERROR: interrupts.o uses FPA instructions,
whereas lejos_nxt_ram.elf does not
/opt/eldk/usr/bin/arm-linux-ld: failed to merge target specific data of
file interrupts.o
/opt/eldk/usr/bin/arm-linux-ld: ERROR: vectors.o uses FPA instructions,
whereas lejos_nxt_ram.elf does not
/opt/eldk/usr/bin/arm-linux-ld: failed to merge target specific data of
file vectors.o
/opt/eldk/usr/bin/arm-linux-ld: ERROR: irq.o uses FPA instructions,
whereas lejos_nxt_ram.elf does not
/opt/eldk/usr/bin/arm-linux-ld: failed to merge target specific data of
file irq.o
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/arm/lib/libc.a(strlen.o) does not support interworking, whereas
lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/arm/lib/libc.a(memset.o) does not support interworking, whereas
lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/arm/lib/libc.a(memcpy.o) does not support interworking, whereas
lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/arm/lib/libc.a(wordcopy.o) does not support interworking,
whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_udivsi3.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_divsi3.o) does not support
interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_umodsi3.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_modsi3.o) does not support
interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_dvmd_lnx.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_addsubsf3.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_muldivsf3.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_cmpsf2.o) does not support
interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning:
/opt/eldk/usr/lib/gcc/arm-linux/4.0.0/libgcc.a(_fixsfsi.o) does not
support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: Warning: /opt/eldk/arm/lib/libm.so does
not support interworking, whereas lejos_nxt_ram.elf does
/opt/eldk/usr/bin/arm-linux-ld: error: no memory region specified for
loadable section `.dynamic'
make: *** [lejos_nxt_ram.elf] Erreur 1
Can you help me please to solved these errors?
Thank you.
Best regards.
--
Johnny Giacomoni
IUT de Valence
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion