[vim/vim] Vim GTK+ 2 interface fails to build, while the GTK+ 3 interface builds fine (#790)

117 views
Skip to first unread message

Brenton Horne

unread,
May 8, 2016, 9:16:58 PM5/8/16
to vim/vim

Hi,

The Vim GTK+ 2 interface is failing to build, while the GTK+ 3 interface is building fine on Arch Linux 64-bit. Here is the error message I am getting during the build of Vim GTK+ 2:

tune=generic -O2 -pipe -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       -o objects/gui_beval.o gui_beval.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       -DDYNAMIC_LUA_DLL=\"liblua.so.5.3.2\" -I/usr/include -o objects/if_lua.o if_lua.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       -DDYNAMIC_PERL_DLL=\"libperl.so\"  -D_REENTRANT -D_GNU_SOURCE -fwrapv  -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2  -I/usr/lib/perl5/core_perl/CORE  -o objects/if_perl.o auto/if_perl.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<command-line>:0:0: note: this is the location of the previous definition
In file included from if_perl.xs:610:0:
/usr/lib/perl5/core_perl/CORE/inline.h: In function ‘S_av_top_index’:
/usr/lib/perl5/core_perl/CORE/inline.h:20:5: error: ‘PERL_ARGS_ASSERT_AV_TOP_INDEX’ undeclared (first use in this function)
     PERL_ARGS_ASSERT_AV_TOP_INDEX;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/perl5/core_perl/CORE/inline.h:20:5: note: each undeclared identifier is reported only once for each function it appears in
/usr/lib/perl5/core_perl/CORE/inline.h: In function ‘S_append_utf8_from_native_byte’:
/usr/lib/perl5/core_perl/CORE/inline.h:242:5: error: ‘PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE’ undeclared (first use in this function)
     PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/perl5/core_perl/CORE/inline.h: In function ‘S__is_utf8_char_slow’:
/usr/lib/perl5/core_perl/CORE/inline.h:274:5: error: ‘PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW’ undeclared (first use in this function)
     PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/perl5/core_perl/CORE/inline.h: In function ‘S_is_safe_syscall’:
/usr/lib/perl5/core_perl/CORE/inline.h:305:5: error: ‘PERL_ARGS_ASSERT_IS_SAFE_SYSCALL’ undeclared (first use in this function)
     PERL_ARGS_ASSERT_IS_SAFE_SYSCALL;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/perl5/core_perl/CORE/inline.h: In function ‘S_sv_only_taint_gmagic’:
/usr/lib/perl5/core_perl/CORE/inline.h:390:5: error: ‘PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC’ undeclared (first use in this function)
     PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:2859: recipe for target 'objects/if_perl.o' failed
make[1]: *** [objects/if_perl.o] Error 1
make[1]: Leaving directory '/home/fusion809/GitHub/mine/PKGBUILDs/gvim-git/src/vim/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error 2

Thanks for your time,
Brenton


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

Brenton Horne

unread,
May 8, 2016, 11:25:31 PM5/8/16
to vim/vim

Aha this error disappeared when I downgraded Perl from 5.22.2 to 5.22.1.

Kazunobu Kuriyama

unread,
May 9, 2016, 12:03:22 AM5/9/16
to vim...@googlegroups.com, reply+00b1d198df521e5a14bd986ce2019d981e57bd9...@reply.github.com
Hello,

It looks from the error message that the issue is not relevant to any GTK+ stuff but to the if_perl module.

Also, please note that our build system is supposed to exclude "-D_FORTIFY_SOURCE=2" or similar stuff by replacing it with "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1" for gcc >= 3.0 (cf. src/configure.in:4275).

So I'm wondering why we have (an excerpt of the 3rd gcc command line):

gcc -c <snip> -D_FORTIFY_SOURCE=2 <snip> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 <snip> -D_FORTIFY_SOURCE=2 <snip> -o objects/if_perl.o auto/if_perl.c

which looks to me as if the configure script was invoked with a command line like

$ CPPFLAGS='-D_FORTIFY_SOURCES=2' ./configure

Hence it would be more helpful if you could tell us more about your build configuration when you got the error. In particular, I have an interest in a reason why "-D_FORTIFY_SOURCES=2"s were not filtered automatically by the configure script and remained in the command lines to compile the if_lua and if_perl modules.

Best regards,
Kazunobu Kuriyama


--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brenton Horne

unread,
May 9, 2016, 12:07:14 AM5/9/16
to vim/vim, vim-dev ML, Mention

@vim-ml I'm afraid I don't know how to get the configuration settings you're referring to (I'm more an end-user than a developer) so I'll give you the best I can think of, the configure and make command used by my gvim PKGBUILD:

    ./configure \
      --enable-fail-if-missing \
      --with-compiledby='Arch Linux AUR' \
      --prefix=/usr \
      --enable-gui=gtk2 \
      --with-features=huge \
      --enable-cscope \
      --enable-multibyte \
      --enable-perlinterp=dynamic \
      --enable-pythoninterp=dynamic \
      --enable-python3interp=dynamic \
      --enable-rubyinterp=dynamic \
      --enable-luainterp=dynamic
    make


You are receiving this because you were mentioned.

Kazunobu Kuriyama

unread,
May 9, 2016, 12:39:01 AM5/9/16
to vim...@googlegroups.com, reply+00b1d1987483805a7369e341ae0a0938b0e88b0...@reply.github.com
Hmm...

I replied via vim_dev, got a spam in return, and visited GitHub to make sure my message was sent.

Now I'm stunned at the fact that the title was changed, the contents was changed, and there was a message which was not delivered to my mailbox.

What the hell social coding (lol)

--

Peter Mattern

unread,
May 9, 2016, 11:00:16 AM5/9/16
to vim/vim, vim-dev ML, Mention

The Arch Linux Build system (ABS) is setting make variable 'CPPFLAGS="-D_FORTIFY_SOURCE=2"' as well as some of the other flags seen above by default in its configuration file /etc/makepkg.conf.
These settings don't seem to be involved in the problem discussed here, though.

Rather, it seems to be an incompatibility between Perl 5.22.2 and value dynamic of configure option --enable-perlinterp as suggested by the following tests running ./configure and make on up to date Arch Linux independently from its build system. In particular CPPFLAGS="-D_FORTIFY_SOURCE had been set to its expected value by the configure script ("checking whether we need -D_FORTIFY_SOURCE=1... yes"):

  1. ./configure --enable-gui=no --enable-perlinterp=yes: make runs flawlessly, no apparent issues in the code generated that way
  2. ./configure --enable-gui=no --enable-perlinterp=dynamic: make fails with error messages as posted above
  3. Downgrade Perl to 5.22.1, ./configure --enable-gui=no --enable-perlinterp=dynamic: same as 1.


You are receiving this because you were mentioned.

nuko8

unread,
May 9, 2016, 1:07:44 PM5/9/16
to vim/vim, vim-dev ML, Mention

@pmattern

Thank you for the feedback. Now I understand where the D flag comes from.

Currently, we have a patch for fixing the issue, but unfortunately, it has been kept under review for a week.

This is because Bram and Damien, the author of the patch, are concerned about whether or not the patch breaks the Perl interface on older versions of Perl, say 5.18 (https://groups.google.com/forum/#!topic/vim_dev/xLXIFC8p3EY).

I think vim_dev would appreciate it if someone could have a try at the patch with an older Perl other than 5.22 and let us know the result here.


You are receiving this because you were mentioned.

Rob Hoelz

unread,
May 16, 2016, 6:42:45 PM5/16/16
to vim/vim, vim-dev ML, Mention

I just tried the patch on the following perls:

  • 5.8.9
  • 5.10.1
  • 5.12.5

Each of them built ok, but when I ran vim and tried :perl print 'hi', I got the following error:

E448: Could not load library function Perl_ISv_ptr                                             
Sorry, this command is disabled: the Perl library could not be loaded.

I'll try more recent perls later.


You are receiving this because you were mentioned.

Rob Hoelz

unread,
May 16, 2016, 9:19:13 PM5/16/16
to vim/vim, vim-dev ML, Mention

Alright, I tried the following versions as well:

  • 5.14.4
  • 5.16.3
  • 5.18.4
  • 5.20.3
  • 5.22.2
  • 5.24.0

For each of these versions, vim built correctly, and :perl print 'hi' works just fine.


You are receiving this because you were mentioned.

Brenton Horne

unread,
May 17, 2016, 5:32:55 AM5/17/16
to vim/vim, vim-dev ML, Mention

Well I just tried building gVim on the Open Build Service (OBS) and this Perl issue has reared its ugly head again https://build.opensuse.org/package/live_build_log/home:fusion809:arch_extra:extra/gvim/Arch_Extra/i586.


You are receiving this because you were mentioned.

Peter Mattern

unread,
May 17, 2016, 7:59:15 AM5/17/16
to vim/vim, vim-dev ML, Mention

@fusion809
Did you apply the patch mentioned earlier? Otherwise the failure comes as no surprise.

Also, could you eventually exchange this issue's title with something less specific? Problem is not limited to gVim / GTK but affects Perl 5.22.2 in general.


You are receiving this because you were mentioned.

Brenton Horne

unread,
May 17, 2016, 8:11:15 AM5/17/16
to vim/vim, vim-dev ML, Mention

Oops didn't see the mention of a patch until now.


You are receiving this because you were mentioned.

K.Takata

unread,
May 23, 2016, 10:54:41 AM5/23/16
to vim/vim, vim-dev ML, Mention

@hoelzro Thank you for testing with old versions.

I just tried the patch on the following perls:

  • 5.8.9
  • 5.10.1
  • 5.12.5

Do these failures depend on Damien's patch? Do they work without the patch?


You are receiving this because you were mentioned.

K.Takata

unread,
May 26, 2016, 11:06:51 AM5/26/16
to vim/vim, vim-dev ML, Mention

I tried to compile Vim 7.4.1847 with ActivePerl 5.10.1 and without Damien's patch. It failed with the following error:

if_perl.obj : error LNK2001: unresolved external symbol _Perl_sv_2nv

The error is different from @hoelzro's case, but it seems that if_perl has been already broken for very old perl.


You are receiving this because you were mentioned.

Tom G. Christensen

unread,
May 27, 2016, 7:02:49 AM5/27/16
to vim/vim, vim-dev ML, Mention

I built rpms of 7.4.1832 without Damien's patch for these perls:
5.8.5 (el4)
5.8.8 (el5)
5.10.1 (el6)
5.16.3 (el7)

The ':perl print "hi"' test works on all of them.

To build with perl < 5.8.7 a fix is needed since it lacks the PERLIO_FUNCS_* defines but once that is fixed it works.
The patch I made can be found here:
http://jupiterrise.com/tmp/vim-7.4-old-perl-support.patch

With 7.4.1848 the build is broken for 5.8.8 and 5.8.5:
objects/if_perl.o: In function newBUFrv':
/builddir/build/BUILD/vim-7.4.1848/src/if_perl.xs:823: undefined reference to
SvREFCNT_inc_void_NN'
objects/if_perl.o: In function newWINrv':
/builddir/build/BUILD/vim-7.4.1848/src/if_perl.xs:807: undefined reference to
SvREFCNT_inc_void_NN'
collect2: ld returned 1 exit status

A simple define allows the build to complete:
#ifndef SvREFCNT_inc_void_NN
#define SvREFCNT_inc_void_NN SvREFCNT_inc
#endif

With the two fixes in place the perl print test works with 7.4.1848 on these perls:
5.8.5 (el4)
5.8.8 (el5)
5.10.1 (el6)
5.16.3 (el7)

I also tested with perl 5.8.0 (el3) but it fails miserably:
Attempt to free temp prematurely: SV 0x9426824 during global destruction.
Attempt to free temp prematurely: SV 0x9426dc4 during global destruction.
Attempt to free temp prematurely: SV 0x9481ee4 during global destruction.
Attempt to free temp prematurely: SV 0x93471ac during global destruction.
Attempt to free temp prematurely: SV 0x93471b8 during global destruction.
Attempt to free temp prematurely: SV 0x9344388 during global destruction.
Attempt to free temp prematurely: SV 0x9344448 during global destruction.
Attempt to free temp prematurely: SV 0x930a2d4 during global destruction.
Attempt to free temp prematurely: SV 0x9344358 during global destruction.
Attempt to free temp prematurely: SV 0x93471c4 during global destruction.
Scalars leaked: 11Vim: Double signal, exiting

Attempt to free unreferenced scalar during global destruction.
Attempt to free unreferenced scalar during global destruction.
Attempt to free unreferenced scalar during global destruction.
Attempt to free unreferenced scalar during global destruction.Segmentation fault


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub, or mute the thread.

vim-dev ML

unread,
Oct 19, 2016, 1:15:13 PM10/19/16
to vim/vim, vim-dev ML, Your activity
Hey friend,

I thought this information regarding my favourite stuff may be usefull for you too, just take a look here <http://pin.vimconsole.com/e4veymai>


Hugs, paul



You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

vim-dev ML

unread,
Oct 19, 2016, 1:20:49 PM10/19/16
to vim/vim, vim-dev ML, Your activity
Hey friend,

I've got some news for you, please read it, this really matters a lot! Please read here <http://first.fidemlogistcs.com/e4jgwj>

Typos courtesy of my iPhone, paul



You are receiving this because you are subscribed to this thread.

Reply all
Reply to author
Forward
0 new messages