FAQ
Hello,

I need your help with problems on my vanilla perl setup. I guess these are more
appropriate to be called mingw problems, not perl problems, but there are
reasons I'll call you first.

The problem is, that gcc-3.4.5 that comes with vanilla setup, does strange
things depending on order of libs passed to the linker. The full setup is here:

http://karasik.eu.org/misc/mingw-link.tgz

where the good setup calls '-lXpm -lgdi32' and succeeds, and the bad
calls '-lgdi32 -lXpm' and fails. This is really strange, and I'd say is
a bug.

Now, before you throw me out to mingw dev list, I'd like to ask you if there
are some of you who run something more recent than 3.4.5, if you have
considered gcc4, possibly there are some of you who know about this particular
bug. So I'd like to ask you to try this setup on your latest gcc/mingw builds,
because I've run into this problem under vmware windows, and god knows how long
it would take me to configure and build all latest gcc/mingw to test this
problem.

What I'm hoping for is an answer with something along the lines of
'yes, we've tested it on 3.X.X, the bug was fixed there, and we'll
switch to that version soon'. If that's realistic, that would be excellent.
Otherwise, I'll have to go all the way down asking mingw and gcc devs,
while of course being unsure if that problem is fixable at all.


--
Sincerely,
Dmitry Karasik

Search Discussions

  • David Golden at Oct 2, 2008 at 8:27 pm

    On Thu, Oct 2, 2008 at 10:46 AM, Dmitry Karasik wrote:
    Now, before you throw me out to mingw dev list, I'd like to ask you if there
    are some of you who run something more recent than 3.4.5, if you have
    considered gcc4, possibly there are some of you who know about this particular
    I just tried dropping gcc4 (plus binutils + mingw runtime + win32api)
    in place of the "c" directory in my strawberry perl on a Win32 virtual
    machine. Your "good" case works. Your "bad" case fails. Output
    attached.

    I have little compiler-fu, so other than that quick test, I'm not sure
    how I can help you. It sounds like something you might take to the
    mingw-users mailing list.

    -- David
  • Dmitry Karasik at Oct 2, 2008 at 8:55 pm

    I just tried dropping gcc4 (plus binutils + mingw runtime + win32api)
    in place of the "c" directory in my strawberry perl on a Win32 virtual
    machine. Your "good" case works. Your "bad" case fails. Output
    attached.
    Thank you! So at least I know that the same problem exists on gcc4, so upgrade
    of gcc won't help here. I'll take that issue further to gcc/binutils people.

    --
    Sincerely,
    Dmitry Karasik
  • Peter Valdemar Mørch at Oct 2, 2008 at 10:54 pm
    Hi Dmitry,

    Dmitry Karasik dmitry-at-karasik.eu.org wrote:
    where the good setup calls '-lXpm -lgdi32' and succeeds, and the bad
    calls '-lgdi32 -lXpm' and fails. This is really strange, and I'd say is
    a bug.
    Hmm... Its been a while for me and C linking but as I remember it, the
    order of -l parameters *is* significant, if one library uses another.
    And just looking at the names of the libs above, it looks likely to me
    that one uses the other. (And I don't remember what must come first, the
    user or the used, sorry)

    Not being sure, I just wanted to ask if this isn't indeed a very correct
    behavior you're seeing. If I'm wrong I hope you'll just ignore my
    comments here... ;-)

    Peter
    --
    Peter Valdemar Mørch
    http://www.morch.com
  • Peter Valdemar Mørch at Oct 3, 2008 at 9:34 am

    Dmitry Karasik dmitry-at-karasik.eu.org |Old Lists| wrote:
    Hmm... Its been a while for me and C linking but as I remember it, the
    order of -l parameters *is* significant, if one library uses another.
    And just looking at the names of the libs above, it looks likely to me
    that one uses the other. (And I don't remember what must come first, the
    user or the used, sorry)
    It _does_ use one another. And now someone from gcc devs also tells me
    that the order is indeed significant, by design. So I'm confused now.
    One trick I've used in the past is just to include all -l's twice:

    -la -lb -la -lb

    Not pretty, but it does the trick! :-)

    Peter

    --
    Peter Valdemar Mørch
    http://www.morch.com
  • Dmitry Karasik at Oct 3, 2008 at 11:31 am

    One trick I've used in the past is just to include all -l's twice:
    -la -lb -la -lb
    Thanks! gcc devs told me to use --startgroup/--endgroup in ld arguments.

    --
    Sincerely,
    Dmitry Karasik

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupwin32-vanilla @
categoriesperl
postedOct 2, '08 at 2:46p
activeOct 3, '08 at 11:31a
posts6
users3
websitestrawberryperl.com

People

Translate

site design / logo © 2018 Grokbase