From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: Linker error undefined reference to `_rtld_global_ro' To: yocto@lists.yoctoproject.org From: "Robert Varga" X-Originating-Location: Karlsruhe, Baden-Württemberg, DE (217.240.134.124) X-Originating-Platform: Windows Chrome 81 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 14 Jul 2020 00:53:12 -0700 References: In-Reply-To: Message-ID: <15607.1594713192924490761@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="cWlPTRcMirKqgniHK97W" --cWlPTRcMirKqgniHK97W Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thank you very much for your response. >=20 > it seems static apps with glibc compiled with PIE related. >=20 I'm afraid I didn't understand (as I am new to yocto and try to understand= it). Did you mean, the following statement in my-image.bb file generates t= he static apps which is not a good approach? SDKIMAGE_FEATURES_append =3D " staticdev-pkgs" I introduced this statement because I got linking errors when compiling/li= nking using the SDK complaining about missing libs just like ... /opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-lin= ux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lpthread /opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-lin= ux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -ldl /opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-lin= ux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lstdc++ /opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-lin= ux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lm /opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-lin= ux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lc collect2: error: ld returned 1 exit status makefile:128: recipe for target 'arm' failed make: *** [arm] Error 1 When using this statement (SDKIMAGE_FEATURES_append =3D " staticdev-pkgs")= I can see in /opt/mydistro/1.0.0/sysroots/usr/lib many *.a files which are= not present without this statement. But I am not sure if this statement is= correct? Maybe there is another approach for including the missing libs? And what do you mean with "PIE related"? Are you thinking of an Raspberri = PI? >=20 > Can you verfiy if you get same issue with aarch64 or mips ? Also I would like to verify, but do not know how to setup for aarch64 or m= ips. Can you provide a short example? Thank you for your support. -- Rob --cWlPTRcMirKqgniHK97W Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thank you very much for your respons= e.

it seems static apps wi= th glibc compiled with PIE related.
I'm afraid I didn't understand (as I am new to yocto and try to understand= it). Did you mean, the following statement in my-image.bb file generates t= he static apps which is not a good approach?
SDKIMAGE_FEATURES_append = = =3D " staticdev-pkgs"

I introduced this statement because I got= linking errors when compiling/linking using the SDK complaining about miss= ing libs just like ...
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pok= y-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lpth= read
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pok= y-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -ldl<= /div>
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pok= y-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lstd= c++
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pok= y-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lm
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pok= y-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld: cannot find -lc
collect2: error: ld returned 1 exit status
makefile:128: recipe for target 'arm' failed
make: *** [arm] Error 1

When using this statement (SDKIMAGE_FEATURES_append =3D " stati= cdev-pkgs") I can see in /opt/mydistro/1.0.0/sysroots/usr/lib many *.a file= s which are not present without this statement. But I am not sure if this s= tatement is correct? Maybe there is another approach for including the miss= ing libs?

And what do you mean with "PIE related"? Are you thinking of an Rasp= berri PI?

Can you verfiy if you g= et same issue with aarch64 or mips ?
Also I would like to verify, but do not know how to setup for aarch64 or m= ips. Can you provide a short example?

Thank you for your support= .

--

Rob --cWlPTRcMirKqgniHK97W--