<?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>5174</bug_id>
          
          <creation_ts>2013-09-12 13:47:01 +0000</creation_ts>
          <short_desc>libtool with bashisms enabled in script can be shared through sstate-cache with host where /bin/sh is dash and cause build issues</short_desc>
          <delta_ts>2013-09-25 09:00:23 +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>1.5.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</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>normal</bug_severity>
          <target_milestone>1.5 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36606</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2013-09-12 13:47:01 +0000</bug_when>
    <thetext>apr-util-native is failing when /bin/sh is dash

First reported here:
http://lists.openembedded.org/pipermail/openembedded-core/2013-March/076087.html

We have some fixes for dash compatibility in libtool since:

commit 07ded02ffd37b4fe60a6210dbf56490ea306f0b6
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Tue Nov 8 21:33:53 2011 +0000

    Allow use of dash as /bin/sh

but current libtool script is still using var+= in 188 places, e.g. this one breaks apr-util-native build:
x86_64-linux-libtool: preserve_args+= --silent: not found
surprising that we don&apos;t hit one of those more often (maybe they just aren&apos;t fatal for build in many cases).

And there is few more possible bashisms found by checkbashisms:

possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 539 (alias):
  alias -g &apos;${1+&quot;$@&quot;}&apos;=&apos;&quot;$@&quot;&apos;
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 1018 ($RANDOM):
        my_tmpdir=&quot;${my_template}-${RANDOM-0}$$&quot;
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 8251 (shopt):
                test &quot;$want_nocaseglob&quot; = yes &amp;&amp; nocaseglob=`shopt -p nocaseglob`
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 8254 (shopt):
                    shopt -s nocaseglob
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 9525 (trap with signal numbers):
            trap &quot;$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE&quot; 1 2 15
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 9541 (trap with signal numbers):
            trap &quot;$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE&quot; 1 2 15
possible bashism in tmp-eglibc/sysroots/x86_64-linux/usr/bin/x86_64-linux-libtool line 9553 (trap with signal numbers):
            trap &quot;$RM $output; exit $EXIT_FAILURE&quot; 1 2 15</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36607</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2013-09-12 13:53:14 +0000</bug_when>
    <thetext>Ah I see it&apos;s probably more complicated than that :).

In http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518905, I&apos;ve read:
  Libtool uses (and exploits features of) the shell it was configured for.
  The /usr/bin/libtool script has to be used with it.  The first line of
  the script should reflect that, as well as its SHELL= setting.

And I see that my libtool script was configured with SHELL=/bin/sh (and /bin/sh -&gt; bash here), but when the same libtool-native is shared with sstate to some other host where /bin/sh -&gt; dash, it will try to use bash features and fail.

So the problem is, that sstate signature of libtool doesn&apos;t contain system shell (the real shell not just /bin/sh as symlink).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37076</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-09-23 16:21:20 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&amp;id=5eeecef53b430883b89ba1d1020685e2247b3c14 might offer a fix for this. Means patching autoconf unfortunately</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37164</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-09-25 09:00:23 +0000</bug_when>
    <thetext>Fix is in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=49e754aca3a79abfa024472e3528a5dcb7291b41</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>