[Mingw-w64-public] How to do delay load in Mingw-w64

2014-04-29 Thread YIRAN LI
Hi friends,

I'm now moving my ffmpeg build from MinGW to Mingw-w64 because the latter
supports delay load. To be a bit more specific, ffmpeg could dynamically
link to many external libraries, but I want these external libs be
downloaded and used only when they are used (functions called).

For example, there'a libspeex for which I configured with ./configure
--enable-static=no --prefix=/mingw, so these files are generated
libspeex-1.dll, libspeex.dll.a libspeex.la.

According to this article
http://mingw-users.1079350.n2.nabble.com/Delayloading-windows-libraries-Finally-the-real-deal-td7472183.html,
what I need to do is:

1. gendef libspeex-1.dll to get the libspeex-1.def
2. dlltool --def libspeex-1.def --output-delaylib libspeex.dll.a

so the old libspeex.dll.a is replaced by the newly generated one, and 'make
install' will install header files and all lib files into mingw folder.

But what I want to know is, what's the libspeex.la ? Should I also
regenerate it or just install the old ones?

Great thanks
--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency

2014-05-05 Thread YIRAN LI
Hi,

I'm building an opensource project on mingw32 and found the generated dll
depends on  libgcc_s_sjlj-1.dll. The function referenced is __divdi3.

I tried to add ldflags = -static- libgcc, but seems it doesn't work.

Could any one let me know how can I get rid of this dependency?

Thanks
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency

2014-05-05 Thread YIRAN LI
2014-05-05 17:32 GMT+10:00 lh_mouse :

> 0) Try -static first. I have been using this option since long ago and it
> never fails;
> 1) Try -static-libgcc -static-libstdc++. These two should be used
> together. Using only one of them does not work, at least on my machine.
> 2) There is no space in '-static-libgcc'.
>
>
Thanks, I used -static, but seems it causes the project to generate static
libs instead of dlls. I think it should be the problem of the project
(libtheora) and I've sent out a mail to libtheora's mail list.


--
> Best regards,
> lh_mouse
> 2014-05-05
>
> -----
> 发件人:YIRAN LI 
> 发送日期:2014-05-05 15:19
> 收件人:mingw-w64-public
> 抄送:
> 主题:[Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency
>
> Hi,
>
> I'm building an opensource project on mingw32 and found the generated dll
> depends on  libgcc_s_sjlj-1.dll. The function referenced is __divdi3.
>
> I tried to add ldflags = -static- libgcc, but seems it doesn't work.
>
> Could any one let me know how can I get rid of this dependency?
>
> Thanks
>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency

2014-05-05 Thread YIRAN LI
2014-05-05 18:28 GMT+10:00 Alexpux :

>
> 05 мая 2014 г., в 12:22, YIRAN LI  написал(а):
>
>
>
>
> 2014-05-05 17:32 GMT+10:00 lh_mouse :
>
>> 0) Try -static first. I have been using this option since long ago and it
>> never fails;
>> 1) Try -static-libgcc -static-libstdc++. These two should be used
>> together. Using only one of them does not work, at least on my machine.
>> 2) There is no space in '-static-libgcc'.
>>
>>
> Thanks, I used -static, but seems it causes the project to generate static
> libs instead of dlls. I think it should be the problem of the project
> (libtheora) and I've sent out a mail to libtheora's mail list.
>
>
> Use -static you always get only static libs.
>

Thanks, then -static is not what I want. I need dlls. but these dlls can't
be dynamically linked to libgcc.

I also checked MinGW folder

hxuanyu-nch@hxuanyu-PC/cygdrive/c/i686-4.9.0-release-win32-sjlj-rt_v3-rev1/mingw32
$ find ./ -name "libgcc.a"
./lib/gcc/i686-w64-mingw32/4.9.0/64/libgcc.a
./lib/gcc/i686-w64-mingw32/4.9.0/libgcc.a

hxuanyu-nch@hxuanyu-PC/cygdrive/c/i686-4.9.0-release-win32-sjlj-rt_v3-rev1/mingw32
$ find ./ -name "libgcc_s.a"
./i686-w64-mingw32/lib/libgcc_s.a
./i686-w64-mingw32/lib64/libgcc_s.a
./lib/gcc/i686-w64-mingw32/lib/libgcc_s.a
./lib/gcc/i686-w64-mingw32/lib64/libgcc_s.a

see that there's no libgcc_s.a in ./lib/gcc/i686-w64-mingw32/4.9.0, I'm not
sure if I specify -static-libgcc, ld could find correct libgcc_s.a

Thanks




>
> --
>> Best regards,
>> lh_mouse
>> 2014-05-05
>>
>> -
>> 发件人:YIRAN LI 
>> 发送日期:2014-05-05 15:19
>> 收件人:mingw-w64-public
>> 抄送:
>> 主题:[Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency
>>
>> Hi,
>>
>> I'm building an opensource project on mingw32 and found the generated dll
>> depends on  libgcc_s_sjlj-1.dll. The function referenced is __divdi3.
>>
>> I tried to add ldflags = -static- libgcc, but seems it doesn't work.
>>
>> Could any one let me know how can I get rid of this dependency?
>>
>> Thanks
>>
>>
>>
>> --
>> Is your legacy SCM system holding you back? Join Perforce May 7 to find
>> out:
>> • 3 signs your SCM is hindering your productivity
>> • Requirements for releasing software faster
>> • Expert tips and advice for migrating your SCM now
>> http://p.sf.net/sfu/perforce
>> ___
>> Mingw-w64-public mailing list
>> Mingw-w64-public@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency

2014-05-05 Thread YIRAN LI
2014-05-05 20:42 GMT+10:00 Rafaël Carré :

> On 05/05/14 09:19, YIRAN LI wrote:
> > Hi,
> >
> > I'm building an opensource project on mingw32 and found the generated dll
> > depends on  libgcc_s_sjlj-1.dll. The function referenced is __divdi3.
> >
> > I tried to add ldflags = -static- libgcc, but seems it doesn't work.
> >
> > Could any one let me know how can I get rid of this dependency?
> >
> > Thanks
>
> See http://people.videolan.org/~funman/win/howto-gcc
>
>
Thanks Rafael,

The script seems doesn't work on my machine. I'm using
i686-4.8.2-release-win32-sjlj-rt_v3-rev3, but gcc -v prints nothing
containing LIBRARY_PATH.

What the script does is remove libgcc_s_sjlj-1.dll (I only need to remove
the dependency on libgcc). I manually moved libgcc_s_sjlj-1.dll and
libgcc.a. And then ln -s libgcc_eh.a libgcc_s.a

But libtheora can't pass ./configure. ld.exe can't find -lgcc. I have to
put libgcc_s_sjlj-1.dll and libgcc.a back to get configure and build
succeed.

Thanks

--
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to remove libgcc_s_sjlj-1.dll dependency

2014-05-05 Thread YIRAN LI
2014-05-05 22:16 GMT+10:00 Teemu Nätkinniemi :

> On 5.5.2014 10:19, YIRAN LI wrote:
> > I'm building an opensource project on mingw32 and found the generated
> > dll depends on  libgcc_s_sjlj-1.dll. The function referenced is __divdi3.
> >
> > I tried to add ldflags = -static- libgcc, but seems it doesn't work.
> >
> > Could any one let me know how can I get rid of this dependency?
>
> This should work:
>
> CC='gcc -static-libgcc -static-libstdc++' CXX='g++ -static-libgcc
> -static-libstdc++' ./configure
>
> This works for me!
I used CC='gcc -static-libgcc' and got what I want. What I used before that
didn't work was ./configure --enable-shared --disable-static
CFLAGS='-static-libgcc'.
Maybe cflags were wrongly ordered. Anyway, I'm able to statically build
now. Thanks to all of your guys

>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] Does GCC 4.9.0 supports -Wl,--gc-sections?

2016-03-19 Thread YIRAN LI
Hi guys,

I'm compiling on MingW-W64 and had a problem in using -Wl,--gc-setions.

I'm compiling 2 files into a shared library: a.c which contains a1, a2 and
b.c which contains b1 b2.

I used --fdata-sections -ffunction-setions to put each function into a
separate text section and by dumpbin I could see that's successful.

But when I link them to be a shared library, from the map file I can see
that b1 and b2 are also included into text section of the dll.

Below is the command I used

gcc -c -fdata-sections -ffucntion-sections a.c
gcc -c -fdata-sections -ffucntion-sections b.c
gcc -shared -Wl,--gc-sections -Wl,--version-script v.ver -Wl,-Map=out.map
 -Wl,--strip-all -o dll.dll a.o b.o

v.ver is the script to control export function list, its content is:
libsimple {
  global: a1;
a2;
  local: *;
};


dumpbin shows that each function is put into individual section.

COFF SYMBOL TABLE
000  DEBUG  notype   Filename | .file
a.c
002  SECT5  notype ()External | _a1
tag index  size  lines  next function 
004  SECT6  notype ()External | _a2
005  SECT7  notype ()External | _a3
006  SECT8  notype ()External | _a4
007  SECT1  notype   Static   | .text
Section length0, #relocs0, #linenums0, checksum0
009  SECT2  notype   Static   | .data
Section length0, #relocs0, #linenums0, checksum0
00B  SECT3  notype   Static   | .bss
Section length0, #relocs0, #linenums0, checksum0
00D  SECT4  notype   Static   | .rdata
Section length   7C, #relocs0, #linenums0, checksum0
00F  SECT5  notype   Static   | .text$a1
Section length   D9, #relocsA, #linenums0, checksum0
011  SECT6  notype   Static   | .text$a2
Section length   DC, #relocsA, #linenums0, checksum0
013  SECT7  notype   Static   | .text$a3
Section length   DC, #relocsA, #linenums0, checksum0
015  SECT8  notype   Static   | .text$a4
Section length   DC, #relocsA, #linenums0, checksum0
017  SECT9  notype   Static   | .rdata$zzz
Section length   3E, #relocs0, #linenums0, checksum0
019  UNDEF  notype ()External | _printf

String Table Size = 0x1A bytes

  Summary

   0 .bss
   0 .data
  7C .rdata
  40 .rdata$zzz
   0 .text
  DC .text$a1
  DC .text$a2
  DC .text$a3
  DC .text$a4

But out.map shows

 *(SORT(.text$*))
 .text$a1   0x623c2470   0xdc a.o
0x623c2470a1
 .text$a2   0x623c254c   0xdc a.o
0x623c254ca2
 .text$a3   0x623c2628   0xdc a.o
0x623c2628a3
 .text$a4   0x623c2704   0xdc a.o
0x623c2704a4
 .text$b1   0x623c27e0   0xdc b.o
0x623c27e0b1
 .text$b2   0x623c28bc   0xdc b.o
0x623c28bcb2
 .text$b3   0x623c2998   0xdc b.o
0x623c2998b3
 .text$b4   0x623c2a74   0xdc b.o
0x623c2a74b4


The gcc version I'm using is: gcc version 4.9.0 (i686-win32-sjlj-rev1,
Built by MinGW-W64 project)

Thanks for your help.
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public