Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 8916] New: LDFLAGS pass to openssh
@ 2016-05-10 16:40 bugzilla at busybox.net
  2016-09-12 15:44 ` [Buildroot] [Bug 8916] " bugzilla at busybox.net
  2016-09-16 13:28 ` bugzilla at busybox.net
  0 siblings, 2 replies; 3+ messages in thread
From: bugzilla at busybox.net @ 2016-05-10 16:40 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8916

            Bug ID: 8916
           Summary: LDFLAGS pass to openssh
           Product: buildroot
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: yxygyxyg at gmail.com
                CC: buildroot at uclibc.org
  Target Milestone: ---

The fail message we obtain in buildroot-compiled chroot environment:

bash-4.3# ssh
bash: /usr/bin/ssh: No such file or directory

It happens because ssh execute file does not contain proper dynamic linker way:

# readelf /tmp/usr/bin/ssh -l
...
[Requesting program interpreter:
/home/cf/e2k/mcst.rel-21-0.fs/2016-04-12/e2k-generic-linux.cross/lib64/ld-linux.so.2]
...

The proper way to dynamic linker we set with
BR2_TARGET_LDFLAGS="-Wl,-dynamic-linker,/lib/ld-linux.so.2" option in .config
file. This scheme works fine in different packages (busybox, bash ...).
In case of openssh package the option does not pass through
package/openssh/openssh.mk file:

...
OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)"
...

Here internal openssh option LDFLAGS contain only common $(TARGET_CFLAGS).
Common $(TARGET_LDFLAGS) does not pass inside openssh build system here.

If we change this line to the next:

...
OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)
$(TARGET_LDFLAGS)"
...

ssh works fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [Bug 8916] LDFLAGS pass to openssh
  2016-05-10 16:40 [Buildroot] [Bug 8916] New: LDFLAGS pass to openssh bugzilla at busybox.net
@ 2016-09-12 15:44 ` bugzilla at busybox.net
  2016-09-16 13:28 ` bugzilla at busybox.net
  1 sibling, 0 replies; 3+ messages in thread
From: bugzilla at busybox.net @ 2016-09-12 15:44 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8916

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #1 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
It works just fine here, and there is absolutely no need to pass custom LDFLAGS
for this to work. The default dynamic linker path is set by the cross-compiler
and is correct.

I've just tested the following Buildroot defconfig:

BR2_x86_64=y
BR2_x86_core2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_OPENSSH=y

ssh has the correct dynamic linker path:

 readelf -a output/target/usr/bin/ssh | grep -i interpreter
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

and when I extract the rootfs.tar and chroot into it:

$ sudo chroot rootfs /bin/sh
/ # ssh -l
Couldn't open /dev/null: No such file or directory
/ # mount -t devtmpfs none /dev
/ # ssh -l
option requires an argument -- l
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
           [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]

So I think you have something in your environment that causes the
cross-compiler to encode a wrong path to the dynamic linker.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [Bug 8916] LDFLAGS pass to openssh
  2016-05-10 16:40 [Buildroot] [Bug 8916] New: LDFLAGS pass to openssh bugzilla at busybox.net
  2016-09-12 15:44 ` [Buildroot] [Bug 8916] " bugzilla at busybox.net
@ 2016-09-16 13:28 ` bugzilla at busybox.net
  1 sibling, 0 replies; 3+ messages in thread
From: bugzilla at busybox.net @ 2016-09-16 13:28 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8916

--- Comment #2 from Timur Mustafin <yxygyxyg@gmail.com> ---
I thought that BR2_TARGET_LDFLAGS option should be pass to the linker when
building any package. As it is mentioned in menuconfig's help:
"BR2_TARGET_LDFLAGS:
Extra options to pass to the linker when building for the target.".
In case of openssh package the option is not passed to the linker.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-16 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 16:40 [Buildroot] [Bug 8916] New: LDFLAGS pass to openssh bugzilla at busybox.net
2016-09-12 15:44 ` [Buildroot] [Bug 8916] " bugzilla at busybox.net
2016-09-16 13:28 ` bugzilla at busybox.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox