Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32bit/i686 __stack_chk_fail_local compile error #23

Open
acoul opened this issue Mar 18, 2017 · 1 comment
Open

32bit/i686 __stack_chk_fail_local compile error #23

acoul opened this issue Mar 18, 2017 · 1 comment

Comments

@acoul
Copy link

acoul commented Mar 18, 2017

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);
..........................................................................................^

@sflow
Copy link
Owner

sflow commented Mar 22, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants