dailab/libsml — Issue #3: Compile glibc got error `__stack_chk_fail_local' on Ubuntu
Author: justinotherguy
Created: 2011-10-18 21:54:09+00:00
State: open

Hi Juri,

I do this:

git clone https://github.com/dailab/libsml.git
cd libsml
make

and I get this:

make
make[1]: Entering directory `/opt/libsml/sml'
cc -I./include/ -fPIC -g -Wall -c -o src/sml_file.o src/sml_file.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_attention_response.o src/sml_attention_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_transport.o src/sml_transport.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_octet_string.o src/sml_octet_string.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_shared.o src/sml_shared.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_number.o src/sml_number.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_message.o src/sml_message.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_time.o src/sml_time.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_list.o src/sml_list.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_status.o src/sml_status.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_value.o src/sml_value.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_tree.o src/sml_tree.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_boolean.o src/sml_boolean.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_crc16.o src/sml_crc16.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_open_request.o src/sml_open_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_open_response.o src/sml_open_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_list_request.o src/sml_get_list_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_list_response.o src/sml_get_list_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_close_request.o src/sml_close_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_close_response.o src/sml_close_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_set_proc_parameter_request.o src/sml_set_proc_parameter_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_proc_parameter_request.o src/sml_get_proc_parameter_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_proc_parameter_response.o src/sml_get_proc_parameter_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_profile_pack_request.o src/sml_get_profile_pack_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_profile_pack_response.o src/sml_get_profile_pack_response.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_profile_list_request.o src/sml_get_profile_list_request.c
cc -I./include/ -fPIC -g -Wall -c -o src/sml_get_profile_list_response.o src/sml_get_profile_list_response.c
ld -luuid -shared -soname libsml.so.1 -o lib/libsml.so.1 src/sml_file.o src/sml_attention_response.o src/sml_transport.o src/sml_octet_string.o src/sml_shared.o src/sml_number.o src/sml_message.o src/sml_time.o src/sml_list.o src/sml_status.o src/sml_value.o src/sml_tree.o src/sml_boolean.o src/sml_crc16.o src/sml_open_request.o src/sml_open_response.o src/sml_get_list_request.o src/sml_get_list_response.o src/sml_close_request.o src/sml_close_response.o src/sml_set_proc_parameter_request.o src/sml_get_proc_parameter_request.o src/sml_get_proc_parameter_response.o src/sml_get_profile_pack_request.o src/sml_get_profile_pack_response.o src/sml_get_profile_list_request.o src/sml_get_profile_list_response.o
src/sml_transport.o: In function `sml_transport_read':
/opt/libsml/sml/src/sml_transport.c:109: undefined reference to `__stack_chk_fail_local'
src/sml_transport.o: In function `sml_transport_write':
/opt/libsml/sml/src/sml_transport.c:163: undefined reference to `__stack_chk_fail_local'
src/sml_octet_string.o: In function `sml_octet_string_init_from_hex':
/opt/libsml/sml/src/sml_octet_string.c:55: undefined reference to `__stack_chk_fail_local'
src/sml_octet_string.o: In function `sml_octet_string_generate_uuid':
/opt/libsml/sml/src/sml_octet_string.c:122: undefined reference to `__stack_chk_fail_local'
src/sml_number.o: In function `sml_number_byte_swap':
/opt/libsml/sml/src/sml_number.c:106: undefined reference to `__stack_chk_fail_local'
ld: lib/libsml.so.1: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Nonrepresentable section on output
make[1]: *** [lib/libsml.so.1] Error 1
make[1]: Leaving directory `/opt/libsml/sml'
make: *** [all] Error 2

I'm running Ubuntu 10.04.3 LTS using commit dd813cd5b5.

Following http://ubuntuforums.org/showthread.php?t=352642 (thx to stv0g!) I found out that adding "-fno-stack-protector" to the CFLAGS helps - make runs fine, then.

Please let me know, if you need more details.

Regards, J.