[flext] Build error related to ld and __stack_chk_guard@@GLIBC_2.17

Luca Turchet tur at create.aau.dk
Fri Aug 12 20:02:09 UTC 2016


I managed to find the file (gnu make-gcc.inc) and modify it inserting the -fPIC flag. However, the result I got is the same:

odroid at odroid64:~/flext-master/tutorial/simple1$ g++ -fPIC -L/usr/lib -pthread -shared -Wl,-S -L/usr/local/src/pd/bin -L/usr/local/lib -o pd-linux/release-single/simple1.pd_linux   pd-linux/release-single/main.opp  -lflext-pd_s
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o)(.text+0x344): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status



As you can see the -fPIC option is present in the launched g++ command. So I don't understand why the compiler keep suggesting to "recompile with -fPIC". Any Idea?

Best

Luca


______________________________________________

Luca Turchet, Ph.D.
Postdoctoral Research Fellow

Department of Architecture, Design & Media Technology
Aalborg University Copenhagen
A. C. Meyers Vænge 15
DK-2450 Copenhagen SV

E-mail: tur at create.aau.dk<mailto:tur at create.aau.dk>
Project Website: www.ahws-project.net<http://www.ahws-project.net>
Personal Website: www.lucaturchet.it<http://www.lucaturchet.it>
________________________________
From: flext [flext-bounces at grrrr.org] on behalf of Luca Turchet [tur at create.aau.dk]
Sent: Friday, August 12, 2016 8:12 PM
To: flext at grrrr.org
Subject: Re: [flext] Build error related to ld and __stack_chk_guard@@GLIBC_2.17


Actually reading better the output I can see that it is stated "recompile with -fPIC" on the second g++ command
(on the first g++ the option -fPIC was present, I didn't notice that there was a second g++).

So I need to recompile the shared libraries with that option. Can anyone suggest me which file should I modify
among all the files involved in the build process?

Best

Luca




______________________________________________

Luca Turchet, Ph.D.
Postdoctoral Research Fellow

Department of Architecture, Design & Media Technology
Aalborg University Copenhagen
A. C. Meyers Vænge 15
DK-2450 Copenhagen SV

E-mail: tur at create.aau.dk<mailto:tur at create.aau.dk>
Project Website: www.ahws-project.net<http://www.ahws-project.net>
Personal Website: www.lucaturchet.it<http://www.lucaturchet.it>
________________________________
From: flext [flext-bounces at grrrr.org] on behalf of Luca Turchet [tur at create.aau.dk]
Sent: Friday, August 12, 2016 7:00 PM
To: flext at grrrr.org
Subject: [flext] Build error related to ld and __stack_chk_guard@@GLIBC_2.17



Dear list members,
I am experiencing an error related to ld and __stack_chk_guard@@GLIBC_2.17
while building the "simple1" example of the tutorial, on my embedded board
ODROID C2 (which is armv8-64 bit) running Ubuntu 16.04.1:


g++ -c  -ffast-math -DFLEXT_USE_CMEM -O3 -march=native   -I/usr/include/pd -pthread -fPIC -fvisibility-inlines-hidden -DNDEBUG -DFLEXT_SYS=2 -DPD -I/usr/local/src/pd/src -I/usr/local/src/pd/include -I/usr/local/src/pd/include/pd -I/usr/local/include/stk -I/usr/local/include/sndobj -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp
g++ -L/usr/lib -pthread -shared  -Wl,-S -L/usr/local/src/pd/bin -L/usr/local/lib -o pd-linux/release-single/simple1.pd_linux   pd-linux/release-single/main.opp  -lflext-pd_s
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o)(.text+0x344): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status


I also tried to compile inserting the flag -fno-stack-protector as indicated for a related case
on this link http://stackoverflow.com/questions/15787684/lfs-glibc-compilation-ld-error
but I got the same result.

Any ideas? My version of g++ is 5.4.0.

I was also wondering whether the flags -ffast-math and -O3 are appropriate for armv8-64 platforms.



Best

Luca




______________________________________________

Luca Turchet, Ph.D.
Postdoctoral Research Fellow

Department of Architecture, Design & Media Technology
Aalborg University Copenhagen
A. C. Meyers Vænge 15
DK-2450 Copenhagen SV

E-mail: tur at create.aau.dk<mailto:tur at create.aau.dk>
Project Website: www.ahws-project.net<http://www.ahws-project.net>
Personal Website: www.lucaturchet.it<http://www.lucaturchet.it>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20160812/bcdd8274/attachment-0001.html>


More information about the flext mailing list