On Wed, 18 Feb 2009 15:12:27 +0000, Pedro Alves <alves....@gmail.com>
wrote:
> On Tuesday 17 February 2009 12:11:47, Vincent R. wrote:
> 
>> When testing cegcc-4.4 when compiling a lib from EFL
>> libtool: link: arm-mingw32ce-gcc -O3 -pipe -Wl,--enable-auto-import
>> -Wl,-s
>> -o .libs/evil_suite.exe evil_suite.o evil_test_dlfcn.o
>> evil_test_environment.o evil_test_gettimeofday.o evil_test_link.o
>> evil_test_memcpy.o evil_test_mkstemp.o evil_test_realpath.o
>> memcpy_glibc_arm.o  -L/home/vincent/local/wince/lib
>> -L/home/vincent/toolchains/mingw32ce-4.4.0/lib
>> ../../src/lib/.libs/libevil.a ../../src/lib/dlfcn/.libs/libdl.a
>> /home/vincent/projects/efl/PROTO/evil/src/lib/.libs/libevil.a -lws2
>> evil_suite.o:evil_suite.c:(.text+0x20): undefined reference to
>> `__floatdidf'
>> evil_suite.o:evil_suite.c:(.text+0x30): undefined reference to
>> `__floatdidf'
>> 
>> Any idea why ?
>> Please note that from Vincent Torri explanation, libtool error message
>> prepend a _ so actually linker cannot find
>> _floatdidf function.
> 
> I'll take a look.  Either that function isn't being linked in to libgcc,
> or, it's being exported with the wrong underscores, maybe (CE is does not
> get an extra underscore in C linkage function names, contrary to desktop
> Windows,
> or to most other ARM targets).  Do you have a small testcase that shows
> the failure?
> 
First there is an issue with libstdc++.la because there is a reference to 
libstdc++.dll.a but it should be libstdc++.a Ithink (maybe a libtool
issue).
In addition with cegcc-4.1.0 there was some dependencies in that file 

/home/vincent/toolchains/mingw32ce-4.1.2/arm-mingw32ce/lib/libstdc++.la:
# Libraries that this one depends upon.
dependency_libs='
-L/home/vincent/projects/cegcc/src/scripts/build-mingw32ce-4.1.2/gcc/arm-mingw32ce/libstdc++-v3/src
-L/home/vincent/projects/cegcc/src/scripts/build-mingw32ce-4.1.2/gcc/arm-mingw32ce/libstdc++-v3/src/.libs
-lm -lm -lm
-L/home/vincent/projects/cegcc/src/scripts/build-mingw32ce-4.1.2/gcc/./gcc
-L/home/vincent/toolchains/mingw32ce-4.1.2/arm-mingw32ce/bin
-L/home/vincent/toolchains/mingw32ce-4.1.2/arm-mingw32ce/lib
-L/home/vincent/toolchains/mingw32ce-4.1.2/lib/gcc/arm-mingw32ce/4.1.2
-L/home/vincent/toolchains/mingw32ce-4.1.2/lib/gcc/arm-mingw32ce/4.1.2/../../../../arm-mingw32ce/lib
-lmingw32 -lgcc -lceoldname -lmingwex -lcoredll -lcoredll -lmingw32 -lgcc
-lceoldname -lmingwex -lcoredll -lm -lmingw32 -lgcc -lceoldname -lmingwex
-lcoredll -lcoredll -lmingw32 -lgcc -lceoldname -lmingwex -lcoredll'

/home/vincent/toolchains/mingw32ce-4.4.0/arm-mingw32ce/lib/libstdc++.la:
# Libraries that this one depends upon.
dependency_libs=''

About the testcase I cannot reproduce it with a simple testcase, the only
way for you to reproduce is
to do the following :

1)  Please check you don't have an old cegcc in your PATH


2) Create the following shell script efl-cegcc.sh and do not forget to
update cegcc-4.4 location

#! /bin/sh

export CEGCC_PATH=/opt/mingw32ce-4.4.0
export MINGW32CE_PATH=opt/mingw32ce-4.4.0
export WINCE_PATH=$HOME/local/wince

export PATH=$CEGCC_PATH/bin:$MINGW32CE_PATH/bin:$PATH
export CPPFLAGS="-I$WINCE_PATH/include"
export LDFLAGS="-L$WINCE_PATH/lib -L$CEGCC_PATH/lib"
export LD_LIBRARY_PATH="$WINCE_PATH/bin"
export PKG_CONFIG_PATH="$WINCE_PATH/lib/pkgconfig"
 
2) Source previous script : source ./efl-cegcc.sh

3) Download testcase here :
http://wwW.smartmobili.com/Downloads/testcase-bug.tar.bz2 and uncompress 

4) cd testcase-bug/evil/src/bin/; make (DO NOT RUN make clean because it's
already configured and if
you do it you will have to follow the following wiki to reproduce
http://wiki.enlightenment.org/index.php/EFL_Windows_CE)




>> I may have an explanation, it seems libstdc++ shared lib is not built, I
>> will check in this direction.
>> 
>> I have also noticed some differences in mingw32.h, it seems that you
have
>> removed some stuff about shared libs
>> because if I look at LINK_SPEC for instance
>> 
>> I have the following 
>> 
>> #define LINK_SPEC "%{shared: %{mdll: %eshared and mdll are not
>> compatible}}
>> \
>>   %{shared: --shared} %{mdll:--dll} \
>>   %{static:-Bstatic} %{!static:-Bdynamic} \
>>   %{shared|mdll: -e DllMainCRTStartup} \
>> 
>> 
>> and from your patch :
>> #define LINK_SPEC "%{shared: --shared} \
>>   %{static:-Bstatic} %{!static:-Bdynamic} \
>>   %{shared|mdll: -e DllMainCRTStartup --enable-auto-image-base} \
>>   %(shared_libgcc_undefs)"
>> 
>> ...
>> 
>> During my investigations I noticed also that when I used
>> --enable-auto-image-base, dll entry point
>> was located at a wrong address but you seem to use it anyway.
> 
> I have no idea what you mean by wrong address here.  But then
> again, as I said, I haven't tried running anything built with this
> toolchain yet.  You were probably seeing the load base of the dll
> had changed, and I thought that WinCE (at least <= 5, 6 maybe doesn't
> due to the address space changes) ignored that PE setting anyway?  Well,
we
> could remove that switch from the spec given this argument, but I'm
curious
> as to what was "wrong" --- since then it would be a linker bug to produce
> bad
> images --- it should refuse to accept such a switch when outputting CE
> images.
> 
>> So my questions is have you removed %mdll on purpose or is it a mistake
?
>> 
> 
> It was on purpose, it doesn't make sense to have it for CE.  But how does
> this question derive from the earlier one about --enable-auto-image-base?

I cannot reproduce it but if my memory serves me right, entry point was
located at
something like 64dc1000 <WinMainCRTStartup> instead of standard one.
It means that exe didn't work but this issue don't seem to happen anymore
with your patch.

Update : now the wrong address is located in the dll but wince is able to
load it anyway :

> arm-mingw32ce-objdump -x testDll.dll | less
start address 0x64dc1000









------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to