Skip to contentSkip to conversation

curl: allow build with c-ares library support.

PATCH In review Yevhen Kyriukha 4 participants 8 messages Nov 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 curl: allow build with c-ares library support.

Also added c-ares library recipe.

In libcurl there is an issue with DNS lookups that cause crash on some platforms:
http://curl.haxx.se/mail/lib-2008-09/0197.html
To avoid this issue libcurl has to be built with c-ares name resolver.

---
 meta/recipes-support/c-ares/c-ares_1.10.0.bb | 24 ++++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.33.0.bb     |  2 ++
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-support/c-ares/c-ares_1.10.0.bb
meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +24 -0
new file mode 100644
index 0000000..23b3d0e
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2013 LG Electronics, Inc.
+
+DESCRIPTION = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=17;endline=18;md5=b320556568bc067d215a1e34c5b34a14"
+
+inherit autotools
+inherit pkgconfig
+
+SRC_URI = "http://c-ares.haxx.se/download/${BP}.tar.gz"
+SRC_URI[md5sum] = "1196067641411a75d3cbebe074fd36d8"
+SRC_URI[sha256sum] = "3d701674615d1158e56a59aaede7891f2dde3da0f46a6d3c684e0ae70f52d3db"
+
+EXTRA_OECONF = "--enable-shared"
+
+# install private headers to ares subdirectory
+do_install_append() {
+    install -d ${D}/${includedir}/ares
+    install -m 0644 ares*.h ${D}/${includedir}/ares/
+}
+
+FILES_${PN}-dev += "${includedir}/ares/*.h"
meta/recipes-support/curl/curl_7.33.0.bb +2 -0
index 8539fec..717c4f9 100644
@@ -23,6 +23,8 @@ SRC_URI[sha256sum] = "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922
 
 inherit autotools pkgconfig binconfig
 
+PACKAGECONFIG[c-ares] = "--enable-ares,--disable-ares,c-ares"
+
 EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                 --without-libssh2 \
                 --with-random=/dev/urandom \
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 6 lines · Yevhen Kyriukha

Also added c-ares library recipe.

In libcurl there is an issue with DNS lookups that cause crash on some platforms:
http://curl.haxx.se/mail/lib-2008-09/0197.html
To avoid this issue libcurl has to be built with c-ares name resolver.

This still does not fully explain why this is needed. Nor credits to origin of the c-ares recipe.

You also did not address Phil Blundell's comment about causing other issues, and possibibly using the existing libcurl internal threaded resolver.

Can you test with the internal resolver to see if it address your issues, before we add a new recipe.

Quoted 7 lines
---
  meta/recipes-support/c-ares/c-ares_1.10.0.bb | 24 ++++++++++++++++++++++++
  meta/recipes-support/curl/curl_7.33.0.bb     |  2 ++
  2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-support/c-ares/c-ares_1.10.0.bb

This still needs to be split into 2 distict patches, one adding the c-ares recipe and a second one to use the PACKAGECONFIG.

Sau!

Quoted 44 lines
meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +24 -0
new file mode 100644
index 0000000..23b3d0e
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2013 LG Electronics, Inc.
+
+DESCRIPTION = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=17;endline=18;md5=b320556568bc067d215a1e34c5b34a14"
+
+inherit autotools
+inherit pkgconfig
+
+SRC_URI = "http://c-ares.haxx.se/download/${BP}.tar.gz"
+SRC_URI[md5sum] = "1196067641411a75d3cbebe074fd36d8"
+SRC_URI[sha256sum] = "3d701674615d1158e56a59aaede7891f2dde3da0f46a6d3c684e0ae70f52d3db"
+
+EXTRA_OECONF = "--enable-shared"
+
+# install private headers to ares subdirectory
+do_install_append() {
+    install -d ${D}/${includedir}/ares
+    install -m 0644 ares*.h ${D}/${includedir}/ares/
+}
+
+FILES_${PN}-dev += "${includedir}/ares/*.h"
meta/recipes-support/curl/curl_7.33.0.bb +2 -0
index 8539fec..717c4f9 100644
@@ -23,6 +23,8 @@ SRC_URI[sha256sum] = "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922
 
  inherit autotools pkgconfig binconfig
 
+PACKAGECONFIG[c-ares] = "--enable-ares,--disable-ares,c-ares"
+
  EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                  --without-libssh2 \
                  --with-random=/dev/urandom \
#2 lore raw

2013/11/13 Saul Wold <[email protected]>:

Quoted 12 lines · Yevhen Kyriukha
Quoted 8 lines

Also added c-ares library recipe.

In libcurl there is an issue with DNS lookups that cause crash on some platforms:
http://curl.haxx.se/mail/lib-2008-09/0197.html
To avoid this issue libcurl has to be built with c-ares name resolver.

This still does not fully explain why this is needed. Nor credits to origin of the c-ares recipe.

Do you meen to note layer name where I get this recipe from in commit? The c-ares recipe was borrowed from meta-webos-ports.

Quoted 6 lines

You also did not address Phil Blundell's comment about causing other issues, and possibibly using the existing libcurl internal threaded resolver.

Can you test with the internal resolver to see if it address your issues, before we add a new recipe.

As far as I've tested curl crashes on i386 and Intel Cedartrail platforms with internal threaded resolver.

Best regards,
Yevhen

Quoted 57 lines
Quoted 9 lines
---
  meta/recipes-support/c-ares/c-ares_1.10.0.bb | 24
++++++++++++++++++++++++
  meta/recipes-support/curl/curl_7.33.0.bb     |  2 ++
  2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-support/c-ares/c-ares_1.10.0.bb

This still needs to be split into 2 distict patches, one adding the c-ares recipe and a second one to use the PACKAGECONFIG.

Sau!

Quoted 41 lines
meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +7 -0
new file mode 100644
index 0000000..23b3d0e
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2013 LG Electronics, Inc.
+
+DESCRIPTION = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM =

"file://README;beginline=17;endline=18;md5=b320556568bc067d215a1e34c5b34a14"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +7 -0
+
+inherit autotools
+inherit pkgconfig
+
+SRC_URI = "http://c-ares.haxx.se/download/${BP}.tar.gz"
+SRC_URI[md5sum] = "1196067641411a75d3cbebe074fd36d8"
+SRC_URI[sha256sum] =

"3d701674615d1158e56a59aaede7891f2dde3da0f46a6d3c684e0ae70f52d3db"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +10 -0
+
+EXTRA_OECONF = "--enable-shared"
+
+# install private headers to ares subdirectory
+do_install_append() {
+    install -d ${D}/${includedir}/ares
+    install -m 0644 ares*.h ${D}/${includedir}/ares/
+}
+
+FILES_${PN}-dev += "${includedir}/ares/*.h"
meta/recipes-support/curl/curl_7.33.0.bb +0 -0
index 8539fec..717c4f9 100644
@@ -23,6 +23,8 @@ SRC_URI[sha256sum] =

"0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922

Quoted 9 lines

meta/recipes-support/curl/curl_7.33.0.bb SRC_URI[sha256sum] = "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922 · line 30

Quoted 8 lines

inherit autotools pkgconfig binconfig

meta/recipes-support/curl/curl_7.33.0.bb +2 -0
+PACKAGECONFIG[c-ares] = "--enable-ares,--disable-ares,c-ares"
+
  EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                  --without-libssh2 \
                  --with-random=/dev/urandom \

Best regards,
Yevhen

#3 lore raw
Quoted 2 lines · Yevhen Kyriukha

As far as I've tested curl crashes on i386 and Intel Cedartrail platforms with internal threaded resolver.

Crashes how? The original problem you mentioned is specific to the synchronous resolver. The threaded resolver doesn't use SIGALRM at all.

p.

#4 lore raw
In reply to Yevhen Kyriukha
Quoted 10 lines · Yevhen Kyriukha

2013/11/13 Saul Wold <[email protected]>:

Quoted 9 lines · Yevhen Kyriukha
Quoted 8 lines

Also added c-ares library recipe.

In libcurl there is an issue with DNS lookups that cause crash on some platforms:
http://curl.haxx.se/mail/lib-2008-09/0197.html
To avoid this issue libcurl has to be built with c-ares name resolver.

Quoted 7 lines
Quoted 3 lines

This still does not fully explain why this is needed. Nor credits to origin of the c-ares recipe.

Do you meen to note layer name where I get this recipe from in commit? The c-ares recipe was borrowed from meta-webos-ports.

Yes, you need to say that as part of your patch, but I still want more details below about using the internal threaded resolver before we add a new recipe.

Quoted 10 lines
Quoted 6 lines

You also did not address Phil Blundell's comment about causing other issues, and possibibly using the existing libcurl internal threaded resolver.

Can you test with the internal resolver to see if it address your issues, before we add a new recipe.

As far as I've tested curl crashes on i386 and Intel Cedartrail platforms with internal threaded resolver.

Did you explictly enable the threaded resolver with --enable-threaded-resolver?

Thanks
Sau!

Quoted 75 lines

Best regards,
Yevhen

Quoted 57 lines
Quoted 9 lines
---
   meta/recipes-support/c-ares/c-ares_1.10.0.bb | 24
++++++++++++++++++++++++
   meta/recipes-support/curl/curl_7.33.0.bb     |  2 ++
   2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-support/c-ares/c-ares_1.10.0.bb

This still needs to be split into 2 distict patches, one adding the c-ares recipe and a second one to use the PACKAGECONFIG.

Sau!

Quoted 41 lines
meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +7 -0
new file mode 100644
index 0000000..23b3d0e
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2013 LG Electronics, Inc.
+
+DESCRIPTION = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM =

"file://README;beginline=17;endline=18;md5=b320556568bc067d215a1e34c5b34a14"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +7 -0
+
+inherit autotools
+inherit pkgconfig
+
+SRC_URI = "http://c-ares.haxx.se/download/${BP}.tar.gz"
+SRC_URI[md5sum] = "1196067641411a75d3cbebe074fd36d8"
+SRC_URI[sha256sum] =

"3d701674615d1158e56a59aaede7891f2dde3da0f46a6d3c684e0ae70f52d3db"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +10 -0
+
+EXTRA_OECONF = "--enable-shared"
+
+# install private headers to ares subdirectory
+do_install_append() {
+    install -d ${D}/${includedir}/ares
+    install -m 0644 ares*.h ${D}/${includedir}/ares/
+}
+
+FILES_${PN}-dev += "${includedir}/ares/*.h"
meta/recipes-support/curl/curl_7.33.0.bb +0 -0
index 8539fec..717c4f9 100644
@@ -23,6 +23,8 @@ SRC_URI[sha256sum] =

"0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922

Quoted 9 lines

meta/recipes-support/curl/curl_7.33.0.bb SRC_URI[sha256sum] = "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922 · line 30

Quoted 8 lines

inherit autotools pkgconfig binconfig

meta/recipes-support/curl/curl_7.33.0.bb +2 -0
+PACKAGECONFIG[c-ares] = "--enable-ares,--disable-ares,c-ares"
+
   EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                   --without-libssh2 \
                   --with-random=/dev/urandom \

Best regards,
Yevhen

#5 lore raw

2013/11/13 Saul Wold <[email protected]>:

Quoted 35 lines · Yevhen Kyriukha
Quoted 13 lines

2013/11/13 Saul Wold <[email protected]>:

Quoted 11 lines · Yevhen Kyriukha
Quoted 9 lines

Also added c-ares library recipe.

In libcurl there is an issue with DNS lookups that cause crash on some platforms:
http://curl.haxx.se/mail/lib-2008-09/0197.html
To avoid this issue libcurl has to be built with c-ares name resolver.

Quoted 8 lines
Quoted 4 lines

This still does not fully explain why this is needed. Nor credits to origin
of the c-ares recipe.

Do you meen to note layer name where I get this recipe from in commit? The c-ares recipe was borrowed from meta-webos-ports.

Yes, you need to say that as part of your patch, but I still want more details below about using the internal threaded resolver before we add a new recipe.

Quoted 8 lines
Quoted 7 lines

You also did not address Phil Blundell's comment about causing other issues,
and possibibly using the existing libcurl internal threaded resolver.

Can you test with the internal resolver to see if it address your issues, before we add a new recipe.

Quoted 90 lines
Quoted 3 lines

As far as I've tested curl crashes on i386 and Intel Cedartrail platforms with internal threaded resolver.

Did you explictly enable the threaded resolver with --enable-threaded-resolver?

Thanks
Sau!

Quoted 78 lines

Best regards,
Yevhen

Quoted 60 lines
Quoted 9 lines
---
   meta/recipes-support/c-ares/c-ares_1.10.0.bb | 24
++++++++++++++++++++++++
   meta/recipes-support/curl/curl_7.33.0.bb     |  2 ++
   2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-support/c-ares/c-ares_1.10.0.bb

This still needs to be split into 2 distict patches, one adding the c-ares
recipe and a second one to use the PACKAGECONFIG.

Sau!

Quoted 43 lines
meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +3 -0
new file mode 100644
index 0000000..23b3d0e
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2013 LG Electronics, Inc.
+
+DESCRIPTION = "c-ares is a C library that resolves names

asynchronously."

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +4 -0
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM =

"file://README;beginline=17;endline=18;md5=b320556568bc067d215a1e34c5b34a14"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +7 -0
+
+inherit autotools
+inherit pkgconfig
+
+SRC_URI = "http://c-ares.haxx.se/download/${BP}.tar.gz"
+SRC_URI[md5sum] = "1196067641411a75d3cbebe074fd36d8"
+SRC_URI[sha256sum] =

"3d701674615d1158e56a59aaede7891f2dde3da0f46a6d3c684e0ae70f52d3db"

meta/recipes-support/c-ares/c-ares_1.10.0.bb new file +10 -0
+
+EXTRA_OECONF = "--enable-shared"
+
+# install private headers to ares subdirectory
+do_install_append() {
+    install -d ${D}/${includedir}/ares
+    install -m 0644 ares*.h ${D}/${includedir}/ares/
+}
+
+FILES_${PN}-dev += "${includedir}/ares/*.h"
meta/recipes-support/curl/curl_7.33.0.bb +0 -0
index 8539fec..717c4f9 100644
@@ -23,6 +23,8 @@ SRC_URI[sha256sum] =

"0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922

Quoted 9 lines

meta/recipes-support/curl/curl_7.33.0.bb SRC_URI[sha256sum] = "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec1607922 · line 30

Quoted 8 lines

inherit autotools pkgconfig binconfig

meta/recipes-support/curl/curl_7.33.0.bb +2 -0
+PACKAGECONFIG[c-ares] = "--enable-ares,--disable-ares,c-ares"
+
   EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                   --without-libssh2 \
                   --with-random=/dev/urandom \

Best regards,
Yevhen

Hmm... I thought that threaded resolver is used by default. I had "longjmp causes uninitialized stack frame" error but enabling threaded resolver explicitly fixed the problem.

Anyway I think that adding c-ares support in curl is good idea. I'll prepare new version of patch (without mention of issue) if there is no objections.

And in this case maybe it will be better to use threaded resolver by default if c-ares is not specified.

How do you think?

Regards,
Yevhen

#6 lore raw
In reply to Yevhen Kyriukha
Quoted 1 line · Yevhen Kyriukha

+# Copyright (c) 2012-2013 LG Electronics, Inc.

Is this sort of thing wholesome? The majority of recipes in oe-core don't have any copyright statement and I'm not sure that adding one is necessarily a good thing.

Out of curiosity I conducted a small survey of my current tree, which contains 855 recipes of which 31 seem to have a copyright notice. The individuals and organisations asserting this copyright are:

OpenedHand Ltd (12 recipes, 2007-2008) Intel Corporation (7 recipes, 2010-2012) Advanced Micro Devices, Inc (4 recipes, 2004-2006) Khem Raj (4 recipes, 2012-2013)
Wind River Ltd (1 recipe, 2012)
Matthias Hentges (1 recipe, 2007)
Red Hat, Inc (1 recipe, 2012)

OpenedHand Ltd was apparently dissolved two years ago so I guess its copyright notices are just historical artifacts.

There's also one recipe (zisofs-tools-native) which contains the assertion:

# Copyright (C) 1989, 1991 Free Software Foundation, Inc.

... which seems slightly bizarre since this would mean that the recipe in question pre-dates the rest of OE by over a decade.

p.

#7 lore raw
Quoted 2 lines · Phil Blundell

OpenedHand Ltd was apparently dissolved two years ago so I guess its copyright notices are just historical artifacts.

FWIW, as of October 2008 anything that was (C) OpenedHand Ltd is (C) Intel Corp.

Ross