All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/lftp: don't use host's path
@ 2014-12-26 17:29 Romain Naour
  2014-12-26 17:29 ` [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path Romain Naour
  2014-12-26 19:11 ` [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Romain Naour @ 2014-12-26 17:29 UTC (permalink / raw)
  To: buildroot

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

When DESTDIR is set to STAGING_DIR, it link with
-L$(STAGING_DIR)/usr/lib/lftp/$(LFTP_VERSION)

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 package/lftp/lftp.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/lftp/lftp.mk b/package/lftp/lftp.mk
index 1586579..73e3087 100644
--- a/package/lftp/lftp.mk
+++ b/package/lftp/lftp.mk
@@ -45,6 +45,10 @@ LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FTP) += proto-ftp.so
 LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_HTTP) += proto-http.so
 LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_SFTP) += proto-sftp.so
 
+# Set DESTDIR to STAGING_DIR during the build to avoid linking
+# with -L/usr/lib/lftp/$(LFTP_VERSION)
+LFTP_MAKE_ENV += DESTDIR="$(STAGING_DIR)"
+
 define LFTP_REMOVE_MODULES
 	for f in $(LFTP_MODULES_TO_REMOVE-) ; do \
 		$(RM) -f $(TARGET_DIR)/usr/lib/lftp/$(LFTP_VERSION)/$$f ; \
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path
  2014-12-26 17:29 [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Romain Naour
@ 2014-12-26 17:29 ` Romain Naour
  2014-12-27 10:27   ` Thomas Petazzoni
  2014-12-26 19:11 ` [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Romain Naour @ 2014-12-26 17:29 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 ...001-Makefile.a-remove-unsafe-headers-path.patch | 35 ++++++++++++++++++++++
 package/tmux/tmux.mk                               |  3 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/tmux/0001-Makefile.a-remove-unsafe-headers-path.patch

diff --git a/package/tmux/0001-Makefile.a-remove-unsafe-headers-path.patch b/package/tmux/0001-Makefile.a-remove-unsafe-headers-path.patch
new file mode 100644
index 0000000..39b14f8
--- /dev/null
+++ b/package/tmux/0001-Makefile.a-remove-unsafe-headers-path.patch
@@ -0,0 +1,35 @@
+From 5089886901223b7318d3326704d47b734498993e Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Fri, 26 Dec 2014 17:44:15 +0100
+Subject: [PATCH] Makefile.a: remove unsafe headers path
+
+/usr/local/include is probably not needed and it's unsafe for
+cross-compilation.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ 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
+
diff --git a/package/tmux/tmux.mk b/package/tmux/tmux.mk
index 055e97a..9c8921e 100644
--- a/package/tmux/tmux.mk
+++ b/package/tmux/tmux.mk
@@ -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))
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/lftp: don't use host's path
  2014-12-26 17:29 [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Romain Naour
  2014-12-26 17:29 ` [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path Romain Naour
@ 2014-12-26 19:11 ` Thomas Petazzoni
  2014-12-26 21:50   ` Romain Naour
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-12-26 19:11 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Fri, 26 Dec 2014 18:29:42 +0100, Romain Naour wrote:
> lftp try to link with -L/usr/lib/lftp/$(LFTP_VERSION) if
> DESTDIR is not set.
> 
> When DESTDIR is set to STAGING_DIR, it link with
> -L$(STAGING_DIR)/usr/lib/lftp/$(LFTP_VERSION)
> 
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ---
>  package/lftp/lftp.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/lftp/lftp.mk b/package/lftp/lftp.mk
> index 1586579..73e3087 100644
> --- a/package/lftp/lftp.mk
> +++ b/package/lftp/lftp.mk
> @@ -45,6 +45,10 @@ LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FTP) += proto-ftp.so
>  LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_HTTP) += proto-http.so
>  LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_SFTP) += proto-sftp.so
>  
> +# Set DESTDIR to STAGING_DIR during the build to avoid linking
> +# with -L/usr/lib/lftp/$(LFTP_VERSION)
> +LFTP_MAKE_ENV += DESTDIR="$(STAGING_DIR)"

Can we patch lftp's build system instead, and submit the patch upstream?

Thanks,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/lftp: don't use host's path
  2014-12-26 19:11 ` [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Thomas Petazzoni
@ 2014-12-26 21:50   ` Romain Naour
  2014-12-27 10:28     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2014-12-26 21:50 UTC (permalink / raw)
  To: buildroot

Le 26/12/2014 20:11, Thomas Petazzoni a ?crit :
> Dear Romain Naour,
>
> On Fri, 26 Dec 2014 18:29:42 +0100, Romain Naour wrote:
>> lftp try to link with -L/usr/lib/lftp/$(LFTP_VERSION) if
>> DESTDIR is not set.
>>
>> When DESTDIR is set to STAGING_DIR, it link with
>> -L$(STAGING_DIR)/usr/lib/lftp/$(LFTP_VERSION)
>>
>> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
>> ---
>>  package/lftp/lftp.mk | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/package/lftp/lftp.mk b/package/lftp/lftp.mk
>> index 1586579..73e3087 100644
>> --- a/package/lftp/lftp.mk
>> +++ b/package/lftp/lftp.mk
>> @@ -45,6 +45,10 @@ LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FTP) += proto-ftp.so
>>  LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_HTTP) += proto-http.so
>>  LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_SFTP) += proto-sftp.so
>>  
>> +# Set DESTDIR to STAGING_DIR during the build to avoid linking
>> +# with -L/usr/lib/lftp/$(LFTP_VERSION)
>> +LFTP_MAKE_ENV += DESTDIR="$(STAGING_DIR)"
> Can we patch lftp's build system instead, and submit the patch upstream?
>
>
The problem come from proto modules build that use the same variable $(pkgverlibdir)
(which is set to /usr/lib/lftp/4.5.5)for linking and to set the rpath:

/home/naourr/git/buildroot/test/liblinear/host/usr/bin/i686-pc-linux-gnu-g++ [...]
-rpath /usr/lib/lftp/4.5.5 -s -o proto-ftp.la -rpath /usr/lib/lftp/4.5.5 ftpclass.lo
[...] -L/usr/lib/lftp/4.5.5 [...]

At first sight, one solution is to set $(DESTDIR) to $(STAGING_DIR)

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

But I think we can remove -L$(DESTDIR)$(pkgverlibdir) since it doesn't seem to be useful.
The build succeed (without paranoid toolchain) even with /usr/lib/lftp/4.5.5 or
$(STAGING_DIR)/usr/lib/lftp/4.5.5 which both doesn't exist.

Best regards,
Romain

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path
  2014-12-26 17:29 ` [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path Romain Naour
@ 2014-12-27 10:27   ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-12-27 10:27 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Fri, 26 Dec 2014 18:29:43 +0100, Romain Naour wrote:

> +From 5089886901223b7318d3326704d47b734498993e Mon Sep 17 00:00:00 2001
> +From: Romain Naour <romain.naour@openwide.fr>
> +Date: Fri, 26 Dec 2014 17:44:15 +0100
> +Subject: [PATCH] Makefile.a: remove unsafe headers path

Typo: Makefile.a -> Makefile.Am.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/lftp: don't use host's path
  2014-12-26 21:50   ` Romain Naour
@ 2014-12-27 10:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-12-27 10:28 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Fri, 26 Dec 2014 22:50:13 +0100, Romain Naour wrote:

> At first sight, one solution is to set $(DESTDIR) to $(STAGING_DIR)
> 
> 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
> 
> But I think we can remove -L$(DESTDIR)$(pkgverlibdir) since it doesn't seem to be useful.
> The build succeed (without paranoid toolchain) even with /usr/lib/lftp/4.5.5 or
> $(STAGING_DIR)/usr/lib/lftp/4.5.5 which both doesn't exist.

Yes, I think those -L are not needed: by the time it gets built/linked,
no libraries are installed in this location.

Best regards,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-27 10:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-26 17:29 [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Romain Naour
2014-12-26 17:29 ` [Buildroot] [PATCH 2/2] package/tmux: remove unsafe headers path Romain Naour
2014-12-27 10:27   ` Thomas Petazzoni
2014-12-26 19:11 ` [Buildroot] [PATCH 1/2] package/lftp: don't use host's path Thomas Petazzoni
2014-12-26 21:50   ` Romain Naour
2014-12-27 10:28     ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.