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

Luca Turchet tur at create.aau.dk
Fri Aug 12 20:11:59 UTC 2016


Hi Thomas,
thanks for your quick reply. I just read your answer, after having sent my last post to the list.

As you can see from that post, I have already tried using -fPIC in the linker command line. 

"Apart from system libraries there is only -lflext-pd_s . I would suppose that this has also been compiled with -fPIC (if you are using the flext build system for simple1) but only you can really know that."

Yes I have not touched anything in the file gnumake-gcc.inc that is launched by build.sh  apart from the line LDFLAGS . So -lflext-pd_s should have been compiled properly with -fPIC as the -fPIC option is present in the CFLAGS of the same file.

Any further suggestion? 


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
Project Website: www.ahws-project.net
Personal Website: www.lucaturchet.it

________________________________________
From: Thomas Grill [grrrr.org at gmail.com] on behalf of Thomas Grill [gr at grrrr.org]
Sent: Friday, August 12, 2016 10:00 PM
To: Luca Turchet
Cc: flext at grrrr.org
Subject: Re: [flext] Build error related to ld and __stack_chk_guard@@GLIBC_2.17

Hi Luca,
there is not much choice:

The compilation is:
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

Apart from system libraries there is only -lflext-pd_s . I would suppose that this has also been compiled with -fPIC (if you are using the flext build system for simple1) but only you can really know that.
It's a shot in the dark, but also try adding -fPIC to the linker command line...

good luck,
Thomas

--
Thomas Grill
http://grrrr.org



> Am 12.08.2016 um 20:12 schrieb Luca Turchet <tur at create.aau.dk>:
>
>
> 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
> Project Website: www.ahws-project.net
> Personal Website: 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
> Project Website: www.ahws-project.net
> Personal Website: www.lucaturchet.it
> _______________________________________________
> http://grrrr.org/ext/flext
>
> flext mailing list
> flext at grrrr.org
> http://grrrr.org/cgi-bin/mailman/listinfo/flext


More information about the flext mailing list