For an update, I have since been able to get libcurl to link to the new
cyassl package, provided I explicitly insert sizeof_long definitions into
libcurl header files, shown in the patch below.  It is unusual that libcurl
seems to require these additional defines to link to libcyassl.so, but
uhttpd-mod-tls does not.

I'm not sure if this patch resides properly with the package curl, perhaps
accompanied by another patch that defines a new sub-package libcurl-cyassl.

Massimo, are you using the newer version of cyassl for anything besides
uhttpd?

--- curl-7.29.0/include/curl/curl.h.20130518    2013-05-17
23:25:23.816083944 -0500
+++ curl-7.29.0/include/curl/curl.h    2013-05-17 23:30:43.304082086 -0500
@@ -118,6 +118,13 @@ typedef void CURL;
 #endif
 #endif

+/* These definitions needed for cyassl */
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
 #ifndef curl_socket_typedef
 /* socket typedef */
 #if defined(WIN32) && !defined(__LWIP_OPT_H__)


On Fri, May 17, 2013 at 12:00 PM, Ben West <[email protected]> wrote:

> Thank you for responding.  Below is the diff of the curl Makefile, against
> that included in the Attitude Adjustment v12.09 packages 
> here<https://dev.openwrt.org/browser/branches/packages_12.09/libs/curl/Makefile>
> .
>
> Note that the addition of "-lm" to libraries for curl to link to came from
> my own research in pending OpenWRT issues about compiling curl with
> cyassl.  However, the error about long long size mismatch occurs whether
> libm.so is included or not.
>
> Index: libs/curl/Makefile
> ===================================================================
> --- libs/curl/Makefile    (revision 36652)
> +++ libs/curl/Makefile    (working copy)
> @@ -43,7 +43,7 @@
>    $(call Package/curl/Default)
>    SECTION:=libs
>    CATEGORY:=Libraries
> -  DEPENDS:=+libopenssl +zlib
> +  DEPENDS:=+libcyassl +zlib
>    TITLE:=A client-side URL transfer library
>  endef
>
> @@ -70,7 +70,8 @@
>      --enable-tftp \
>      --disable-verbose \
>      --with-random="/dev/urandom" \
> -    --with-ssl="$(STAGING_DIR)/usr" \
> +    --with-cyassl="$(STAGING_DIR)/usr" \
> +    --without-ssl
>      --without-ca-bundle \
>      --without-gnutls \
>      --without-krb4 \
> @@ -81,7 +82,7 @@
>      $(call autoconf_bool,CONFIG_IPV6,ipv6) \
>
>  CONFIGURE_VARS += \
> -    LIBS="-lcrypto -lssl -lz" \
> +    LIBS="-lm -lcyassl -lz" \
>      CC="$(filter-out ccache,$(TARGET_CC))"
>
>  define Build/Compile
>
>
> On Fri, May 17, 2013 at 2:10 AM, Massimo Vellucci <[email protected]>wrote:
>
>> CyaSSL must determine the environment to recognize the size of the types,
>> there is a conflict on the size of the long type. Can you attach the
>> changes on curl makefile for using CyaSSL ?
>>
>>
>>
>> 2013/5/16 Ben West <[email protected]>
>>
>>> Thank you for sharing this patch!
>>>
>>> I'm trying this very patch to see if I can use cyassl with curl, instead
>>> of openssl.  (cyassl v1.6.5 is apparently old enough that the current
>>> version of curl can no longer use libcyassl.so.)
>>>
>>> However, my build on ar71xx target fails when libcurl tries to link to
>>> libcyassl on the rather esoteric error "bad math long / long long
>>> settings."  Are there platform limitations to the new version of cyassl?
>>>
>>> OpenWrt-libtool: compile:  mips-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H
>>> -I../include/curl -I../include -I../include -I../lib -I../lib
>>> -DCURL_HIDDEN_SYMBOLS -isystem
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include
>>> -isystem
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/include
>>> -isystem
>>> /blah/blah/openwrt/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_uClibc-0.9.33.2/usr/include
>>> -isystem
>>> /blah/blah/openwrt/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_uClibc-0.9.33.2/include
>>> -I/blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include
>>> -I/blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include
>>> -fvisibility=hidden -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves
>>> -funit-at-a-time -fhonour-copts -Wno-error=unused-but-set-variable
>>> -msoft-float -fpic -Wno-system-headers -MT libcurl_la-cyassl.lo -MD -MP -MF
>>> .deps/libcurl_la-cyassl.Tpo -c cyassl.c  -fPIC -DPIC -o
>>> .libs/libcurl_la-cyassl.o
>>> In file included from
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/cyassl/ctaocrypt/error.h:26:0,
>>>                  from
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/cyassl/error.h:26,
>>>                  from cyassl.c:53:
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/cyassl/ctaocrypt/types.h:274:6:
>>> error: #error "bad math long / long long settings"
>>> /blah/blah/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/cyassl/ctaocrypt/types.h:276:1:
>>> error: expected identifier before '}' token
>>> make[5]: *** [libcurl_la-cyassl.lo] Error 1
>>>
>>> The caveat, however, is that I'm trying to compile the newer cyassl for
>>> Attitude Adjustment v36608, not trunk.  Not sure if that would make a
>>> difference for this error.
>>>
>>> On Sun, May 5, 2013 at 5:50 AM, Massimo Vellucci <[email protected]>wrote:
>>>
>>>> Sorry I made a big mistake, I attached the wrong patch. For x86 you
>>>> need to disable the PIC optimization otherwise you get an error at
>>>> compile time.
>>>>
>>>>
>>>> diff -r -u a/package/libs/cyassl/Makefile b/package/libs/cyassl/Makefile
>>>> --- a/package/libs/cyassl/Makefile    2013-03-21 08:08:18.000000000
>>>> +0100
>>>> +++ b/package/libs/cyassl/Makefile    2013-05-05 10:27:06.000000000+0200
>>>>
>>>> @@ -8,16 +8,14 @@
>>>>  include $(TOPDIR)/rules.mk
>>>>
>>>>  PKG_NAME:=cyassl
>>>> -PKG_VERSION:=1.6.5
>>>> -PKG_RELEASE:=2
>>>> +PKG_VERSION:=2.6.0
>>>> +PKG_RELEASE:=1
>>>>
>>>>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
>>>>  PKG_SOURCE_URL:=http://www.yassl.com/
>>>> -PKG_MD5SUM:=98c2c6350acf1d089756a1de9ccb9903
>>>> +PKG_MD5SUM:=9c48fd4ab677c11b4612fb4eb15444d9
>>>>
>>>> -PKG_FIXUP:=patch-libtool
>>>>  PKG_INSTALL:=1
>>>> -PKG_BUILD_PARALLEL:=1
>>>>
>>>>  include $(INCLUDE_DIR)/package.mk
>>>>
>>>> @@ -37,8 +35,12 @@
>>>>
>>>>  TARGET_CFLAGS += $(FPIC)
>>>>
>>>>  CONFIGURE_ARGS += \
>>>> -       --without-zlib \
>>>> -       --enable-singleThreaded
>>>> +       --without-pic \
>>>>
>>>> +       --enable-dtls \
>>>> +       --enable-static \
>>>> +       --enable-opensslextra \
>>>> +       --enable-singlethreaded \
>>>>
>>>> +       --disable-examples
>>>>
>>>>  define Build/InstallDev
>>>>         $(INSTALL_DIR) $(1)/usr/include
>>>>
>>>>
>>>>
>>>> I'm sorry again for the mistake
>>>> Massimo
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> openwrt-devel mailing list
>>>> [email protected]
>>>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>>>
>>>>
>>>
>>>
>>> --
>>> Ben West
>>> http://gowasabi.net
>>> [email protected]
>>> 314-246-9434
>>>
>>> _______________________________________________
>>> openwrt-devel mailing list
>>> [email protected]
>>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>>
>>>
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> [email protected]
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>
>>
>
>
> --
> Ben West
> http://gowasabi.net
> [email protected]
> 314-246-9434
>



-- 
Ben West
http://gowasabi.net
[email protected]
314-246-9434
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to