I dont know what PDL is and Im not googling it this moment. What is the function that your libgcc 4.7.0 linked dlls are trying to load that isn't in libgcc 4.4.7? Any reason you can't compile Minuit.dll and Slatec.dll with strawberry perl's gcc?
need to load the libgcc_s_sjlj-1.dll from the gcc-4.7.0 compiler that I used to build both perl and PDL - and a copy of that libgcc_s_sjlj-1.dll therefore sits alongside those 2 dll's in the distributed package. Instead, however, they use Strawberry's libgcc_s_sjlj-1.dll (which was already loaded by Strawberry Perl itself and is from the gcc-4.4.7 compiler), resulting in an "unfound entry point" error.
You said you built your own perl. I would assume then that was built with gcc 4.7.0, not strawberry perl's 4.4.* (???) gcc. You need to remove strawberry perl from your path. Your pushing the limits of, or breaking ABI compatibility. GetModuleHandle() or GetModuleHandleEx() the C call will return to you a HMODULE to your libgcc, not sure if it exists anywhere in XS off the top of my head. Now lets assume you are serious about swapping DLLs at runtime. If you FreeLibrary it, in theory, you will need to patch every other DLL's import table/PE image that links to libgcc with new libgcc function pointers. You WONT be able to patch anything that getproced libgcc. You'll probably have to hotpatch/redirect that old libgcc to the new one, quite doable, but your verging on virus/spyware programing :D Read about the PE format and RVAs. Plenty of C code required.
Looking in my various mingw builds, I see a libgcc.a at 3 MB, it has assembly code in it, I see a libgcc_eh.a at 42KB, and a libgcc_s.a at 74 KB. Google says the -static-libgcc will remove your dependency on libgcc.
You could also try to loadlibrary/getprocaddress in C/XS your problem away. LoadLibrary will load your specific DLL if you specify a full path and even if that DLL by file name has already been loaded. You probably will want to try to compile with -nostartfiles in gcc and see how what calls gcc wants from libgcc.dll. GNU indent post preprocessor C code is an excellent diagnostic tool when trying to nail down linking problems. I've never gotten SXS to work to any degree for me. It probably wont work for you because your libgccs arent manifested. Your dlls would have to sit in the winsxs folder. Maybe be in the registry. I've never gotten windows to honor a .manifest file in a folder. Use a PE image viewer and look at the import table of your dlls, and the export tables of various dlls.
Another idea would be to "embed" strawberry perl, then loadlibrary strawberry perl's perl51X.dll. This way your 4.7.0 libgcc will be in memory before perl has a change to load. Since S Perl's libgcc is older, is probably will load fine with a newer libgcc than it was compiled with. You could just copy over S Perl's libgcc dll with your 4.7.0 and see what happens. Is this for yourself, your company/employer, or CPAN quality?
Plenty of grammer and sentence mistakes above. I'm not reading twice what I wrote. I gave you alot of ideas. Sane and insane.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.