libavcodec and libswscale linking problem with mingw32ce

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

libavcodec and libswscale linking problem with mingw32ce

David Sveningsson
Hi, sorry for crossposting this message, I don't know which list is most
suitable.

I am trying to compile the ffmpeg libraries for use on Windows Mobile
6.1 using minggw32ce that comes with cegcc. I've had some success but
the linker always fail with libavcodec and libswscale, even when using
minimalistic build-settings (disabling everything). The other dll's
works and is even loadable on the phone.

The other two fails with:

collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld:
nmimp000000.o: reloc against a non-existant symbol index: 2169

and

collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld:
nmimp000000.o: reloc against a non-existant symbol index: 8236

I am using the latest version of mingw32ce (svn -r1437) and am trying to
build ffmpeg svn -r21223 (with -r21155 reverse-merged). Any ideas what
is wrong and/or how I can solve it would be great.



The full configure arguments:
./configure --disable-static --enable-shared --enable-memalign-hack
--prefix=/cygdrive/c/prefix/wince/ --cross-prefix=arm-mingw32ce-
--target-os=mingw32ce --disable-encoders --disable-filters
--disable-bsfs --disable-muxers --disable-demuxers --arch=arm
--cpu=armv4 --extra-ldflags="-Wl,--enable-auto-import"
--disable-decoders --disable-parsers --disable-optimizations
--disable-stripping

Full output:
$ make
/cygdrive/c/mingw32ce/ffmpeg/version.sh "/cygdrive/c/mingw32ce/ffmpeg"
version.h
arm-mingw32ce-gcc -shared -Wl,--output-def,libavcodec/avcodec-52.def
-Wl,--out-implib,libavcodec/libavcodec.dll.a
-Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base
-L"/cygdrive/c/mingw32ce/ffmpeg"/libavcodec
-L"/cygdrive/c/mingw32ce/ffmpeg"/libavdevice
-L"/cygdrive/c/mingw32ce/ffmpeg"/libavfilter
-L"/cygdrive/c/mingw32ce/ffmpeg"/libavformat
-L"/cygdrive/c/mingw32ce/ffmpeg"/libavutil
-L"/cygdrive/c/mingw32ce/ffmpeg"/libpostproc
-L"/cygdrive/c/mingw32ce/ffmpeg"/libswscale -Wl,--enable-auto-import
-Wl,--warn-common -Wl,--as-needed
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libpostproc
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libswscale
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libavfilter
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libavdevice
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libavformat
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libavcodec
-Wl,-rpath-link,"/cygdrive/c/mingw32ce/ffmpeg"/libavutil -Wl,-Bsymbolic
-o libavcodec/avcodec-52.dll libavcodec/allcodecs.o
libavcodec/audioconvert.o libavcodec/avpacket.o libavcodec/bitstream.o
libavcodec/bitstream_filter.o libavcodec/dsputil.o libavcodec/eval.o
libavcodec/faanidct.o libavcodec/imgconvert.o libavcodec/jrevdct.o
libavcodec/opt.o libavcodec/options.o libavcodec/parser.o
libavcodec/raw.o libavcodec/resample.o libavcodec/resample2.o
libavcodec/simple_idct.o libavcodec/utils.o
libavcodec/arm/dsputil_init_arm.o libavcodec/arm/dsputil_arm.o
libavcodec/arm/fft_init_arm.o libavcodec/arm/h264pred_init_arm.o
libavcodec/arm/jrevdct_arm.o libavcodec/arm/mpegvideo_arm.o
libavcodec/arm/simple_idct_arm.o -lavutil -lm
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld:
nmimp000000.o: reloc against a non-existant symbol index: 2169
make: *** [libavcodec/avcodec-52.dll] Error 1

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Fri, 2010-01-15 at 13:35 +0100, David Sveningsson wrote:
> Hi, sorry for crossposting this message, I don't know which list is most
> suitable.
>
> I am trying to compile the ffmpeg libraries for use on Windows Mobile
> 6.1 using minggw32ce that comes with cegcc. I've had some success but
> the linker always fail with libavcodec and libswscale, even when using
> minimalistic build-settings (disabling everything). The other dll's
> works and is even loadable on the phone.

I tried your configure command and get errno problems. Did you get those
too ?

        Danny

pavilion: {2892} make
arm-mingw32ce-gcc -DHAVE_AV_CONFIG_H -I.
-I"/home/danny/src/ffmpeg/ffmpeg" -D_ISOC99_SOURCE
-D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-march=armv4 -std=c99 -D_WIN32_WINNT=0x0501 -fno-common -marm -g
-Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual
-Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros
-fno-tree-vectorize       -MMD -MF libavdevice/alldevices.d -MT
libavdevice/alldevices.o -c -o libavdevice/alldevices.o
libavdevice/alldevices.c
In file included from ./libavcodec/avcodec.h:29,
                 from ./libavformat/avformat.h:56,
                 from libavdevice/alldevices.c:22:
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/errno.h:12:25: error: no include path in which to search for errno.h
In file included from ./libavutil/common.h:30,
                 from ./libavutil/avutil.h:66,
                 from ./libavcodec/avcodec.h:30,
                 from ./libavformat/avformat.h:56,
                 from libavdevice/alldevices.c:22:
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/errno.h:12:25: error: no include path in which to search for errno.h
In file included from ./libavformat/avformat.h:56,
                 from libavdevice/alldevices.c:22:
./libavcodec/avcodec.h:3769:5: warning: "EINVAL" is not defined
gmake: *** [libavdevice/alldevices.o] Error 1


--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Sat, 2010-01-16 at 17:34 +0100, Danny Backx wrote:

> On Fri, 2010-01-15 at 13:35 +0100, David Sveningsson wrote:
> > Hi, sorry for crossposting this message, I don't know which list is most
> > suitable.
> >
> > I am trying to compile the ffmpeg libraries for use on Windows Mobile
> > 6.1 using minggw32ce that comes with cegcc. I've had some success but
> > the linker always fail with libavcodec and libswscale, even when using
> > minimalistic build-settings (disabling everything). The other dll's
> > works and is even loadable on the phone.
>
> I tried your configure command and get errno problems. Did you get those
> too ?

I'd still like the answer to that first question, but after bypassing
these issues, I did see evidence of a problem I need to look into. See
the ld crash below.

Note I also stumbled on an assembler I cannot solve immediately. Can
you ?

arm-mingw32ce-gcc -DHAVE_AV_CONFIG_H -I.
-I"/home/danny/src/ffmpeg/ffmpeg" -D_ISOC99_SOURCE
-D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-march=armv4 -g -MMD -MF libavcodec/arm/dsputil_arm.d -MT
libavcodec/arm/dsputil_arm.o -c -o libavcodec/arm/dsputil_arm.o
libavcodec/arm/dsputil_arm.S
libavcodec/arm/dsputil_arm.S: Assembler messages:
libavcodec/arm/dsputil_arm.S:711: Error: selected processor does not
support `bx lr'
gmake: *** [libavcodec/arm/dsputil_arm.o] Error 1


        Danny

arm-mingw32ce-gcc -shared -Wl,--output-def,libswscale/swscale-0.def
-Wl,--out-implib,libswscale/libswscale.dll.a
-Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base
-Wl,--version-script,libswscale/libswscale.ver
-L"/home/danny/src/ffmpeg/ffmpeg"/libavcodec
-L"/home/danny/src/ffmpeg/ffmpeg"/libavdevice
-L"/home/danny/src/ffmpeg/ffmpeg"/libavfilter
-L"/home/danny/src/ffmpeg/ffmpeg"/libavformat
-L"/home/danny/src/ffmpeg/ffmpeg"/libavutil
-L"/home/danny/src/ffmpeg/ffmpeg"/libpostproc
-L"/home/danny/src/ffmpeg/ffmpeg"/libswscale -Wl,--enable-auto-import
-Wl,--warn-common -Wl,--as-needed
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libpostproc
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libswscale
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavfilter
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavdevice
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavformat
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavcodec
-Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavutil -Wl,-Bsymbolic
-o libswscale/swscale-0.dll libswscale/options.o libswscale/rgb2rgb.o
libswscale/swscale.o libswscale/yuv2rgb.o -lavutil -lm
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld: nmimp000000.o: reloc against a non-existant symbol index: 456
gmake: *** [libswscale/swscale-0.dll] Error 1
gmake: Target `all' not remade because of errors.

pavilion: {2999} gdb arm-mingw32ce-ld core.3365
GNU gdb 6.8-6mdv2009.1 (Mandriva Linux release 2009.1)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...

warning: core file may not match specified executable file.

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by
`/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld --s'.
Program terminated with signal 11, Segmentation fault.
[New process 3365]
#0  0x400baa6a in strcmp () from /lib/i686/libc.so.6
Missing debug package(s), you should install:
glibc-debug-2.9-0.20081113.5mnb2.i586 zlib-debug-1.2.3-13mdv2009.1.i586
(gdb) where
#0  0x400baa6a in strcmp () from /lib/i686/libc.so.6
#1  0x080676e9 in pe_walk_relocs_of_symbol (info=0x80db5a0,
    name=0x815ec2b "av_pix_fmt_descriptors", cb=0x8064c60
<make_import_fixup>)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/pe-dll.c:1261
#2  0x08064147 in pe_find_data_imports () at earm_wince_pe.c:1027
#3  0x080642d7 in gld_arm_wince_pe_after_open () at earm_wince_pe.c:1124
#4  0x08058b68 in lang_process ()

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldlang.c:6293
#5  0x0805cbf8 in main (argc=Cannot access memory at address 0x0
)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldmain.c:455


--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Martin Storsjö
On Sun, 17 Jan 2010, Danny Backx wrote:

> Note I also stumbled on an assembler I cannot solve immediately. Can
> you ?
>
> libavcodec/arm/dsputil_arm.S:711: Error: selected processor does not
> support `bx lr'

IIRC, you need to configure ffmpeg with --cpu=armv4t for this arm assembly
to be supported.

// Martin

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

David Sveningsson
On 2010-01-17 10:06, Martin Storsjö wrote:

> On Sun, 17 Jan 2010, Danny Backx wrote:
>
>> Note I also stumbled on an assembler I cannot solve immediately. Can
>> you ?
>>
>> libavcodec/arm/dsputil_arm.S:711: Error: selected processor does not
>> support `bx lr'
>
> IIRC, you need to configure ffmpeg with --cpu=armv4t for this arm assembly
> to be supported.
>
> // Martin


It didn't work with --cpu=armv4t either, so I did replace "bx lr" with
"mov pc, lr".

On 2010-01-16 17:34, Danny Backx wrote:

> On Fri, 2010-01-15 at 13:35 +0100, David Sveningsson wrote:
>> Hi, sorry for crossposting this message, I don't know which list is most
>> suitable.
>>
>> I am trying to compile the ffmpeg libraries for use on Windows Mobile
>> 6.1 using minggw32ce that comes with cegcc. I've had some success but
>> the linker always fail with libavcodec and libswscale, even when using
>> minimalistic build-settings (disabling everything). The other dll's
>> works and is even loadable on the phone.
>
> I tried your configure command and get errno problems. Did you get those
> too ?

Yes, I got issues with both errno and signal, so I've got simple
replacements for them. I've forgot to mention them in the original mail.
The headers I used are the ones provided with cegcc but with the
mingw32ce include_next lines removed.




$ cat signal.c
#include "signal.h"

sighandler_t signal(int signum, sighandler_t handler){
         // do nothing
}




$ cat errno.c
#include "errno.h"
#include <stdio.h>

static int __errno_int = 0;

_CRTIMP extern int * __cdecl _errno(void){
         return &__errno_int;
}

char* strerror(int errnum){
         return "<strerror not implemented>";
}

void perror(const char *s){
         printf("%s: <perror not implemented>\n", s);
}

char* getenv(const char* varname){
         return "";
}




$ svn diff Makefile
Index: Makefile
===================================================================
--- Makefile    (revision 21223)
+++ Makefile    (working copy)
@@ -67,9 +67,15 @@
  ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
  ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)

-%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
-       $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
+errno.o: errno.c
+       ${CC} -c -o errno.o errno.c

+signal.o: signal.c
+       ${CC} -c -o signal.o signal.c
+
+%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) errno.o signal.o
+       $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o errno.o signal.o
$(FF_EXTRALIBS)
+
  tools/%$(EXESUF): tools/%.o
         $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

David Sveningsson
On 2010-01-18 13:17, David Sveningsson wrote:

> On 2010-01-17 10:06, Martin Storsjö wrote:
>> On Sun, 17 Jan 2010, Danny Backx wrote:
>>
>>> Note I also stumbled on an assembler I cannot solve immediately. Can
>>> you ?
>>>
>>> libavcodec/arm/dsputil_arm.S:711: Error: selected processor does not
>>> support `bx lr'
>>
>> IIRC, you need to configure ffmpeg with --cpu=armv4t for this arm assembly
>> to be supported.
>>
>> // Martin
>
>
> It didn't work with --cpu=armv4t either, so I did replace "bx lr" with
> "mov pc, lr".

Scratch that, with armv4t "bx lr" works but for other families it must
be replaced with "mov pc, lr".

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

David Sveningsson
In reply to this post by Danny Backx
On 2010-01-17 09:21, Danny Backx wrote:

> I'd still like the answer to that first question, but after bypassing
> these issues, I did see evidence of a problem I need to look into. See
> the ld crash below.
>
> arm-mingw32ce-gcc -shared -Wl,--output-def,libswscale/swscale-0.def
> -Wl,--out-implib,libswscale/libswscale.dll.a
> -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base
> -Wl,--version-script,libswscale/libswscale.ver
> -L"/home/danny/src/ffmpeg/ffmpeg"/libavcodec
> -L"/home/danny/src/ffmpeg/ffmpeg"/libavdevice
> -L"/home/danny/src/ffmpeg/ffmpeg"/libavfilter
> -L"/home/danny/src/ffmpeg/ffmpeg"/libavformat
> -L"/home/danny/src/ffmpeg/ffmpeg"/libavutil
> -L"/home/danny/src/ffmpeg/ffmpeg"/libpostproc
> -L"/home/danny/src/ffmpeg/ffmpeg"/libswscale -Wl,--enable-auto-import
> -Wl,--warn-common -Wl,--as-needed
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libpostproc
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libswscale
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavfilter
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavdevice
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavformat
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavcodec
> -Wl,-rpath-link,"/home/danny/src/ffmpeg/ffmpeg"/libavutil -Wl,-Bsymbolic
> -o libswscale/swscale-0.dll libswscale/options.o libswscale/rgb2rgb.o
> libswscale/swscale.o libswscale/yuv2rgb.o -lavutil -lm
> collect2: ld terminated with signal 11 [Segmentation fault], core dumped
> /opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld: nmimp000000.o: reloc against a non-existant symbol index: 456
> gmake: *** [libswscale/swscale-0.dll] Error 1
> gmake: Target `all' not remade because of errors.
>
> pavilion: {2999} gdb arm-mingw32ce-ld core.3365
> GNU gdb 6.8-6mdv2009.1 (Mandriva Linux release 2009.1)
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "i586-mandriva-linux-gnu"...
>
> warning: core file may not match specified executable file.
>
> warning: Can't read pathname for load map: Input/output error.
> Reading symbols from /lib/libz.so.1...done.
> Loaded symbols for /lib/libz.so.1
> Reading symbols from /lib/i686/libc.so.6...done.
> Loaded symbols for /lib/i686/libc.so.6
> Reading symbols from /lib/ld-linux.so.2...done.
> Loaded symbols for /lib/ld-linux.so.2
> Core was generated by
> `/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld --s'.
> Program terminated with signal 11, Segmentation fault.
> [New process 3365]
> #0  0x400baa6a in strcmp () from /lib/i686/libc.so.6
> Missing debug package(s), you should install:
> glibc-debug-2.9-0.20081113.5mnb2.i586 zlib-debug-1.2.3-13mdv2009.1.i586
> (gdb) where
> #0  0x400baa6a in strcmp () from /lib/i686/libc.so.6
> #1  0x080676e9 in pe_walk_relocs_of_symbol (info=0x80db5a0,
>      name=0x815ec2b "av_pix_fmt_descriptors", cb=0x8064c60
> <make_import_fixup>)
>
> at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/pe-dll.c:1261
> #2  0x08064147 in pe_find_data_imports () at earm_wince_pe.c:1027
> #3  0x080642d7 in gld_arm_wince_pe_after_open () at earm_wince_pe.c:1124
> #4  0x08058b68 in lang_process ()
>
> at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldlang.c:6293
> #5  0x0805cbf8 in main (argc=Cannot access memory at address 0x0
> )
>
> at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldmain.c:455
>
>

The callstack I get is similar but not quite the same:

(gdb) bt
#0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
/home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
#1  coff_write_object_contents (abfd=0x196ff20) at
/home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:4131
#2  0x000000000042fb57 in bfd_make_readable (abfd=0x196ff20) at
/home/ext/temp/cegcc/src/binutils/bfd/opncls.c:865
#3  0x0000000000424510 in make_singleton_name_imp (rel=0x1db62a0,
s=<value optimized out>, addend=0)
     at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2253
#4  pe_create_import_fixup (rel=0x1db62a0, s=<value optimized out>,
addend=0) at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2570
#5  0x000000000041dda2 in make_import_fixup (rel=0x1db62a0, s=0x19810c0)
at earm_wince_pe.c:957
#6  0x00000000004203e7 in pe_walk_relocs_of_symbol (info=<value
optimized out>, name=0x1981ea0 "av_pix_fmt_descriptors",
     cb=0x41dd20 <make_import_fixup>) at
/home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:1262
#7  0x000000000041d1eb in pe_find_data_imports () at earm_wince_pe.c:1027
#8  0x000000000041d3ba in gld_arm_wince_pe_after_open () at
earm_wince_pe.c:1124
#9  0x0000000000410e48 in lang_process () at
/home/ext/temp/cegcc/src/binutils/ld/ldlang.c:6293
#10 0x0000000000415907 in main (argc=83, argv=0x7fff39dc8b58) at
/home/ext/temp/cegcc/src/binutils/ld/ldmain.c:455


(gdb) frame 0
#0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
/home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
2651              if (q->sym_ptr_ptr[0]->the_bfd != abfd)



(gdb) p q->sym_ptr_ptr[0]
$5 = (struct bfd_symbol *) 0x0



This deference is what's causing my SIGSEGV and looking at your
callstack I see that your frame #1 matches my frame #6 so I guess the
issues are related.


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Mon, 2010-01-18 at 16:26 +0100, David Sveningsson wrote:
> The callstack I get is similar but not quite the same:
>
> (gdb) bt
> #0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
> #1  coff_write_object_contents (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:4131

Yes, I see that same callstack now.

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Cegcc-devel] libavcodec and libswscale linking problem with mingw32ce

Danny Backx
In reply to this post by David Sveningsson
On Mon, 2010-01-18 at 16:26 +0100, David Sveningsson wrote:

> (gdb) bt
> #0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
> #1  coff_write_object_contents (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:4131
> #2  0x000000000042fb57 in bfd_make_readable (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/opncls.c:865
> #3  0x0000000000424510 in make_singleton_name_imp (rel=0x1db62a0,
> s=<value optimized out>, addend=0)
>      at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2253
> #4  pe_create_import_fixup (rel=0x1db62a0, s=<value optimized out>,
> addend=0) at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2570
> #5  0x000000000041dda2 in make_import_fixup (rel=0x1db62a0, s=0x19810c0)
> at earm_wince_pe.c:957
> #6  0x00000000004203e7 in pe_walk_relocs_of_symbol (info=<value
> optimized out>, name=0x1981ea0 "av_pix_fmt_descriptors",
>      cb=0x41dd20 <make_import_fixup>) at
> /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:1262
> #7  0x000000000041d1eb in pe_find_data_imports () at earm_wince_pe.c:1027
> #8  0x000000000041d3ba in gld_arm_wince_pe_after_open () at
> earm_wince_pe.c:1124
> #9  0x0000000000410e48 in lang_process () at
> /home/ext/temp/cegcc/src/binutils/ld/ldlang.c:6293
> #10 0x0000000000415907 in main (argc=83, argv=0x7fff39dc8b58) at
> /home/ext/temp/cegcc/src/binutils/ld/ldmain.c:455
>
>
> (gdb) frame 0
> #0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
> 2651              if (q->sym_ptr_ptr[0]->the_bfd != abfd)
>
>
>
> (gdb) p q->sym_ptr_ptr[0]
> $5 = (struct bfd_symbol *) 0x0

ld is looking for the av_pix_fmt_descriptors symbol. When it finds it,
it tries to handle it (make_import_fixup) but it ends up crashing in
make_singleton_name_imp. That's for the .idata$5 section.

Strangely, it has already done make_singleton_name_thunk which is
similar but succeeds. That's for .idata$4.

This is the first call to make_import_fixup in that run of ld.

The symbol you print (value 0x0) does have a sensible value in the
execution of make_singleton_name_thunk - for .idata$4.

Looking further, but additional eyes might help :-)

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
In reply to this post by David Sveningsson
On Mon, 2010-01-18 at 16:26 +0100, David Sveningsson wrote:

> The callstack I get is similar but not quite the same:
>
> (gdb) bt
> #0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
> #1  coff_write_object_contents (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:4131
> #2  0x000000000042fb57 in bfd_make_readable (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/opncls.c:865
> #3  0x0000000000424510 in make_singleton_name_imp (rel=0x1db62a0,
> s=<value optimized out>, addend=0)
>      at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2253
> #4  pe_create_import_fixup (rel=0x1db62a0, s=<value optimized out>,
> addend=0) at /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:2570
> #5  0x000000000041dda2 in make_import_fixup (rel=0x1db62a0, s=0x19810c0)
> at earm_wince_pe.c:957
> #6  0x00000000004203e7 in pe_walk_relocs_of_symbol (info=<value
> optimized out>, name=0x1981ea0 "av_pix_fmt_descriptors",
>      cb=0x41dd20 <make_import_fixup>) at
> /home/ext/temp/cegcc/src/binutils/ld/pe-dll.c:1262
> #7  0x000000000041d1eb in pe_find_data_imports () at earm_wince_pe.c:1027
> #8  0x000000000041d3ba in gld_arm_wince_pe_after_open () at
> earm_wince_pe.c:1124
> #9  0x0000000000410e48 in lang_process () at
> /home/ext/temp/cegcc/src/binutils/ld/ldlang.c:6293
> #10 0x0000000000415907 in main (argc=83, argv=0x7fff39dc8b58) at
> /home/ext/temp/cegcc/src/binutils/ld/ldmain.c:455
>
>
> (gdb) frame 0
> #0  0x00000000004442bb in coff_write_relocs (abfd=0x196ff20) at
> /home/ext/temp/cegcc/src/binutils/bfd/coffcode.h:2651
> 2651              if (q->sym_ptr_ptr[0]->the_bfd != abfd)
>
>
>
> (gdb) p q->sym_ptr_ptr[0]
> $5 = (struct bfd_symbol *) 0x0

FYI I've had little time lately but I'm continuing to pursue this issue.

I've created a small test program that got ld to crash in a different
way, and solved that yesterday. Unfortunately, that fix (it's in SVN)
didn't solve the original program.

I'll try to get at this with a better test program :-)

If anyone has any, please don't hesitate to send it.

        Danny

--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Sun, 2010-02-28 at 08:33 +0100, Danny Backx wrote:
> I'll try to get at this with a better test program :-)
>
> If anyone has any, please don't hesitate to send it.

Simple test attached.

        Danny

pavilion: {111} make
arm-mingw32ce-gcc     -c -o t.o t.c
arm-mingw32ce-gcc     -c -o l.o l.c
arm-mingw32ce-gcc  -shared -o l.dll l.o
arm-mingw32ce-gcc  -shared -Wl,--enable-auto-import -o t.dll t.o -L. -ll
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
make: *** [t.dll] Error 1
pavilion: {112} gdb /opt/mingw32ce/arm-mingw32ce/bin/ld core.13287
GNU gdb 6.8-7mdv2010.0 (Mandriva Linux release 2010.0)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by
`/opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld --s'.
Program terminated with signal 11, Segmentation fault.
[New process 13287]
#0  0x0808b531 in coff_write_relocs (abfd=0x97ee558, first_undef=2)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/bfd/coffcode.h:2665
2665              if (q->sym_ptr_ptr[0]->the_bfd != abfd)
Missing debug package(s), you should install:
glibc-debug-2.10.1-6.2mnb2.i586 zlib-debug-1.2.3-13mdv2010.0.i586
(gdb) bt
#0  0x0808b531 in coff_write_relocs (abfd=0x97ee558, first_undef=2)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/bfd/coffcode.h:2665
#1  0x0808c7c4 in coff_write_object_contents (abfd=0x97ee558)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/bfd/coffcode.h:4145
#2  0x080787c0 in bfd_make_readable (abfd=0x97ee558)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/bfd/opncls.c:865
#3  0x0806b330 in make_singleton_name_imp (import=0x96a5b44 "a",
parent=0x9699a78)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/pe-dll.c:2253
#4  0x0806c1cf in pe_create_import_fixup (rel=0x96a5d40, s=0x96a66b0,
addend=0)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/pe-dll.c:2570
#5  0x08064e5b in make_import_fixup (rel=0x96a5d40, s=0x96a66b0) at
earm_wince_pe.c:964
#6  0x080689ee in pe_walk_relocs_of_symbol (info=0x80e95e0,
name=0x969bebc "a",
    cb=0x8064dc0 <make_import_fixup>)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/pe-dll.c:1262
#7  0x08064271 in pe_find_data_imports () at earm_wince_pe.c:1034
#8  0x08064441 in gld_arm_wince_pe_after_open () at earm_wince_pe.c:1131
#9  0x0805f7bb in ldemul_after_open ()

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldemul.c:66
#10 0x08058916 in lang_process ()

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldlang.c:6293
#11 0x0805c93e in main (argc=27, argv=0xbfe0f494)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/binutils/ld/ldmain.c:455
(gdb)

--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

ldbug.tar.gz (508 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Sun, 2010-02-28 at 14:16 +0100, Danny Backx wrote:
> On Sun, 2010-02-28 at 08:33 +0100, Danny Backx wrote:
> > I'll try to get at this with a better test program :-)
> >
> > If anyone has any, please don't hesitate to send it.
>
> Simple test attached.

I think I finally got this sorted out. It looks like ld/pe-dll.c
contains a function make_singleton_name_imp which is a bad copy of
make_singleton_name_thunk. Three simple fixes did the job.

Please test.

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libavcodec and libswscale linking problem with mingw32ce

Danny Backx
On Tue, 2010-03-02 at 18:29 +0100, Danny Backx wrote:

> On Sun, 2010-02-28 at 14:16 +0100, Danny Backx wrote:
> > On Sun, 2010-02-28 at 08:33 +0100, Danny Backx wrote:
> > > I'll try to get at this with a better test program :-)
> > >
> > > If anyone has any, please don't hesitate to send it.
> >
> > Simple test attached.
>
> I think I finally got this sorted out. It looks like ld/pe-dll.c
> contains a function make_singleton_name_imp which is a bad copy of
> make_singleton_name_thunk. Three simple fixes did the job.
>
> Please test.

Warning - I appear to have screwed something up in my test environment.
The DLL gets built but doesn't load.

Continuing the search ...

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel