LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   cross compilation issue with openssh (http://www.linuxquestions.org/questions/linux-software-2/cross-compilation-issue-with-openssh-4175468353/)

harinathreddy.c 07-03-2013 10:21 AM

cross compilation issue with openssh
 
Hi Folks,

I have compiled openssl with openssl.mk that has been attached. It was compiled successfully.
I am compiling the openssh with openssh.mk that has been also attached.

here :
crosscompiler path:
/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1


I am facing the compilation issue like as fallows.

Quote:

mips-linux-uclibc-ld -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o -L. -Lopenbsd-compat/ -L/home/netgear/Projects/APCONTROLLER_MIPS/ngos/Feature_APController/SW/Westell/userapps/APController/Controller/M4/packages/build/openssl-0.9.8l/ -L/home/netgear/Projects/APCONTROLLER_MIPS/ngos/Feature_APController/SW/opensource/minidlna/zlib-1.2.3 -L/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib -L/home/netgear/Projects/APCONTROLLER_MIPS/ngos/Feature_APController/SW/Westell/userapps/APController/Controller/M4/packages/build/openssl-0.9.8l/ -lssh -lopenbsd-compat -lcrypto -lutil -lz -lcrypt -lresolv -lresolv
mips-linux-uclibc-ld: warning: libgcc_s.so.1, needed by /home/netgear/Projects/APCONTROLLER_MIPS/ngos/Feature_APController/SW/Westell/userapps/APController/Controller/M4/packages/build/openssl-0.9.8l//libcrypto.so, not found (try using -rpath or -rpath-link)
mips-linux-uclibc-ld: warning: cannot find entry symbol __start; defaulting to 0000000000405e40
clientloop.o: In function `client_loop':
clientloop.c:(.text+0x5b38): undefined reference to `__gtdf2'
./libssh.a(umac.o): In function `uhash_init':
umac.c:(.text+0x20d4): undefined reference to `__umoddi3'



I tried to attach them , it is saying invalid file after i have selected them.

openssl.mk
Quote:

Code:

SSL_TARGET=mips-linux

PKG:=openssl
VERSION:=0.9.8l
DIR:=${PKG}-${VERSION}
LDFLAGS=${TOOLCHAIN_TOP}/usr/${HOST}/lib
.PHONY: all
all: install

${DIR}/.build_complete: ${DIR}/Makefile.bak
        ${MAKE} -j1 -C ${DIR} AR="${AR} -r"
        touch ${DIR}/.build_complete

${DIR}/Makefile.bak: ${DIR}/Configure
        cd ${DIR} && ./Configure -L${LDFLAGS} shared  --openssldir=/tmp/wnc/openssl  ${SSL_TARGET}

.PHONY: install
install: ${DIR}/.build_complete
        ${MAKE} -j1 -C ${DIR} INSTALL_PREFIX=${ROOT} install_sw
        $(STRIP) ${ROOT}/wnc/openssl/bin/openssl
       
${DIR}/Configure:
        tar -zxf ${STORAGE}/${PKG}-${VERSION}.tar.gz
        cd ${DIR} && patch -p0 < ${STORAGE}/openssl.patch && patch -p1 < ${STORAGE}/openssl_mips.patch

~


openssh.mk
Quote:

Code:

.NOTPARALLEL:

include ../.config

PKG:=openssh
VERSION:=5.0p1
DIR:=${PKG}-${VERSION}

#ZLIBDIR=${TOPDIR}/linux/embedded_rootfs/build/zlib-1.2.3/
SSLDIR=${TOPDIR}/packages/build/openssl-0.9.8l/
ZLIBDIR=${ZLIB_DIR}
#SSLDIR=${LIBOPENSSL_DIR}

.PHONY: all
all: build install

.PHON: build
build: ${DIR} ${DIR}/Makefile
        ${MAKE} -C ${DIR}
       
${DIR}/Makefile:
        #cd ${DIR} && ./configure --prefix=${ROOT} --host=${CROSS} --disable-strip --with-privsep-path=/var --with-zlib=${ZLIBDIR} --with-ssl-dir=${SSLDIR} --with-linux=${KERNEL_DIR}/ LD=${CC} CFLAGS="-mabi=64" LDFLAGS="-mabi=64" && patch -p0 < ${STORAGE}/openssh-make.patch
        cd ${DIR} && ./configure --prefix=${ROOT} --host=${HOST} --disable-strip --with-privsep-path=/var --with-zlib=${ZLIBDIR} --with-ssl-dir=${SSLDIR} --with-linux=${KERNEL_DIR}/  LD=${CROSS_COMPILE}ld CFLAGS="" LDFLAGS="-L${EXTRALIBDIR} -L${SSLDIR}" && patch -p0 < ${STORAGE}/openssh-make.patch
.PHONY: install
install: ${DIR}
        cd ${DIR} && echo LogLevel QUIET >> sshd_config && ${MAKE} install-nokeys

${DIR}:
        tar -zxf ${STORAGE}/${PKG}-${VERSION}.tar.gz


~


Thanks,
Harinath

elucches 07-16-2013 08:03 AM

Hello Harinath,
I don't know if it will help you, but when I compiled it for ARM I followed this.
Best regards,
Esteban


All times are GMT -5. The time now is 12:42 PM.