<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9659</bug_id>
          
          <creation_ts>2016-05-22 19:33:42 +0000</creation_ts>
          <short_desc>hidden symbol pthread_atfork</short_desc>
          <delta_ts>2016-07-29 17:39:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>2.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bharath">kernelraj</reporter>
          <assigned_to name="Khem Raj">raj.khem</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>kernelraj</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>raj.khem</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>yp.cp.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          <qa_contact name="Yi Zhao">yi.zhao</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62374</commentid>
    <comment_count>0</comment_count>
    <who name="Bharath">kernelraj</who>
    <bug_when>2016-05-22 19:33:42 +0000</bug_when>
    <thetext>Hi All,

we are trying to build AGL mainline for ARM64 architecture.

we are facing issue with pthread_atfork support.

configure:34000: checking for eglGetError in -lEGL
configure:34025: aarch64-poky-linux-gcc  --sysroot=/local/mnt/workspace/bharath/AGL_8996/poky/build/tmp-glibc/sysroots/msm8996 -o conftest  -O2 -pipe -g -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c -lEGL -ldl -lglib-2.0 -lpthread  &gt;&amp;5
/local/mnt/workspace/bharath/AGL_8996/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/5.2.0/ld: conftest: hidden symbol `pthread_atfork&apos; in /local/mnt/workspace/bharath/AGL_8996/poky/build/tmp-glibc/sysroots/msm8996/usr/lib/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
/local/mnt/workspace/bharath/AGL_8996/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/5.2.0/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
configure:34025: $? = 1

This issue clearly relates to the issues mentioned in the Blog found at:
  http://ryanarn.blogspot.com/

However, contrary to what&apos;s stated in the Blog, the problem cannot be solved
by simply mentioning -lpthread after the object files.

can you please let us if you guys have faced similar issues while building it for arch64.

we are using glibc-2.2 verion.

Thanks for your time..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62386</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-05-23 16:15:52 +0000</bug_when>
    <thetext>This does not appear to be related to the prelinker, but instead is a general compilation issue..  Moving the product/component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62387</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-05-23 16:19:03 +0000</bug_when>
    <thetext>Do you have a standalone reproducer case?

Also what version of the Yocto Project are you using?  There has not been a &apos;glibc-2.2&apos; in a very long time.  In the last few years the versions have been in the range of 2.18 through 2.23.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62394</commentid>
    <comment_count>3</comment_count>
    <who name="Bharath">kernelraj</who>
    <bug_when>2016-05-23 17:05:22 +0000</bug_when>
    <thetext>Yes I could able to reproduce the issue every time.


I am using latest AGL mainline source ..

repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo

reconfirmed one more time we are unsing glibc-2.2

tmp-glibc/work/aarch64-poky-linux/glibc/2.22-r0

Kindly let me know if you need any more info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62395</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-05-23 17:22:16 +0000</bug_when>
    <thetext>This is glibc-2.22, not glibc-2.2

Yocto Project 2.0 (jethro) uses glibc-2.22.

We still need a reproducer for this.  At a minimum this would need to be a system configuration, but preferably something smaller that shows the problem.

The log you posted below does not indicate system configuration or even what recipe failed the link.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62463</commentid>
    <comment_count>5</comment_count>
    <who name="Bharath">kernelraj</who>
    <bug_when>2016-05-26 00:10:27 +0000</bug_when>
    <thetext>Hi Raj,

I have seen some of your commits related to pthread_atfork API.

Can you please give some pointers to debug hidden symbol pthread_atfork issue.


Thanks for your time.

Regards
Bharath</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62468</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-05-26 14:35:53 +0000</bug_when>
    <thetext>You would tru removing the as-needed piece of the linker command and see if that helps. The location of the -lpthread in the command line would otherwise be important.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62478</commentid>
    <comment_count>7</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2016-05-26 16:12:25 +0000</bug_when>
    <thetext>Add

CFLAGS += &quot;-pthread&quot;

to component recipe, should fix it.

however, you should be careful if its dlopening stuff just make sure that, dlopen is happening on real .so and not some stub e.g. libpthread.so is a linker script stub in glibc not full library or symlink.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62486</commentid>
    <comment_count>8</comment_count>
    <who name="Bharath">kernelraj</who>
    <bug_when>2016-05-26 19:32:51 +0000</bug_when>
    <thetext>Hi Raj,

I have added as you suggested in Weston_%.bbappend file.

CFLAGS += &quot;-idirafter ${STAGING_KERNEL_DIR}/include/&quot;
CFLAGS_append += &quot;-pthread&quot;


But still same error persist.

| aarch64-poky-linux-libtool: link: aarch64-poky-linux-gcc --sysroot=/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/ -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g -fvisibility=hidden -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/include/cairo -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/include/glib-2.0 -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/glib-2.0/include -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/include/pixman-1 -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/include/freetype2 -I/local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/include/libpng16 -O2 -pipe -g -feliminate-unused-debug-types -idirafter /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/work-shared/kernel-source/include/ -pthread -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o weston-subsurfaces clients/weston_subsurfaces-subsurfaces.o  ./.libs/libtoytoolkit.a /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libxkbcommon.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libcairo.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libpixman-1.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libfontconfig.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libexpat.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libfreetype.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libpng16.so -lz /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libjpeg.so -lEGL -ldl /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libglib-2.0.so -lpthread -lGLESv2 -lwayland-egl /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libwayland-cursor.so /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libwayland-client.so /local/mnt/workspace/bharath/AGL_8996/poky/build/tmp-glibc/sysroots/usr/lib/libffi.so -lrt -lm -pthread
| /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/5.2.0/ld: weston-subsurfaces: hidden symbol `pthread_atfork&apos; in /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/usr/lib/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
| /local/mnt/workspace/bharath/AGL/poky/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/5.2.0/ld: final link failed: Bad value
| collect2: error: ld returned 1 exit status
| make[1]: *** [weston-subsurfaces] Error 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62744</commentid>
    <comment_count>9</comment_count>
    <who name="Bharath">kernelraj</who>
    <bug_when>2016-06-08 01:38:17 +0000</bug_when>
    <thetext>fixed ..</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>