On FreeBSD it seems that the compiler flag -pie used when linking some of the executables, creates a shared object binary: [/ #] file /usr/bin/smbclient /usr/bin/smbclient: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.4, stripped which should be something like: [/ #] file /usr/sbin/smbd /usr/sbin/smbd: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.4, dynamically linked (uses shared libs), for FreeBSD 5.4, not stripped Reproducible: Always Steps to Reproduce: 1.emerge net-fs/samba 2.try to run one of the distribution programs, ie: /usr/bin/smbclient Actual Results: [/ #] smbclient -/bin/bash: /usr/bin/smbclient: cannot execute binary file Expected Results: Show the list of options since i didn't pass any. Portage 2.0.53_rc6 (!/usr/local/portage/gentoo-freebsd/profiles/default-bsd/fbsd/5.4/x86, gcc-, freebsd-lib-5.4-r2, 5.4-RELEASE i386) ================================================================= System uname: 5.4-RELEASE i386 i386 Gentoo/FreeBSD: FreeBSD version 5.4-RELEASE; Gentoo base version 0.7 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.13 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.15 sys-devel/libtool: 1.5.20 virtual/os-headers: 5.4 ACCEPT_KEYWORDS="x86 x86-fbsd ~x86 ~x86-fbsd" AUTOCLEAN="yes" CBUILD="i686-gentoo-freebsd5.4" CFLAGS="-O2 -march=pentium3 -maccumulate-outgoing-args -momit-leaf-frame-pointer -fomit-frame-pointer -fweb -frename-registers -fpeel-loops -fmove-all-movables -pipe" CHOST="i686-gentoo-freebsd5.4" CONFIG_PROTECT="/etc /var/bind" CONFIG_PROTECT_MASK="/etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium3 -frename-registers -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages sandbox" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/usr/local/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/gentoo-freebsd" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86-fbsd acpi apache2 berkdb bitmap-fonts bzip2 gd gdbm gif htdocs imlib insecure-drivers ipsec ithreads jpeg mmx mpm-worker nat ncurses netgraph opengl pcre perl pf php png postgres python readline ruby silvercity sqlite sse ssl symlink threads tiff truetype truetype-fonts type1-fonts urandom vhosts winbind xv zlib userland_BSD kernel_FreeBSD elibc_FreeBSD" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
I've added a simple check to gentoo-alt overlay's ebuild that tests the CHOST used. Can you give that a try and see if that works?
Still links the binaries with -pie as [/usr/local/portage #] file /usr/sbin/smbd /usr/sbin/smbd: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.4, stripped And, because of that: [09:44:11] [/usr/local/portage #] smbclient -L //192.168.0.1/ -su: /usr/bin/smbclient: cannot execute binary file
Just trying again to see the error: /usr/local/portage/gentoo-freebsd/net-fs/samba/samba-3.0.20b.ebuild: line 106: --with-expsam=pgsql, --with-manpages-langs=en --without-ldapsam --with-winbind --with-shared-modules=idmap_rid --disable-pie: command not found in that line: [[ ${CHOST} == *-*bsd* ]] && "${myconf} --disable-pie" and it should be [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie"
Okay, I should *not* try to get things done without sleep, does it work after fixing the ebuild?
Emerges fine, works fine: [14:18:47] [/root #] smbclient -L //192.168.0.1 -U javier Password: Domain=[STRONGHOLD] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager] Sharename Type Comment --------- ---- ------- IPC$ IPC IPC remota ADMIN$ Disk Admin remota C$ Disk Recurso predeterminado D$ Disk Recurso predeterminado
Moving that to samba team :)
Created attachment 71618 [details, diff] samba-nopie.patch Here is the patch that works (currently on gentoo-alt overlay). Is okay if I commit it?
good work doesn't need permission: go ahead :-)
Thanks, I've committed it now.