-------------------------------------------- On Sun, 1/1/17, Michael Henry <[email protected]> wrote:
Subject: Re: [vim/vim] Vim won't find ncurses when using `--enable-rubyinterp` (#1081) To: "vim/vim" <[email protected]> Cc: "Subscribed" <[email protected]> Date: Sunday, January 1, 2017, 11:30 PM I ran into this problem on Fedora 25 (x86_64). Vim's configure script asks ruby about LDFLAGS without a corresponding query regarding CFLAGS: https://github.com/vim/vim/blob/v8.0.0134/src/auto/configure#L7174 rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LDFLAGS']"` Since Fedora 23, all RPMs have been "hardened" by default: https://fedoraproject.org/wiki/Changes/Harden_All_Packages When an RPM is built, the %configure macro used in the RPM SPEC file is automatically adjusted to provide CFLAGS, LDFLAGS, and several other environment variables using hardened settings. When using Fedora's ruby package, the above query using rbconfig returns hardened linker flags. Because Vim's configure script doesn't use a corresponding rbconfig to query ruby's CFLAGS, the compiling and linking flags are mismatched, leading to the error: configure: error: NOT FOUND! You need to install a terminal library; for example ncurses. Or specify the name of the library with --with-tlib. In src/auto/config.log, this mismatch of flags causes this error: configure:11318: checking for tgetent in -lncurses configure:11343: gcc -o conftest -g -O2 -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 -L/usr/local/lib conftest.c -lncurses -lselinux >&5 /usr/bin/ld: /tmp/cckpDslF.o: relocation R_X86_64_PC32 against undefined symbol `tgetent' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status I can successfully build with a work-around, but I don't know enough about autoconf to suggest a proper fix to the configure script. The work-around involves first installing some RPM-related packages: sudo dnf install -y rpm-build redhat-rpm-config Next, set these variables at the shell prompt via: eval $(rpmbuild --eval '%{configure}' | egrep '^\s*[A-Z]+=') The above uses rpmbuild --eval '%{configure}' to query the definition of the %configure macro which begins with a number of environment variable assignments. This provides the same default compilation environment that is provided in the %configure macro. Now running the below invocation succeeds: ./configure --quiet --with-features=huge --enable-rubyinterp It seems to me that the configure script should set the global CFLAGS somehow in analogy to the way it's setting the global LDFLAGS based on ruby's built-in knowledge of how CFLAGS was set, something like this: rubycflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['CFLAGS']"` But it's not clear to me where or how the above rubycflags variable should be incorporated into the global CFLAGS. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout. etara. Pana la 1900 s-au infiintat 24 de banci multe cu capital romanesc -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
