Skip to contentSkip to conversation

package/lftp: don't use host's path

PATCH Superseded Romain Naour 3 participants 6 messages Dec 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/lftp: don't use host's path

lftp try to link with -L/usr/lib/lftp/$(LFTP_VERSION) if DESTDIR is not set.

Remove useless -L option which point to a location where no libraries are installed.

---
v2: remove -L option instead of setting DESTDIR to STAGING_DIR
(ThomasP)

 .../lftp/0001-Remove-unused-libraries-path.patch   | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/lftp/0001-Remove-unused-libraries-path.patch
package/lftp/0001-Remove-unused-libraries-path.patch new file +46 -0
new file mode 100644
index 0000000..3521ec8
@@ -0,0 +1,46 @@
+From 30e575f18416d67732be1e0350ee727b72b2d225 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sat, 27 Dec 2014 20:56:56 +0100
+Subject: [PATCH] Remove unused libraries path
+
+When building proto modules the path to library files is
+specified with -L$(DESTDIR)$(pkgverlibdir) which point to
+directory that doesn't exist.
+
+Also, when cross-compiling and $(DESTDIR) is empty,
+$(pkgverlibdir) contains a path to the host libraries
+(/usr/lib/lftp/4.5.5) which is considered unsafe.
+
+Anyway, those -L are not needed: by the time where
+proto modules gets built/linked, no libraries are
+installed in this location.
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ src/Makefile.am | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index d715d0a..0e221cf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -59,11 +59,11 @@ liblftp_pty_la_LDFLAGS     = -avoid-version -rpath $(pkgverlibdir)
+ liblftp_network_la_LDFLAGS = -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
+ liblftp_network_la_LIBADD  = $(SOCKSLIBS) $(OPENSSL_LIBS) $(LIBGNUTLS_LIBS) $(GNULIB)
+ 
+-proto_ftp_la_LIBADD  = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
+-proto_http_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la $(EXPAT_LIBS) $(ZLIB)
+-proto_fish_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la liblftp-pty.la
+-proto_sftp_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la liblftp-pty.la
+-cmd_torrent_la_LIBADD  = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
++proto_ftp_la_LIBADD  = liblftp-network.la
++proto_http_la_LIBADD = liblftp-network.la $(EXPAT_LIBS) $(ZLIB)
++proto_fish_la_LIBADD = liblftp-network.la liblftp-pty.la
++proto_sftp_la_LIBADD = liblftp-network.la liblftp-pty.la
++cmd_torrent_la_LIBADD  = liblftp-network.la
+ 
+ liblftp_tasks_la_SOURCES = PollVec.cc PollVec.h SMTask.cc SMTask.h ProcWait.cc\
+  ProcWait.h GetPass.cc GetPass.h ConnectionSlot.cc ConnectionSlot.h\
+-- 
+1.9.3
+
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 2/2 package/tmux: remove unsafe headers path

---
v2: fix typo (ThomasP)

 ...01-Makefile.am-remove-unsafe-headers-path.patch | 35 ++++++++++++++++++++++
 package/tmux/tmux.mk                               |  3 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/tmux/0001-Makefile.am-remove-unsafe-headers-path.patch
package/tmux/0001-Makefile.am-remove-unsafe-headers-path.patch new file +35 -0
new file mode 100644
index 0000000..4a20945
@@ -0,0 +1,35 @@
+From 4095ee95141063ff3f91153e84bd029b019b8dad Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Fri, 26 Dec 2014 17:44:15 +0100
+Subject: [PATCH] Makefile.am: remove unsafe headers path
+
+/usr/local/include is probably not needed and it's unsafe for
+cross-compilation.
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a9ad5b9..0109e5d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -38,12 +38,12 @@ else
+ CFLAGS += -O2
+ endif
+ if IS_GCC4
+-CPPFLAGS += -iquote. -I/usr/local/include
++CPPFLAGS += -iquote.
+ if IS_DEBUG
+ CFLAGS += -Wno-pointer-sign
+ endif
+ else
+-CPPFLAGS += -I. -I- -I/usr/local/include
++CPPFLAGS += -I. -I-
+ endif
+ endif
+ 
+-- 
+1.9.3
+
package/tmux/tmux.mk +3 -0
index 055e97a..9c8921e 100644
@@ -10,4 +10,7 @@ TMUX_LICENSE = ISC
 TMUX_LICENSE_FILES = README
 TMUX_DEPENDENCIES = libevent ncurses host-pkgconf
 
+# we patch Makefile.am
+TMUX_AUTORECONF = YES
+
 $(eval $(autotools-package))
Signature · 1 line
1.9.3
#2 lore raw

PATCH v2 2/2 package/tmux: remove unsafe headers path

Romain, All,

On 2014-12-27 21:34 +0100, Romain Naour spake thusly:

Quoted 1 line

Regards,
Yann E. MORIN.

Quoted 68 lines

---
v2: fix typo (ThomasP)

 ...01-Makefile.am-remove-unsafe-headers-path.patch | 35 ++++++++++++++++++++++
 package/tmux/tmux.mk                               |  3 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/tmux/0001-Makefile.am-remove-unsafe-headers-path.patch
package/tmux/0001-Makefile.am-remove-unsafe-headers-path.patch new file +35 -0
new file mode 100644
index 0000000..4a20945
@@ -0,0 +1,35 @@
+From 4095ee95141063ff3f91153e84bd029b019b8dad Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Fri, 26 Dec 2014 17:44:15 +0100
+Subject: [PATCH] Makefile.am: remove unsafe headers path
+
+/usr/local/include is probably not needed and it's unsafe for
+cross-compilation.
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a9ad5b9..0109e5d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -38,12 +38,12 @@ else
+ CFLAGS += -O2
+ endif
+ if IS_GCC4
+-CPPFLAGS += -iquote. -I/usr/local/include
++CPPFLAGS += -iquote.
+ if IS_DEBUG
+ CFLAGS += -Wno-pointer-sign
+ endif
+ else
+-CPPFLAGS += -I. -I- -I/usr/local/include
++CPPFLAGS += -I. -I-
+ endif
+ endif
+ 
+-- 
+1.9.3
+
package/tmux/tmux.mk +3 -0
index 055e97a..9c8921e 100644
@@ -10,4 +10,7 @@ TMUX_LICENSE = ISC
 TMUX_LICENSE_FILES = README
 TMUX_DEPENDENCIES = libevent ncurses host-pkgconf
 
+# we patch Makefile.am
+TMUX_AUTORECONF = YES
+
 $(eval $(autotools-package))
Signature · 6 lines
1.9.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 2/2 package/tmux: remove unsafe headers path

In reply to Romain Naour

Dear Romain Naour,

Quoted 3 lines · Romain Naour

---
v2: fix typo (ThomasP)

Applied, thanks. Please submit upstream as well, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 1/2 package/lftp: don't use host's path

In reply to Romain Naour

Romain, All,

On 2014-12-27 21:34 +0100, Romain Naour spake thusly:

Quoted 7 lines

lftp try to link with -L/usr/lib/lftp/$(LFTP_VERSION) if DESTDIR is not set.

Remove useless -L option which point to a location where no libraries are installed.

Regards,
Yann E. MORIN.

Quoted 67 lines

---
v2: remove -L option instead of setting DESTDIR to STAGING_DIR
(ThomasP)

 .../lftp/0001-Remove-unused-libraries-path.patch   | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/lftp/0001-Remove-unused-libraries-path.patch
package/lftp/0001-Remove-unused-libraries-path.patch new file +46 -0
new file mode 100644
index 0000000..3521ec8
@@ -0,0 +1,46 @@
+From 30e575f18416d67732be1e0350ee727b72b2d225 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sat, 27 Dec 2014 20:56:56 +0100
+Subject: [PATCH] Remove unused libraries path
+
+When building proto modules the path to library files is
+specified with -L$(DESTDIR)$(pkgverlibdir) which point to
+directory that doesn't exist.
+
+Also, when cross-compiling and $(DESTDIR) is empty,
+$(pkgverlibdir) contains a path to the host libraries
+(/usr/lib/lftp/4.5.5) which is considered unsafe.
+
+Anyway, those -L are not needed: by the time where
+proto modules gets built/linked, no libraries are
+installed in this location.
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ src/Makefile.am | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index d715d0a..0e221cf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -59,11 +59,11 @@ liblftp_pty_la_LDFLAGS     = -avoid-version -rpath $(pkgverlibdir)
+ liblftp_network_la_LDFLAGS = -avoid-version -rpath $(pkgverlibdir) $(OPENSSL_LDFLAGS)
+ liblftp_network_la_LIBADD  = $(SOCKSLIBS) $(OPENSSL_LIBS) $(LIBGNUTLS_LIBS) $(GNULIB)
+ 
+-proto_ftp_la_LIBADD  = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
+-proto_http_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la $(EXPAT_LIBS) $(ZLIB)
+-proto_fish_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la liblftp-pty.la
+-proto_sftp_la_LIBADD = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la liblftp-pty.la
+-cmd_torrent_la_LIBADD  = -L$(DESTDIR)$(pkgverlibdir) liblftp-network.la
++proto_ftp_la_LIBADD  = liblftp-network.la
++proto_http_la_LIBADD = liblftp-network.la $(EXPAT_LIBS) $(ZLIB)
++proto_fish_la_LIBADD = liblftp-network.la liblftp-pty.la
++proto_sftp_la_LIBADD = liblftp-network.la liblftp-pty.la
++cmd_torrent_la_LIBADD  = liblftp-network.la
+ 
+ liblftp_tasks_la_SOURCES = PollVec.cc PollVec.h SMTask.cc SMTask.h ProcWait.cc\
+  ProcWait.h GetPass.cc GetPass.h ConnectionSlot.cc ConnectionSlot.h\
+-- 
+1.9.3
+
Signature · 6 lines
1.9.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH v2 1/2 package/lftp: don't use host's path

In reply to Romain Naour

Dear Romain Naour,

Quoted 10 lines · Romain Naour

lftp try to link with -L/usr/lib/lftp/$(LFTP_VERSION) if DESTDIR is not set.

Remove useless -L option which point to a location where no libraries are installed.

---
v2: remove -L option instead of setting DESTDIR to STAGING_DIR
(ThomasP)

Applied, thanks. Please submit upstream to the lftp developers, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com