• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/lftp/0001-fix-static-link-with-readline.patch
Rahul BedarkarRahul Bedarkar committed f0417f965f808 Aug 2016
Raw file
Source viewDiff to previous
 
1
fix static link with readline
2
​
3
When readline is static library, we need to link against ncurses
4
because readline needs ncurses. It is because, dependent library's
5
symbols are not resolved when static library is built. Those symbols
6
are resolved program tries to link with static library.
7
​
8
We can't pass linker flags for ncurses by setting LIBS environment
9
variable via <PKG>_CONF_ENV because it looks like build system is not
10
taking that into account and even though it would have been, order of
11
linking is important.
12
​
13
We can't also pass linker flags for ncurses via --with-readline-libs
14
conf options because it causes lftp_LIB_READLINE macro to take readline
15
headers from host machine if available. To use --with-readline-libs
16
we need to set --with-readline=yes and --with-readline-inc to include
17
dir. But when --with-readline=yes, readline_prefix is computed based
18
on if headers can be found in /usr/local or /usr. If readline is
19
installed on host machine, then configure fails since we are using
20
headers for host machine. If headers are not found in /usr/local or /usr
21
then only path specified --with-readline-inc is taken into account.
22
So specifying linker flags for ncurses via --with-readline-libs will
23
not work in all cases.
24
​
25
So it looks like, updating linker flags directly is only option to fix
26
static link issue against readline.
27
​
28
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
29
​
30
--- lftp-4.7.3/m4/lftp_lib_readline.m4.old  2016-08-08 19:49:12.217596470 +0530
31
+++ lftp-4.7.3/m4/lftp_lib_readline.m4  2016-08-08 19:49:46.265596398 +0530
32
@@ -108,7 +108,7 @@ AC_DEFUN([lftp_LIB_READLINE],
33
        readline_include_dir="$readline_include_dir/readline"
34
    fi
35
         readline_ld_flags="-L$readline_prefix/lib"
36
-        readline_lib_flags="-lreadline"
37
+        readline_lib_flags="-lreadline -lncurses"
38
         run_readline_test="yes"
39
     elif test "$readline_requested" = "yes"; then
40
         if test -n "$readline_include_dir" -a -n "$readline_lib_flags"; then
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.