host-sflow
host-sflow copied to clipboard
32bit/i686 __stack_chk_fail_local compile error
Greetings,
on a 32bit gentoo-latest (Gentoo Base System release 2.3) I am getting the following error:
gcc -std=gnu99 -I. -I../json -I../sflow -fPIC -g -O2 -D_GNU_SOURCE -DHSP_VERSION=2.0.9 -DUTHEAP -DHSP_OPTICAL_STATS -DHSP_MOD_DIR=/etc/hsflowd/modules -Wall -Wstrict-prototypes -Wunused-value -Wunused-function -c mod_json.c
ld -o mod_json.so mod_json.o -shared
mod_json.o: In function evt_packet_tock': /inet/netflow/host-sflow/src/Linux/mod_json.c:1280: undefined reference to
__stack_chk_fail_local'
mod_json.o: In function getApplication': /inet/netflow/host-sflow/src/Linux/mod_json.c:284: undefined reference to
__stack_chk_fail_local'
mod_json.o: In function readJSON': /inet/netflow/host-sflow/src/Linux/mod_json.c:1250: undefined reference to
__stack_chk_fail_local'
ld: mod_json.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make[1]: *** [Makefile:251: mod_json.so] Error 1
the following patch resolves this issue
src/Linux/Makefile -LD=ld +LD=gcc
I am also getting this warning:
util.c: In function ‘hashHash’: util.c:1545:58: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] else if(oh->options & UTHASH_IDTY) return (uint32_t)((uint64_t)obj); ..........................................................................................^
Thanks. It's tricky because of the way that src/json/ is shared across all platforms (Linux, Solaris, FreeBSD, Darwin, ...) but perhaps we should allow each platform the discretion to compile and link cJSON in it's own way.