Bug 6997

Summary: issue in meta/recipes-connectivity/openssh_6*.bb file
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yang <yang.y.wang>
Component: connectivityAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher
Version: 1.6   
Target Milestone: 1.8   
Hardware: x86   
OS: Multiple   
Whiteboard: needs backport to 1.7 and 1.6
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yang 2014-11-25 08:44:02 UTC
In the openssh .bb file, e.g. meta/recipes-connectivity/openssh/openssh_6.5p1.bb file, around line 56:
 export LD = "${CC}"
This line will set the LD to CC for linking. However when I have the secondary toolchain enabled for Yocto build, the LD will be set back to normal LD of the secondary toolchain. The " export LD = "${CC}" " here will become invalid. This will cause the linking error when the secondary toolchain layer is enabled.

Can we move this LD setup to function do_configure_prepend()? e.g. as following:

 76 do_configure_prepend () {
 77         if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
 78                 cp aclocal.m4 acinclude.m4
 79         fi
  +         export LD="${CC}"
 80 }

The issue also exists in newer Yocto Project.
Thanks.
-Yang
Comment 1 Saul Wold 2014-11-27 00:00:03 UTC
If that line is removed all together does your secondary toolchain work correctly, it's possible that might be the more correct fix.
Comment 2 Yang 2014-11-27 01:07:08 UTC
That line is necessary for openssh because the openssh use $CC to link for the final binary. If we remove that line at all, the openssh build will fail due to the incorrected linking options. There is option -Wl... in openssh linking stage which only supported by CC (not LD). 
i586-poky-linux-ld: unrecognized option '-Wl,-O1'


(In reply to comment #1)
> If that line is removed all together does your secondary toolchain work
> correctly, it's possible that might be the more correct fix.
Comment 3 Stephen K Jolley 2014-12-01 18:58:05 UTC
Saul, it appears Yang has answered your question.  Moving this off of NEEDINFO.
Comment 4 Saul Wold 2014-12-12 17:37:57 UTC
Ah, I think I see what's happening here, the autoconf is seeing the LD=CC 
during configuration, but the way secondary toolchain setup happens this export 
gets overridden by the secondary tool setting of LD, which you don't want for 
openssh.
Comment 5 Yang 2014-12-15 01:05:58 UTC
Hi Saul,
    Yes exactly:-).
Thanks.
-Yang

(In reply to comment #4)
> Ah, I think I see what's happening here, the autoconf is seeing the LD=CC 
> during configuration, but the way secondary toolchain setup happens this
> export 
> gets overridden by the secondary tool setting of LD, which you don't want
> for 
> openssh.
Comment 7 Saul Wold 2015-01-20 19:18:52 UTC
Merged into daisy and dizzy