Loading ...
Sorry, an error occurred while loading the content.

Vim 6 and threaded perl 5.6 still don't compile

Expand Messages
  • Neil Bird
    I reported this a loooong while back for 5.7; I use a perl 5.6 built with threads, which seems to have different header/macro defs. to the normal perl. This
    Message 1 of 5 , Dec 1, 2000
    • 0 Attachment
      I reported this a loooong while back for 5.7; I use a perl 5.6 built
      with threads, which seems to have different header/macro defs. to the
      'normal' perl.

      This makes the 'assumed' perl headers in proto/if_perl.pro wrong.


      The attached patch for proto/if_perl.pro & if_perl.xs works *for me*,
      and seems to be the 'correct' way to define perl functional prototypes.


      However, that's me :-) It may well not work for perl < 5.6, or
      non-threaded perl. Could anyone with a bit of spare time try these out on
      a non-threaded and/or non perl-5.6 build?

      I don't really want to have to go through this *every* time I build a
      vim in the future :-/


      Patches are on top of latest UNIX vim 6.0n tgz.



      Is it right that the linker now links vim over & over again?

      link.sh: OK, linking works, let's try removing a few libraries.
      link.sh: See auto/link.log for details.
      link.sh: Trying to remove the SM library...
      link.sh: We don't need the SM library!
      link.sh: Trying to remove the SM library...
      link.sh: We don't need the SM library!
      link.sh: Trying to remove the SM library...
      link.sh: We don't need the SM library!
      link.sh: Trying to remove the ICE library...
      link.sh: We don't need the ICE library!
      link.sh: Trying to remove the ICE library...
      link.sh: We don't need the ICE library!
      link.sh: Trying to remove the ICE library...
      link.sh: We don't need the ICE library!
      link.sh: Trying to remove the nsl library...
      link.sh: We don't need the nsl library!
      link.sh: Trying to remove the nsl library...
      link.sh: We don't need the nsl library!
      link.sh: Trying to remove the nsl library...
      link.sh: We don't need the nsl library!
      link.sh: Trying to remove the nsl library...
      link.sh: We DO need the nsl library.
      link.sh: Trying to remove the socket library...
      link.sh: We don't need the socket library!
      link.sh: Trying to remove the socket library...
      link.sh: We don't need the socket library!
      link.sh: Trying to remove the socket library...
      link.sh: We don't need the socket library!
      link.sh: Trying to remove the socket library...
      link.sh: We DO need the socket library.
      link.sh: Trying to remove the elf library...
      link.sh: We don't need the elf library!
      link.sh: Trying to remove the Xt library...
      link.sh: We DO need the Xt library.
      link.sh: Trying to remove the Xpm library...
      link.sh: We don't need the Xpm library!
      link.sh: Trying to remove the X11 library...
      link.sh: We don't need the X11 library!
      link.sh: Trying to remove the X11 library...
      link.sh: We don't need the X11 library!
      link.sh: Trying to remove the X11 library...
      link.sh: We DO need the X11 library.
      link.sh: Trying to remove the pthread library...
      link.sh: We don't need the pthread library!
      link.sh: Trying to remove the m library...
      link.sh: We don't need the m library!
      link.sh: Trying to remove the m library...
      link.sh: We don't need the m library!
      link.sh: Trying to remove the perl library...
      link.sh: We DO need the perl library.
      link.sh: Trying to remove the crypt library...
      link.sh: We don't need the crypt library!


      (it has included, for some reason, these libraries more than once
      initially)

      --
      =====================- http://www.racaldefence.com/ -====================
      Neil Bird | If this .signature |
      work mailto:neil.bird@... | looks pants, then | $> cd /pub
      personal mailto:neil@... | stop using Outlook! | $> more beer
    • Bram Moolenaar
      ... The proto/if_perl.pro file is automatically generated. These patches disappear the next time I do make proto . Is there a way to avoid that? Updating
      Message 2 of 5 , Dec 1, 2000
      • 0 Attachment
        Neil Bird wrote:

        > I reported this a loooong while back for 5.7; I use a perl 5.6 built
        > with threads, which seems to have different header/macro defs. to the
        > 'normal' perl.
        >
        > This makes the 'assumed' perl headers in proto/if_perl.pro wrong.
        >
        >
        > The attached patch for proto/if_perl.pro & if_perl.xs works *for me*,
        > and seems to be the 'correct' way to define perl functional prototypes.

        The proto/if_perl.pro file is automatically generated. These patches
        disappear the next time I do "make proto". Is there a way to avoid that?
        Updating the prototypes manually is not very nice.

        > However, that's me :-) It may well not work for perl < 5.6, or
        > non-threaded perl. Could anyone with a bit of spare time try these out on
        > a non-threaded and/or non perl-5.6 build?

        Indeed, after this patch it doesn't work for me.

        > I don't really want to have to go through this *every* time I build a
        > vim in the future :-/

        If the functions are declared "static", "make proto" won't put them in
        proto/if_perl.pro. Is there a way to make these functions "static"? Doesn't
        look like this works. Then "sed" could be used to delete the lines.

        Adding the XS(); lines to proto/if_perl.pro doesn't work for me. Deleting
        them causes a number of warning messages for missing prototypes. What does
        work is then adding them to if_perl.xs.

        Try out the patch below.

        > Is it right that the linker now links vim over & over again?
        >
        > link.sh: OK, linking works, let's try removing a few libraries.
        > link.sh: See auto/link.log for details.
        > link.sh: Trying to remove the SM library...
        > link.sh: We don't need the SM library!
        [...]
        > link.sh: Trying to remove the crypt library...
        > link.sh: We don't need the crypt library!
        >
        > (it has included, for some reason, these libraries more than once
        > initially)

        Yep, that's right. The double libraries are caused by the linker arguments
        obtained from the perl and python interfaces. Removing them one by one is the
        safest thing to do. In many cases a library needs to appear only once.
        Sometimes it's not needed at all. Removing the "-l" arguments makes the
        executable a bit smaller and startup faster.


        *** dist/vim60n/src/Makefile Sun Nov 19 21:25:26 2000
        --- src/Makefile Fri Dec 1 20:32:00 2000
        ***************
        *** 1402,1409 ****
        rm auto/config.h
        mv auto/config.h.save auto/config.h

        if_perl.pro: auto/if_perl.c
        ! cproto $(PFLAGS) -DFEAT_GUI auto/if_perl.c > proto/$@


        notags:
        --- 1402,1411 ----
        rm auto/config.h
        mv auto/config.h.save auto/config.h

        + # if_perl.pro is special: Use the generated if_perl.c for input and remove
        + # prototypes for local functions.
        if_perl.pro: auto/if_perl.c
        ! cproto $(PFLAGS) -DFEAT_GUI auto/if_perl.c | sed "/_VI/d" > proto/$@


        notags:
        *** dist/vim60n/src/if_perl.xs Sat Nov 18 20:07:41 2000
        --- src/if_perl.xs Fri Dec 1 20:35:31 2000
        ***************
        *** 652,669 ****
        }
        }

        - /* Register any extra external extensions */
        #ifndef ACTIVE_PERL
        extern void
        #ifdef __BORLANDC__
        __import
        #endif
        boot_DynaLoader _((CV* cv));
        - extern void boot_VIM _((CV* cv));
        - #else
        - /* extern void boot_DynaLoader _((PerlInterpreter*), (CV* cv)); */
        - extern void boot_VIM _((PerlInterpreter*, CV* cv));
        #endif

        static void
        #ifndef ACTIVE_PERL
        --- 652,684 ----
        }
        }

        #ifndef ACTIVE_PERL
        extern void
        #ifdef __BORLANDC__
        __import
        #endif
        boot_DynaLoader _((CV* cv));
        #endif
        +
        + XS(XS_VIM_Msg);
        + XS(XS_VIM_SetOption);
        + XS(XS_VIM_DoCommand);
        + XS(XS_VIM_Eval);
        + XS(XS_VIM_Buffers);
        + XS(XS_VIM_Windows);
        + XS(XS_VIWIN_DESTROY);
        + XS(XS_VIWIN_Buffer);
        + XS(XS_VIWIN_SetHeight);
        + XS(XS_VIWIN_Cursor);
        + XS(XS_VIBUF_DESTROY);
        + XS(XS_VIBUF_Name);
        + XS(XS_VIBUF_Number);
        + XS(XS_VIBUF_Count);
        + XS(XS_VIBUF_Get);
        + XS(XS_VIBUF_Set);
        + XS(XS_VIBUF_Delete);
        + XS(XS_VIBUF_Append);
        + XS(boot_VIM);

        static void
        #ifndef ACTIVE_PERL
        *** dist/vim60n/src/proto/if_perl.pro Sun Nov 19 19:51:10 2000
        --- src/proto/if_perl.pro Fri Dec 1 20:36:17 2000
        ***************
        *** 6,27 ****
        void perl_buf_free __ARGS((buf_t *bp));
        void ex_perl __ARGS((exarg_t *eap));
        void ex_perldo __ARGS((exarg_t *eap));
        - void XS_VIM_Msg __ARGS((CV *cv));
        - void XS_VIM_SetOption __ARGS((CV *cv));
        - void XS_VIM_DoCommand __ARGS((CV *cv));
        - void XS_VIM_Eval __ARGS((CV *cv));
        - void XS_VIM_Buffers __ARGS((CV *cv));
        - void XS_VIM_Windows __ARGS((CV *cv));
        - void XS_VIWIN_DESTROY __ARGS((CV *cv));
        - void XS_VIWIN_Buffer __ARGS((CV *cv));
        - void XS_VIWIN_SetHeight __ARGS((CV *cv));
        - void XS_VIWIN_Cursor __ARGS((CV *cv));
        - void XS_VIBUF_DESTROY __ARGS((CV *cv));
        - void XS_VIBUF_Name __ARGS((CV *cv));
        - void XS_VIBUF_Number __ARGS((CV *cv));
        - void XS_VIBUF_Count __ARGS((CV *cv));
        - void XS_VIBUF_Get __ARGS((CV *cv));
        - void XS_VIBUF_Set __ARGS((CV *cv));
        - void XS_VIBUF_Delete __ARGS((CV *cv));
        - void XS_VIBUF_Append __ARGS((CV *cv));
        - void boot_VIM __ARGS((CV *cv));
        --- 6,8 ----
        --
        DENNIS: Listen -- strange women lying in ponds distributing swords is no
        basis for a system of government. Supreme executive power derives
        from a mandate from the masses, not from some farcical aquatic
        ceremony.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      • Paul Moore
        From: Bram@moolenaar.net [mailto:Bram@moolenaar.net] ... That was the problem I had with my earlier patch for if_perl.xs. As I use Windows and I don t have
        Message 3 of 5 , Dec 2, 2000
        • 0 Attachment
          From: Bram@... [mailto:Bram@...]
          > The proto/if_perl.pro file is automatically generated. These patches
          > disappear the next time I do "make proto". Is there a way to avoid that?
          > Updating the prototypes manually is not very nice.

          That was the problem I had with my earlier patch for if_perl.xs. As I use
          Windows and I don't have cproto, I didn't know how to fix the prototype
          generation. I see you've one this. Thanks.

          > > However, that's me :-) It may well not work for perl < 5.6, or
          > > non-threaded perl. Could anyone with a bit of spare time try
          > > these out on a non-threaded and/or non perl-5.6 build?
          >
          > Indeed, after this patch it doesn't work for me.

          Yes. My previous patch should handle Perl version compatibility. I'll
          resurrect it once Vim 6.0o (with this change) comes out. The Perl macro
          system is dreadfully nasty, and it changed in Perl 5.6. Getting the
          compatibilty stuff right is a real pain. I can test dynamic linking to Perl
          5.6 on Windows. Looks like Neil has threaded perl 5.6 (on Unix?). Bram - are
          you using Perl 5.6 or an earlier version?

          If I supply a patch for 6.0o, could people test it? I don't want to go
          through the hassle of getting the macro stuff right again, only to have Bram
          unwilling to take it because it may break compatibility (a reasonable fear!)

          Paul.
        • Bram Moolenaar
          ... I suppose we just have to keep testing with different Perl versions. I m using 5.005.03 on FreeBSD and 5.6 on Win32. ... It s best if a patch can be
          Message 4 of 5 , Dec 2, 2000
          • 0 Attachment
            Paul Moore wrote:

            > Yes. My previous patch should handle Perl version compatibility. I'll
            > resurrect it once Vim 6.0o (with this change) comes out. The Perl macro
            > system is dreadfully nasty, and it changed in Perl 5.6. Getting the
            > compatibilty stuff right is a real pain. I can test dynamic linking to Perl
            > 5.6 on Windows. Looks like Neil has threaded perl 5.6 (on Unix?). Bram - are
            > you using Perl 5.6 or an earlier version?

            I suppose we just have to keep testing with different Perl versions. I'm
            using 5.005.03 on FreeBSD and 5.6 on Win32.

            > If I supply a patch for 6.0o, could people test it? I don't want to go
            > through the hassle of getting the macro stuff right again, only to have Bram
            > unwilling to take it because it may break compatibility (a reasonable fear!)

            It's best if a patch can be tested on different Perl versions before I put it
            in a new release. It's not nice of people can't compile because of including
            a patch.

            --
            5 out of 4 people have trouble with fractions.

            /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
            \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
          • Paul Moore
            From: Bram@moolenaar.net [mailto:Bram@moolenaar.net] ... Good. The critical thing is to avoid breaking 5.005 compatibility. I can t test that myself as I only
            Message 5 of 5 , Dec 3, 2000
            • 0 Attachment
              From: Bram@... [mailto:Bram@...]
              > I suppose we just have to keep testing with different Perl versions. I'm
              > using 5.005.03 on FreeBSD and 5.6 on Win32.

              Good. The critical thing is to avoid breaking 5.005 compatibility. I can't
              test that myself as I only have Perl 5.6 (Win32).

              > It's best if a patch can be tested on different Perl versions
              > before I put it in a new release. It's not nice of people can't
              > compile because of including a patch.

              I agree entirely. On the other hand, including the patch is often what
              causes people to test and report issues. It's not easy - I'm happy to trust
              your judgement.

              On a vaguely related note, what are the earliest versions we would be
              expecting to support? For Perl, I'd suggest 5.005_03 and 5.6. For Python,
              I'd suggest 1.5.2, 1.6, and 2.0. These are the ones still in general use
              (AFAIK). The decision to phase out support for earlier versions is something
              we need to be careful of - one thing which would prompt it, I guess, is not
              having anyone who can test against the versions...

              I'll send the patch when 6.0o appears - if you don't have problems with
              5.005_03, and my testing works with 5.6, I think we should be OK.

              Paul.
            Your message has been successfully submitted and would be delivered to recipients shortly.