Re: [yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-23 Thread Robert Varga
Hi Khem,

> 
> can you try setting GLIBCPIE = "" in local.conf and see if that helps

I set GLIBCPIE = "" in local.conf but the result is the same. The linker issue 
"undefined reference to `_rtld_global_ro'" still occurs.
Do you have any other ideas what I could do?

--
Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#50065): https://lists.yoctoproject.org/g/yocto/message/50065
Mute This Topic: https://lists.yoctoproject.org/mt/75474633/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-21 Thread Robert Varga
Hi Khem,

Do you have any ideas, whether the passed compiler parameters (" -pie " or " 
-fpie ") are the origin of this linker issues?

Does anyone know if glibc is compiled with "--enable-static-pie" if the passed 
compiler parameters include those " -pie " or " -fpie "? Or are they unrelated?

Thanks a lot for your support.

--
Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#50049): https://lists.yoctoproject.org/g/yocto/message/50049
Mute This Topic: https://lists.yoctoproject.org/mt/75474633/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-17 Thread Robert Varga
If have searched for GLIBCPIE within all meta-files, but it seems that GLIBCPIE 
is already empty.

varga-r@ubuntu:~/projects/yocto-tq-mba6x$ grep -rnI "GLIBCPIE"
poky/meta/conf/distro/include/security_flags.inc:9:# If static PIE is known to 
work well, GLIBCPIE="--enable-static-pie" can be set
poky/meta/conf/distro/include/security_flags.inc:34:GLIBCPIE_powerpc = ""
poky/meta/recipes-core/glibc/glibc_2.29.bb:73:GLIBCPIE ??= ""
poky/meta/recipes-core/glibc/glibc_2.29.bb:89:                ${GLIBCPIE} \

Then I searched for "pie" within the generated glibc sources... and found many 
search results including " *-pie* " or " *-fpie* " as passed compiler parameter 
for various files (note that I pasted two lines only!):
varga-r@ubuntu:~/projects/yocto-tq-mba6x$ grep -rnI "pie" 
build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc

...
build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/temp/log.do_compile.90521:10133:arm-poky-linux-gnueabi-gcc
  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9  
--sysroot=/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/recipe-sysroot
 *-pie* -Wl,-O1 -nostdlib -nostartfiles -o 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/iconv/iconvconfig
  -fuse-ld=bfd  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/csu/Scrt1.o
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/csu/crti.o
 `arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard 
-mcpu=cortex-a9  
--sysroot=/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/recipe-sysroot
  --print-file-name=crtbeginS.o` 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/iconv/iconvconfig.o
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/iconv/strtab.o
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/iconv/xmalloc.o
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/iconv/hash-string.o
  -Wl,-dynamic-linker=/lib/ld-linux-armhf.so.3 
-Wl,-rpath-link=/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/math:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/elf:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/dlfcn:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/nss:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/nis:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/rt:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/resolv:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/mathvec:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/support:/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/nptl
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/libc.so.6
 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/libc_nonshared.a
 -Wl,--as-needed 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/elf/ld.so
 -Wl,--no-as-needed -lgcc 
/home/varga-r/projects/yocto-tq-mba6x/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/glibc/2.29-r0/build-arm-poky-linux-gnueabi/elf/libgcc-stubs.a
 `arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard 
-mcpu=cortex-a9  

Re: [yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-15 Thread Robert Varga
Thank you for instructions...

> 
> build SDK for arm64. e.g. MACHINE=qemuarm64 bitbake -cpopulate_sdk
> core-image-sato

After long attempts I finally managed to create an SDK with qemuarm64. However, 
I did not use the core-minimal-sato as suggested, but used the same setup as in 
my-image.bb (which is based on the core-image-full-cmdline).
With this new SDK I then did the same experiment and compiled the application, 
and it worked! There were no linker error messages.
Now the question for me is, why did it compile with qemuarm64, but not with my 
settings?
Is there anything else I can do to isolate the issue?
Thanks for your support so far.

--

Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49961): https://lists.yoctoproject.org/g/yocto/message/49961
Mute This Topic: https://lists.yoctoproject.org/mt/75474633/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-14 Thread Robert Varga
Thank you very much for your response.

> 
> it seems static apps with 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 the static 
apps which is not a good approach?
SDKIMAGE_FEATURES_append = " staticdev-pkgs"

I introduced this statement because I got linking errors when compiling/linking 
using the SDK complaining about missing libs just like ...
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-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-linux-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-linux-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-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-poky-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 = " 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?

> 
> 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 mips. 
Can you provide a short example?

Thank you for your support.

--

Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49940): https://lists.yoctoproject.org/g/yocto/message/49940
Mute This Topic: https://lists.yoctoproject.org/mt/75474633/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[yocto] Linker error undefined reference to `_rtld_global_ro'

2020-07-13 Thread Robert Varga
Hello,

I am new to the Yocto project and need some help in solving a linker issue when 
compiling/linking an application using the SDK. It seems, that the compilation 
is completed, but the linker could not resolve to "_rtld_global_ro". Here is 
the output of the last stage

...
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld:
 
/opt/mydistro/1.0.0/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/usr/lib/libc.a(getcontext.o):
 in function `getcontext':
/usr/src/debug/glibc/2.29-r0/git/stdlib/../sysdeps/unix/sysv/linux/arm/getcontext.S:101:
 undefined reference to `_rtld_global_ro'
/opt/mydistro/1.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/real-ld:
 
/opt/mydistro/1.0.0/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/usr/lib/libc.a(setcontext.o):
 in function `__startcontext':
/usr/src/debug/glibc/2.29-r0/git/stdlib/../sysdeps/unix/sysv/linux/arm/setcontext.S:100:
 undefined reference to `_rtld_global_ro'
collect2: error: ld returned 1 exit status
makefile:116: recipe for target 'ortable' failed
make: *** [ortable] Error 1


What I can see from the output is, that both getcontext.S and setcontext.S are 
referencing to "_rtld_global_ro". What I do not understand is, why the glibc is 
located in the debug folder? Is this probably the issue?

I have sourced the SDK using following command:
source 
/opt/mydistro/1.0.0/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi

Here's image bb file (which I have used for building the SDK using this command 
(bitbake my-image -c populate_sdk).

require recipes-extended/images/core-image-full-cmdline.bb

IMAGE_INSTALL_append = " \
emmy-w1-driver-sdiosdio \
emmy-w1-systemd \
eth-systemd \
can-systemd \
can-utils \
lighttpd \
dnsmasq \
parted \
swupdate \
swupdate-www \
u-boot-fw-utils \
linux-firmware-imx-sdma-imx6q \
"

TOOLCHAIN_HOST_TASK_append = " nativesdk-perl-modules"
SDKIMAGE_FEATURES_append = " staticdev-pkgs"

Any help on resolving this issue would be greatly appreciated.

Thanks.
--

Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49929): https://lists.yoctoproject.org/g/yocto/message/49929
Mute This Topic: https://lists.yoctoproject.org/mt/75474633/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] populate_sdk couldn't create the SDK installer for my image #sdk

2020-06-23 Thread Robert Varga
The hint regarding bitbake -e showed me the right direction... Within 
create_shar() function, sed is being called with the SDK_TITLE variable among 
others. Examination of the SDK_TITLE variable showed that it contained a " *'* 
" (SDK_TITLE="Rob *'* s Linux Distro") which seems to cause the issue. So I 
removed the " *'* " within the SDK_TITLE and now it works fine.
Thank you very much for your hints.
--
Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49725): https://lists.yoctoproject.org/g/yocto/message/49725
Mute This Topic: https://lists.yoctoproject.org/mt/75035545/21656
Mute #sdk: https://lists.yoctoproject.org/g/yocto+yocto/mutehashtag/sdk
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] Enable systemd service with unit template instance on startup

2020-06-17 Thread Robert Varga
> 
> 
> 
> Why is
> 
> 
> 
> 
> 
> 
> 
> SYSTEMD_SERVICE_${PN} = " \
> 
> 
> 
> can@... ( can@... ) \
> 
> 
> 
> "
> 
> 
> 
> and not
> 
> 
> 
> 
> 
> 
> 
> SYSTEMD_SERVICE_${PN} = " \
> 
> 
> 
> can@.service \
> 
> 
> 
> "
> 
> 
> 

This is because I want bitbake to create an instance of the template unit file 
(can@.service) with the parameter "can0" which is then passed to the template 
unit file. This corresponds to calling following in a console.

systemctl enable can@can0.service
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49663): https://lists.yoctoproject.org/g/yocto/message/49663
Mute This Topic: https://lists.yoctoproject.org/mt/74933670/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [yocto] Enable systemd service with unit template instance on startup

2020-06-17 Thread Robert Varga
I think I found the issue. The template unit file had a line break at the end 
which caused a folder
/etc/systemd/system/multi-user.target *?*.wants
to be created which contained the expected link (can@can0.service). Note the " 
*?"* behind ".target"!

Since systemd probably does not accept this, it did not work for me.
What puzzles me now is why bitbake has this issue with the line break at the 
end of the file.


...
[Install]
WantedBy=multi-user.target


Is this intended behavior?

Thanks.
Rob
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49660): https://lists.yoctoproject.org/g/yocto/message/49660
Mute This Topic: https://lists.yoctoproject.org/mt/74933670/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[yocto] Enable systemd service with unit template instance on startup

2020-06-17 Thread Robert Varga
I am new to yocto and I am using systemd as the init manager. I'd like to start 
a service (initializing CAN interface) at boot time. The service is a template 
and its name is can@.service:

[Unit]
Description=CAN Interface %I
Before=multi-user.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/ip link set %I type can bitrate 25
ExecStart=/sbin/ip link set %I up
ExecStop=/sbin/ip link set %I down

[Install]
WantedBy=multi-user.target

I wrote a recipe can-systemd.bb in order to install the service mentioned above:

SUMMARY = "Configuration file to set up CAN interface"
DESCRIPTION = "Used to setup the CAN interface"
LICENSE = "MIT"
LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit systemd

SYSTEMD_SERVICE_${PN} = " \
  can@can0.service \
"

SRC_URI_append = " \
  file://can@.service \
"

FILES_${PN} += " \
  ${sysconfdir}/systemd/system/can@.service \
"

do_install_append() {
  install -d ${D}${sysconfdir}/systemd/system
  install -m 0644 ${WORKDIR}/can@.service ${D}${sysconfdir}/systemd/system
}

When I run bitbake to create the image, I would expect that a symlink 
(can@can0.service -> /etc/systemd/system/can@.service) in the folder 
/etc/systemd/system/multi-user.target.wants should be generated. But this is 
not the case.

I think, the SYSTEMD_SERVICE_${PN}... assignment should create that link. Is 
this correct, or does anyone could show me how to start an instance of the 
template of this service.

Thanks for your support.

Rob

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. If you are not the intended recipient you are 
notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49659): https://lists.yoctoproject.org/g/yocto/message/49659
Mute This Topic: https://lists.yoctoproject.org/mt/74933670/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-