package/libftdi: rename patches to the new naming convention
PATCH 1/2 package/libftdi: rename patches to the new naming convention
---
...libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename package/libftdi/{libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} (100%)package/libftdi/0001_pkgconfig_libusb.patch renamed from package/libftdi/libftdi-0.19-01_pkgconfig_libusb.patch +0 -0
Signature · 1 line
2.2.1
PATCH 2/2 package/libftdi: fix libftdi.pc
This patch fixes libftdi pkg-config module, so that packages linking against libftdi correctly have all needed CFLAGS and LIBS defined, especially when running a static build.
Fixes:
http://autobuild.buildroot.org/results/e90/e90b4d5ad79d99487f21c9d18581e8eba7034501/
--- ...di.pc.in-requires-libusb-fix-static-build.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch
package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch new file +25 -0
@@ -0,0 +1,25 @@ +From c0d957b08b46385da570d8ff2f728369822ad2c1 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Mon, 12 Jan 2015 22:10:49 +0100 +Subject: [PATCH] libftdi.pc.in: requires libusb (fix static build) + +Signed-off-by: Samuel Martin <[email protected]> +--- + libftdi.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libftdi.pc.in b/libftdi.pc.in +index 2061b91..95eb491 100644 +--- a/libftdi.pc.in ++++ b/libftdi.pc.in +@@ -6,6 +6,7 @@ includedir=@includedir@ + Name: libftdi + Description: Library to program and control the FTDI USB controller + Requires: ++Requires.private: libusb + Version: @VERSION@ + Libs: -L${libdir} -lftdi -lusb + Cflags: -I${includedir} +-- +2.2.1 +
Signature · 1 line
2.2.1
PATCH 2/2 package/libftdi: fix libftdi.pc
Samuel, All,
On 2015-01-12 22:26 +0100, Samuel Martin spake thusly:
Quoted 10 lines
This patch fixes libftdi pkg-config module, so that packages linking against libftdi correctly have all needed CFLAGS and LIBS defined, especially when running a static build.
Fixes:
http://autobuild.buildroot.org/results/e90/e90b4d5ad79d99487f21c9d18581e8eba7034501/Cc Thomas Petazzoni <[email protected]>Cc "Yann E. MORIN" <[email protected]>Signed-off-by Samuel Martin <[email protected]>
This does indeed fix the autobuild failure.
However (as discussed on IRC), the real fix is a bit more involved, as our current libftdi is 0.19, but openocd requires 0.20:
configure: WARNING: You need a newer libftdi version (0.20 or later) [...]
MPSSE mode of FTDI based devices no
But as you said, this is material for a further patch. So:
Regards,
Yann E. MORIN.
Quoted 39 lines
--- ...di.pc.in-requires-libusb-fix-static-build.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patchpackage/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch new file +25
-0@@ -0,0 +1,25 @@ +From c0d957b08b46385da570d8ff2f728369822ad2c1 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Mon, 12 Jan 2015 22:10:49 +0100 +Subject: [PATCH] libftdi.pc.in: requires libusb (fix static build) + +Signed-off-by: Samuel Martin <[email protected]> +--- + libftdi.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libftdi.pc.in b/libftdi.pc.in +index 2061b91..95eb491 100644 +--- a/libftdi.pc.in ++++ b/libftdi.pc.in +@@ -6,6 +6,7 @@ includedir=@includedir@ + Name: libftdi + Description: Library to program and control the FTDI USB controller + Requires: ++Requires.private: libusb + Version: @VERSION@ + Libs: -L${libdir} -lftdi -lusb + Cflags: -I${includedir} +-- +2.2.1 +Signature · 1 line
2.2.1
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. | '------------------------------^-------^------------------^--------------------'
PATCH 2/2 package/libftdi: fix libftdi.pc
In reply to Samuel MartinDear Samuel Martin,
package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch line 22
Quoted 12 lines · Samuel Martin
package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch new file +12
-0+diff --git a/libftdi.pc.in b/libftdi.pc.in +index 2061b91..95eb491 100644 +--- a/libftdi.pc.in ++++ b/libftdi.pc.in +@@ -6,6 +6,7 @@ includedir=@includedir@ + Name: libftdi + Description: Library to program and control the FTDI USB controller + Requires: ++Requires.private: libusb + Version: @VERSION@ + Libs: -L${libdir} -lftdi -lusb + Cflags: -I${includedir}
Are you sure this is the right fix? I believe the right fix is rather:
-Requires:
+Requires: libusb
...
-Libs: -L${libdir} -lftdi -lusb
+Libs: -L${libdir} -lftdi
This properly declares the fact that libftdi requires libusb. And libusb.pc already has the appropriate Requires.private field on libusb-1.0. With this change, you get what I believe is the correct behavior:
When linking dynamically, we're only linked against -lusb (i.e the libusb-compat library) :
$ ./output/host/usr/bin/pkg-config --libs libftdi -lftdi -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusb
When linking statically, we correct get both -lusb and -lusb-1.0:
$ ./output/host/usr/bin/pkg-config --static --libs libftdi -lftdi -lusb -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusb-1.0 -pthread
This is more or less what was done upstream at
http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=ac5790a7af9ffb45c00bde056b308643cd52537e,
though this commit was after they switched to libusb instead of libusb-compat.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/2 package/libftdi: fix libftdi.pc
Thomas, all,
Quoted 38 lines · Thomas Petazzoni
Dear Samuel Martin,
package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch line 22
Quoted 12 lines · Samuel Martin
package/libftdi/0002-libftdi.pc.in-requires-libusb-fix-static-build.patch new file +12
-0+diff --git a/libftdi.pc.in b/libftdi.pc.in +index 2061b91..95eb491 100644 +--- a/libftdi.pc.in ++++ b/libftdi.pc.in +@@ -6,6 +6,7 @@ includedir=@includedir@ + Name: libftdi + Description: Library to program and control the FTDI USB controller + Requires: ++Requires.private: libusb + Version: @VERSION@ + Libs: -L${libdir} -lftdi -lusb + Cflags: -I${includedir}Are you sure this is the right fix? I believe the right fix is rather:
(quoted diff) +2
-2-Requires: +Requires: libusb -Libs: -L${libdir} -lftdi -lusb +Libs: -L${libdir} -lftdiThis properly declares the fact that libftdi requires libusb. And libusb.pc already has the appropriate Requires.private field on libusb-1.0. With this change, you get what I believe is the correct behavior:
When linking dynamically, we're only linked against -lusb (i.e the libusb-compat library) :
$ ./output/host/usr/bin/pkg-config --libs libftdi -lftdi -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusbWhen linking statically, we correct get both -lusb and -lusb-1.0:
Quoted 7 lines
$ ./output/host/usr/bin/pkg-config --static --libs libftdi -lftdi -lusb -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusb-1.0 -pthreadThis is more or less what was done upstream at
http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=ac5790a7af9ffb45c00bde056b308643cd52537e,
though this commit was after they switched to libusb instead of libusb-compat.
Right, it is a much better fix. I'll respin shortly.
Regards,
Quoted 8 lines
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Signature · 1 line
Samuel
PATCH 1/2 package/libftdi: rename patches to the new naming convention
In reply to Samuel MartinSamuel, All,
On 2015-01-12 22:26 +0100, Samuel Martin spake thusly:
Quoted 1 line
Signed-off-by Samuel Martin <[email protected]>
Regards,
Yann E. MORIN.
Quoted 16 lines
--- ...libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename package/libftdi/{libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} (100%)package/libftdi/0001_pkgconfig_libusb.patch renamed from package/libftdi/libftdi-0.19-01_pkgconfig_libusb.patch +0
-0Signature · 6 lines
2.2.1 _______________________________________________ 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/2 package/libftdi: rename patches to the new naming convention
In reply to Samuel MartinDear Samuel Martin,
Quoted 5 lines · Samuel Martin
Signed-off-by Samuel Martin <[email protected]>--- ...libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename package/libftdi/{libftdi-0.19-01_pkgconfig_libusb.patch => 0001_pkgconfig_libusb.patch} (100%)
Patch applied. I haven't applied PATCH 2/2 though. See my comments about it.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com