[Buildroot] Question about openssh.mk

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Sep 8 19:40:16 UTC 2014


Hello,

On Mon, 8 Sep 2014 18:49:09 +0000, ANDY KENNEDY wrote:

> We already pass the LD variable to openssl in order to use gcc as the
> driver for the link process, instead of directly using the ld
> linker. However, we were not passing LDFLAGS so that the compiler
> flags are passed, which means that with multilib toolchains, the
> incorrect library variant could be used at link time, leading to
> invalid binaries (partly ARMv4, partly ARMv5) or broken compilation
> (when the build took place in soft-float, but the link stage takes
> place against hard-float libraries).
> 
> This fixes a problem reported on IRC by amo-ej1 when compiling ssh on
> PowerPC e500v2 with a CodeSourcery toolchain ("crtbegin.o uses hard
> float, sshd uses soft float").
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk> 
> 
> The code in question:
> 
> OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)"
> 
> Taken from package/openssh/openssh.mk
> 
> Here we are setting LDFLAGS to TARGET_CFLAGS.  Is that really what
> you meant to do?  I mean, it "works", but not in every case.

Yes, that's what we want to do: openssh uses $(LD) and
$(TARGET_LDFLAGS) as if they were the compiler. In which case have you
identified this to not work?

> Also, this appears to be overriding the TARGET_CONFIGURE_OPTS in
> Makefile.in.  Is this legacy crap left over from the centralization
> project years ago?

No, it's not "legacy crap". TARGET_CONFIGURE_OPTS does LD=$(TARGET_LD)
and LDFLAGS=$(TARGET_LDFLAGS), assuming that the packages are really
using $(LD) as the linker and $(LDFLAGS) as the flags for the linker.
This is not what OpenSSH is doing, which is the reason why we override
those variables specifically for OpenSSH.

> Still working on it, may have an update to this later on today.

It would be easier if you let us know about the real problem :-)

Thanks for your report!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the buildroot mailing list