intel/tinycbor

cbordump from the master is failing to build

Closed this issue · 5 comments

cbordump tool from the master is failing to build.

Error:

cc -o ../bin/cbordump cbordump.o cborparser.o cborerrorstrings.o cborpretty.o
cbordump.o: In function `dumpFile':
tinycbor/tools/cbordump/cbordump.c:81: undefined reference to `cbor_value_to_json_advance'
cborpretty.o: In function `cbor_value_dup_byte_string':
tinycbor/tools/../src/cbor.h:387: undefined reference to `_cbor_value_dup_string'
cborpretty.o: In function `value_to_pretty':
tinycbor/tools/../src/cborpretty.c:341: undefined reference to `__fpclassify'
cborpretty.o: In function `cbor_value_dup_text_string':
tinycbor/tools/../src/cbor.h:381: undefined reference to `_cbor_value_dup_string'
collect2: error: ld returned 1 exit status
make: *** [../bin/cbordump] Error 1

iotivity is also failing to build with the tinycbor from master.

out/linux/x86_64/debug/resource/csdk/stack/src/ocpayloadparse.os: In function `cbor_value_dup_text_string':
iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:381: undefined reference to `_cbor_value_dup_string'
out/linux/x86_64/debug/resource/csdk/stack/src/ocpayloadparse.os: In function `cbor_value_dup_byte_string':
iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:387: undefined reference to `_cbor_value_dup_string'
out/linux/x86_64/debug/resource/csdk/stack/src/rdpayload.os: In function `cbor_value_dup_text_string':
iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:381: undefined reference to `_cbor_value_dup_string'
out/linux/x86_64/debug/libocsrm.a(aclresource.o): In function `cbor_value_dup_text_string':
iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:381: undefined reference to `_cbor_value_dup_string'
out/linux/x86_64/debug/libocsrm.a(amaclresource.o): In function `cbor_value_dup_text_string':
iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:381: undefined reference to `_cbor_value_dup_string'
out/linux/x86_64/debug/libocsrm.a(pstatresource.o):iotivity-1.1.0-3003bf3/extlibs/tinycbor/tinycbor/src/cbor.h:381: more undefined references to `_cbor_value_dup_string' follow

Iotivity master can be fixed by adding newly added file (i.e. cborparser_dup_string.c) to the SConscript, but the old versions(e.g. 1.1.0) which are suggesting to clone the tinycbor from master can fail with the same build error.

*********************************** Error: ****************************************
* Please download cbor using the following command:                               *
*     $ git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor *
***********************************************************************************

A new .c file was added in tinycbor and it must be included in iotivity Sconscript. I send a patch adding that to IoTivity repository: https://gerrit.iotivity.org/gerrit/#/c/9285/

Sorry, I haven't read that you commented about the SConscript in your comment. I sent a patch to IoTivity, but feel free to close it if you had submitted a previous fix or if you have a better approach.
I would say that we need to backport the SConscript patch to previous IoTivity versions or we need to instruct users to use a specific version of tinycbor in IoTivity build.
I added a pull request fixing the cbordump issue: #31

TinyCBOR side fixed with e73e4d8.