Bug 1456455 - vim-8.0.600-1.fc27 FTBFS with Perl 5.26.0
Summary: vim-8.0.600-1.fc27 FTBFS with Perl 5.26.0
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-29 12:36 UTC by Petr Pisar
Modified: 2017-05-31 10:39 UTC (History)
5 users (show)

Fixed In Version: vim-8.0.606-2.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-31 10:35:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed fix (4.66 KB, patch)
2017-05-29 12:36 UTC, Petr Pisar
no flags Details | Diff

Description Petr Pisar 2017-05-29 12:36:00 UTC
Created attachment 1283218 [details]
Proposed fix

vim-8.0.600-1.fc27 will fail to build when perl-5.26.0 comes into the build root (in a week or so):

  gcc   -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed   -o vim objects/arabic.o objects/buffer.o objects/blowfish.o objects/crypt.o objects/crypt_zip.o objects/dict.o objects/diff.o objects/digraph.o objects/edit.o objects/eval.o objects/evalfunc.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/farsi.o objects/fileio.o objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o  objects/if_cscope.o objects/if_xcmdsrv.o objects/list.o objects/mark.o objects/memline.o objects/menu.o objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o objects/sha256.o objects/spell.o objects/spellfile.o objects/syntax.o objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/userfunc.o objects/version.o objects/window.o objects/gui.o objects/gui_gtk.o objects/gui_gtk_x11.o objects/pty.o objects/gui_gtk_f.o objects/gui_beval.o objects/gui_gtk_gresources.o objects/if_lua.o  objects/if_perl.o objects/if_perlsfio.o objects/if_python.o objects/if_python3.o  objects/if_ruby.o   objects/netbeans.o objects/channel.o  objects/charset.o objects/json.o objects/main.o objects/memfile.o objects/message.o   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXpm -lXt -lX11 -lSM -lICE  -lm -lnsl  -lselinux   -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc        
objects/if_perl.o: In function `XS_VIBUF_Count':
/builddir/build/BUILD/vim80/src/if_perl.c:2085: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Number':
/builddir/build/BUILD/vim80/src/if_perl.c:2054: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Name':
/builddir/build/BUILD/vim80/src/if_perl.c:2019: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_DESTROY':
/builddir/build/BUILD/vim80/src/if_perl.c:1992: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Append':
/builddir/build/BUILD/vim80/src/if_perl.c:2299: undefined reference to `S_POPMARK'
objects/if_perl.o:/builddir/build/BUILD/vim80/src/if_perl.c:2222: more undefined references to `S_POPMARK' follow
collect2: error: ld returned 1 exit status
link.sh: Linking failed
make: *** [Makefile:1911: vim] Error 1

This is because perl moved some macros into a header file that vim prevents from inclusion as a workaround for Perl 5.18.

Attached patch removes the Perl 5.18 workaround. I can build compile vim against Perl 5.26.0 RC1 with it. But I cannot create RPM because the rpmbuild dies on missing Changelog.rpm file.

Comment 1 Petr Pisar 2017-05-29 13:02:10 UTC
(In reply to Petr Pisar from comment #0)
> But I cannot create RPM because the rpmbuild dies on missing Changelog.rpm file.

That was a mistake on my side. I can build it, install it and it works for me.

Comment 2 Petr Pisar 2017-05-29 13:14:17 UTC
I found a vim sources repository on Github. There is a commit that introduced the Perl 5.18 workaround:

commit 6b10721fa2d883540c1c106ef26fff8abed0ac43
Author: Bram Moolenaar <Bram>
Date:   Wed Dec 11 15:06:40 2013 +0100

    updated for version 7.4.117
    Problem:    Can't build with Cygwin/MingW and Perl 5.18.
    Solution:   Add a linker argument for the Perl library. (Cesar Romani)
                Adjust CFLAGS and LIB. (Cesar Romani)
                Move including inline.h further down. (Ken Takata)

It looks like a workaround for Perl build for Cygwin. I have now idea if it was the correct fix or if it is still relevant. I hope vim upstream will know more. (I could not contact upstream because the mailing list for subscribers only and I did not receive any response on my subscription request.)

Comment 3 Zdenek Dohnal 2017-05-29 13:17:03 UTC
Hi Peťa,

thank you for patch, I'll propose it to upstream and apply to our Fedora 27 branch.

Comment 4 Zdenek Dohnal 2017-05-30 08:05:42 UTC
Upstream says:

The part, which patch removed, is still needed for Win32 when using dynamic link with Perl 5.24. And it probably breaks linking with Perl 5.18. I asked them to find out Perl 5.26 compatible solution for Perl 5.24 (and help them with it) and asked a question, if there is any distribution which still uses Perl 5.18. 
So I see the patch as temporary solution (or stable solution, because that part of code is for Win32, which Fedora doesn't need) and work on compatible code.
Petr, as experienced Perl programmer, is it possible to write these parts compatible with previous Perl version or is it worthy of effort to do so?

Comment 5 Zdenek Dohnal 2017-05-30 11:31:50 UTC
I think this issue can be solved with editing condition in #ifdef - Peťa, do you have a machine with Perl 5.26 somewhere to test this scratch build? https://koji.fedoraproject.org/koji/taskinfo?taskID=19780948

Comment 6 Petr Pisar 2017-05-30 13:22:09 UTC
I did not spent much time on the vim code to understand what's wrong on Win32, but I worry the way in how the 5.18 workaround is implemented prevents from any compatible patches.

The workaround acts before including <perl.h>. That means you cannot dispatch vim code by Perl version as the version is known only after including <perl.h>. And then the workaround has to copy and paste missed macro definitions. This way the workaround will always has to chase changes in Perl as happened with Perl 5.26. 

I don't have a machine with Perl 5.26 for public use. I could try a local build, but the linked scratch build does not provide source RPM package. Or I can arrange you an access to that machine with Perl 5.26.

Comment 7 Zdenek Dohnal 2017-05-30 13:41:06 UTC
I think when you open task for certain arch (f.e. x86_64), there is srpm - f.e. srpm for x86_64 https://kojipkgs.fedoraproject.org//work/tasks/949/19780949/vim-8.0.606-2.fc27.src.rpm

Comment 8 Petr Pisar 2017-05-30 13:57:03 UTC
Your patch does not work:

  gcc   -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed      -o vim objects/arabic.o objects/buffer.o objects/blowfish.o objects/crypt.o objects/crypt_zip.o objects/dict.o objects/diff.o objects/digraph.o objects/edit.o objects/eval.o objects/evalfunc.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/farsi.o objects/fileio.o objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o  objects/if_cscope.o objects/if_xcmdsrv.o objects/list.o objects/mark.o objects/memline.o objects/menu.o objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o objects/sha256.o objects/spell.o objects/spellfile.o objects/syntax.o objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/userfunc.o objects/version.o objects/window.o objects/gui.o objects/gui_gtk.o objects/gui_gtk_x11.o objects/pty.o objects/gui_gtk_f.o objects/gui_beval.o objects/gui_gtk_gresources.o objects/if_lua.o  objects/if_perl.o objects/if_perlsfio.o objects/if_python.o objects/if_python3.o  objects/if_ruby.o   objects/netbeans.o objects/channel.o  objects/charset.o objects/json.o objects/main.o objects/memfile.o objects/message.o   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXpm -lXt -lX11 -lSM -lICE  -lm -lelf -lnsl  -lselinux   -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc
objects/if_perl.o: In function `cur_val':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.xs:869: undefined reference to `S_SvREFCNT_dec'
objects/if_perl.o: In function `XS_VIBUF_Count':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:2085: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Number':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:2054: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Name':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:2019: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_DESTROY':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:1992: undefined reference to `S_POPMARK'
objects/if_perl.o: In function `XS_VIBUF_Append':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:2299: undefined reference to `S_POPMARK'
objects/if_perl.o:/home/test/rpmbuild/BUILD/vim80/src/if_perl.c:2222: more undefined references to `S_POPMARK' follow
objects/if_perl.o: In function `ex_perl':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.xs:978: undefined reference to `S_SvREFCNT_dec'
objects/if_perl.o: In function `do_perleval':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.xs:1254: undefined reference to `S_SvREFCNT_dec'
objects/if_perl.o: In function `ex_perldo':
/home/test/rpmbuild/BUILD/vim80/src/if_perl.xs:1309: undefined reference to `S_SvREFCNT_dec'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
make: *** [Makefile:1911: vim] Error 1

Comment 9 Zdenek Dohnal 2017-05-31 10:35:22 UTC
After talk with upstream, we will use downstream patch for now. Closing as RAWHIDE.


Note You need to log in before you can comment on or make changes to this bug.