[ECOS] Re: Can not compile API file

m mariga ma_ariga@yahoo.co.jp
Fri Dec 11 22:51:00 GMT 2009


Hello everyone,

Thanks,Ross.
As I changed PPOUT.C to ppout.c I succeeded to build libtarget.a.

But when I tried to Make application with libtarget.a I am encountered 
enigmatic errors.
Below is make result.
It looks that tcpip sources occure many "undefined reference to" 
errors,although I never touched any tcpip sources.
My application program just create one thread and never concerned with 
tcpip. I append it below.
It is true I selected "net" packet in building, but never appeared these 
errors before I included pseud-USB driver.
I greped `___udivsi3_i4i' but no hit.
What are they related to my including pseud-USB driver ?
Why this phenomenon happens ? Please teach me.

I send build result log also.

---- below is make_result log
$ make
sh-elf-gcc -c -o 
usb_prt_test.o -D_KERNEL -D__ECOS -g -Wall -I/home/link/lanboard_net_20091210-4/untitled1_install/include 
 -ffunction-sections -fdata-sections usb_prt_test.c
In file included from 
/home/link/lanboard_net_20091210-4/untitled1_install/include/pkgconf/hal.h:17,
                 from 
/home/link/lanboard_net_20091210-4/untitled1_install/include/pkgconf/kernel.h:13,
                 from 
/home/link/lanboard_net_20091210-4/untitled1_install/include/cyg/kernel/kapi.h:59,
                 from usb_prt_test.c:17:
/home/link/lanboard_net_20091210-4/untitled1_install/include/pkgconf/hal_sh_sh7705_lanboard.h:41:1: 
warning: "CYG_HAL_STARTUP_RAM" redefined
In file included from 
/home/link/lanboard_net_20091210-4/untitled1_install/include/cyg/kernel/kapi.h:58,
                 from usb_prt_test.c:17:
/home/link/lanboard_net_20091210-4/untitled1_install/include/pkgconf/system.h:33:1: 
warning: this is the location of the previous definition
/home/link/lanboard_net_20091210-4/untitled1_install/include/cyg/io/usb/proto_ppout.h:11: 
warning: 'read_w' declared 'static' but never defined
sh-elf-gcc -nostartfiles -L/home/link/lanboard_net_20091210-4/untitled1_install/lib 
 -Wl,--gc-sections -Wl,--Map -Wl,usb_prt_test.map -o usb_prt_test 
usb_prt_test.o -Ttarget.ld -nostdlib
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_support.o): 
In function `cyg_tvtohz':

/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/ecos/support.c:620: 
undefined reference to `___udivsi3_i4i'
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/ecos/support.c:620: 
undefined reference to `___sdivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_ip_output.o): 
In function `cyg_ip_output':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/ip_output.c:435: 
undefined reference to `___udivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_uipc_socket.o): 
In function `cyg_sogetopt':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/kern/uipc_socket.c:1365: 
undefined reference to `___sdivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_uipc_socket.o): 
In function `cyg_sosetopt':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/kern/uipc_socket.c:1234: 
undefined reference to `___sdivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_uipc_socket2.o): 
In function `cyg_sodropablereq':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/kern/uipc_socket2.c:213: 
undefined reference to `___udivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_igmp.o): 
In function `cyg_igmp_input':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/igmp.c:355: 
undefined reference to `___sdivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_input.o): 
In function `cyg_tcp_mss':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_input.c:2880: 
undefined reference to `___sdivsi3_i4i'

/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_input.c:2880: 
undefined reference to `___udivsi3_i4i'

/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_input.o): 
In function `tcp_newreno':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_input.c:2951: 
undefined reference to `___udivsi3_i4i'

/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_input.o): 
In function `cyg_tcp_input':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_input.c:2015: 
undefined reference to `___udivsi3_i4i'

/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_timer.o): 
In function `cyg_tcp_timer_rexmt':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_timer.c:520: 
undefined reference to `___udivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_subr.o): 
In function `cyg_tcp_new_isn':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_subr.c:1123: 
undefined reference to `___sdivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(net_bsd_tcpip_tcp_subr.o): 
In function `cyg_tcp_close':
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_subr.c:746: 
undefined reference to `___sdivsi3_i4i'
/opt/ecos/ecos-3.0/packages/net/bsd_tcpip/v3_0/src/sys/netinet/tcp_subr.c:746: 
undefined reference to `___udivsi3_i4i'
/home/link/lanboard_net_20091210-4/untitled1_install/lib/libtarget.a(services_memalloc_common_memfixed.o): 
In function `Cyg_Mempolt2':
/home/link/lanboard_net_20091210-4/untitled1_install/include/cyg/memalloc/mempolt2.inl:74: 
undefined reference to `___sd
ivsi3_i4i'
collect2: ld returned 1 exit status
make: *** [usb_prt_test] Error 1
---- end of make_result log

--- below is my make file
export PREFIX := /home/link/lanboard_net_20091210-4/untitled1_install

export COMMAND_PREFIX := sh-elf-
export CC := $(COMMAND_PREFIX)gcc
export OBJCOPY := $(COMMAND_PREFIX)objcopy
export HOST := CYGWIN
export AR := $(COMMAND_PREFIX)ar

XCC = sh-elf-gcc

CFLAGS 
= -D_KERNEL -D__ECOS -g -Wall -I$(PREFIX)/include -ffunction-sections -fdata-sections
LDFLAGS 
= -nostartfiles -L$(PREFIX)/lib -Wl,--gc-sections -Wl,--Map -Wl,usb_prt_test.map
LIBS = -Ttarget.ld -nostdlib
LD  = $(XCC)

## Build rules.
all: usb_prt_test

usb_prt_test.o: usb_prt_test.c
 $(XCC) -c -o $*.o $(CFLAGS) $<

usb_prt_test: usb_prt_test.o
 $(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

clean:
 -rm -f usb_prt_test.exe usb_prt_test.o usb_prt_test.map

--- end of make file

--- below is application
#include <cyg/kernel/kapi.h>
#include <cyg/io/usb/proto_ppout.h>

#define STACK_SIZE  0x4000
#define MAIN_THREAD_PRIORITY     5

static char         main_thread_stack[STACK_SIZE];
static cyg_handle_t main_thread_handle;
static cyg_thread   main_thread_data;

#ifdef __ECOS
//void usb_prt_test(test_param_t param)
void usb_prt_test(cyg_addrword_t data)
{
 while(1)
 {
//  usb2parallel();
 }
}

void
cyg_start(void)
{
 cyg_thread_create(MAIN_THREAD_PRIORITY,    // Priority
      usb_prt_test,             // entry
      0,                        // entry parameter
      "USB Printer test",       // Name
      &main_thread_stack[0], // Stack
      STACK_SIZE,               // Size
      &main_thread_handle,   // Handle
      &main_thread_data      // Thread data structure
     );
    cyg_thread_resume(main_thread_handle);   // Start first one
    cyg_scheduler_start();
}
#else

int
main(int argc, char *argv[])
{
//    net_test(0);
}
#endif
--- end of application

Please help me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config_build_result.txt.gz
Type: application/x-gzip
Size: 17044 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20091211/6aa6c837/attachment.bin>
-------------- next part --------------
-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


More information about the Ecos-discuss mailing list