This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos 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]

Re: How to re-install newly compiled gnutools


Hello everyone,

I am sorry to sending two mails at one time.
But I am encountered next phenomoinon,
and I think it is concerned with my first inqury mail,
So I mail this as a postscript.

Correct or not, I procceede to configure-build
using /usr/local/sh-elf/ installed by (1) way.
Of course I added /usr/local/sh-elf/bin to PATH and
remained gnutools directory as it is.

As I said I succeeded configure-build using target and "net"
and made libextras.a.

But when I tried to link application program,(I append Makefile below)
I was encountered next error.

-- error log
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:731: unde
fined reference to `_cyg_panic'
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:731: unde
fined reference to `_cyg_net_malloc'
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:731: unde
fined reference to `_cyg_net_free'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_route.o): In function `cyg_rt_setgate':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:1016: und
efined reference to `_cyg_net_malloc'
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:1016: und
efined reference to `_cyg_net_free'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_route.o): In function `cyg_route_init':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/net/route.c:105: unde
fined reference to `_cyg_rn_init'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_uipc_domain.o): In function `pffasttimo':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/kern/uipc_domain.c:27
7: undefined reference to `_cyg_hz'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_uipc_domain.o): In function `pfslowtimo':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/kern/uipc_domain.c:26
3: undefined reference to `_cyg_hz'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_uipc_domain.o): In function `domaininit':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/kern/uipc_domain.c:16
1: undefined reference to `_zinit'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_uipc_socket.o): In function `cyg_sooptcopyout':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/sys/kern/uipc_socket.c:12
68: undefined reference to `_cyg_copyout'


-- sorry I omit intermediate part. too many "undefined reference to" occurred. --

/opt/ecoscvs_l/ecos/packages/net/common/current/src/bootp_support.c:611: undefin
ed reference to `_setdomainname'
/opt/ecoscvs_l/ecos/packages/net/common/current/src/bootp_support.c:611: undefin
ed reference to `_cyg_dns_res_init'
/ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/untitled1_instal
l/lib/libtarget.a(net_bsd_tcpip_timeout.o): In function `cyg_callout_reset':
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/ecos/timeout.c:414: undef
ined reference to `_cyg_current_time'
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/ecos/timeout.c:414: undef
ined reference to `_cyg_alarm_initialize'
/opt/ecoscvs_l/ecos/packages/net/bsd_tcpip/current/src/ecos/timeout.c:427: undef
ined reference to `_diag_printf'
collect2: ld returned 1 exit status
make: *** [nc_test_slave] Error 1



Next is my application's Makefile
=======================================
export PREFIX := /ecos-c/cygwin/home/LINK/ecoscvs_l_net_20080221-sh-elf-gcc4.1.1/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


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


## Build rules.
all: nc_test_slave

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

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

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

============================ end of Makefile

Please help me.
Masahiro Ariga

next is my last mail.
=========================
Hello everyone,

I have made sh-elf-gcc version 4.1.1 from gcc4.1.1.
I used two ways to make it.
After made them,I tried to run eCos configure.exe using them.
One was resulted in no problem other was resulted in error.
Although one was looked succeeded I am dubious about it's reliability.
So please enlighten me which do you think is the better one.

I decided the directory to hold newly built files to be
/usr/local/sh-elf/bin.

I downloaded next sources into /usr/local/sh-elf
and decompressed them.
binutils-2.16.tar.bz2
gcc-4.1.1.tar.bz2
newlib-1.14.0.tar.gz

And I made building-directories in which I executed building scripts.
/tmp/build/build_binutils
/tmp/build/build_gcc

The point is that Cygwin's original gnutools exec files' directory is next.
/cygwin/opt/ecos/gnutools/sh-elf/bin


I noticed when I build it is interfered with.
I must have found the way to avoid it.
Since I did not know correct way to do with it,
I concocted two ways to pass compiling through.

(1)
I remained original gnutools exec files' directory as it is,
but only renamed next two exe files in /opt/ecos/gnutools/sh-elf/bin.
sh-elf-as.exe.prev
sh-elf-gcc.exe.prev

After compiled, newly sh-elf-as.exe, sh-elf-gcc.exe and others were
generated in
\cygwin\usr\local\sh-elf\bin

I tried to run eCos configure.exe and tried to build
without any changing of PATH.
It appeared to succeed.It used sh-elf-gcc.

I appended eCos configure.exe building logs,in both cases of success and
failure.
Please refer to success one.

(2)
I felt anxiety that changing only two files is not enough.
So I renamed gnutools directory to gnutools-old.
And I executed building scripts,
but I was encountered error like next.

echo 'STMP_FIXINC="stmp-fixinc"' >>
/usr/local/sh-elf/lib/gcc/sh-elf/4.1-GNUSH_v0602/install-tool
s/mkheaders.conf
make[1]: *** No rule to make target
`/opt/ecos/gnutools/sh-elf/bin/sh-elf-ld', n
eeded by `stamp-collect-ld'. Stop.
make[1]: Leaving directory `/home/tkernel/shtools/buildshgcc/build_gcc/gcc'
make: *** [install-gcc] Error 2


I discovered in
C:\cygwin\tmp\build\build_gcc\gcc\Makefile
next odd lines.

ORIGINAL_LD_FOR_TARGET = /opt/ecos/gnutools/sh-elf/bin/sh-elf-ld
ORIGINAL_NM_FOR_TARGET = /opt/ecos/gnutools/sh-elf/bin/sh-elf-nm

I thought these should not be /opt/ecos/gnutools/
but point to newly directory /usr/local/sh-elf/.
So I changed these lines to next.

ORIGINAL_LD_FOR_TARGET = /usr/local/sh-elf/bin/sh-elf-ld
ORIGINAL_NM_FOR_TARGET = /usr/local/sh-elf/bin/sh-elf-nm

And I executed script to do only "make" like next.
make clean
make -w all install 2>&1 | tee makegcc.txt

After succeeded to compile,I made empty /opt/ecos/gnutools
and copied /usr/local/sh-elf under it.
I thought this way is more reliable than first one.
When I tried to run ecos configure.exe it apparently became slow to run.
And appeared warning of something like changing configuration.
Nevertheless I selected target and net and clicked "Library"
and then encountered error.
Please refer to failure log I appended.

Even (1) looked successful I am not sure I could use it.
Do you think it is reliable enough to use it for ecos configure.exe ?

Or if (2) is better reliable,please teach me the cause of error.
I am much obliged to your kindness.
Thank you in advance.

Masahiro Ariga




--------------------------------------------------------------------------------


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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