-   Linux - General (
-   -   [make] Build ipvsadm, file not recognized (

martvefun 06-16-2012 09:28 AM

[make] Build ipvsadm, file not recognized

I am trying to compile the firmware of my DLink wireless camera on my computer from the sources (got from the DLink website). The device is an ARMv5 system and my computer uses Archlinux x86_64. In the source archive, there was mv_pro_5.0 (from MontaVista) which ships an ARM compiler added to the $PATH.

While building the software, (using the provided makefile), it fails while building the app ipvsadm (in the subdirectory apps/public/ipvsadm-1.24/, makefile). The error is the following :


$ arm_v5t_le-gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -L/usr/lib -lpopt
/usr/lib/ file not recognized: File format not recognized
collect2: ld returned 1 exit status

I have the problematic library exists and seems fine

$ file /usr/lib/libpopt.*
/usr/lib/libpopt.a:        current ar archive
/usr/lib/      symbolic link to `'
/usr/lib/    symbolic link to `'
/usr/lib/ ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x096d17e510cee6b9ec0e28f64b2ce67cc910cd27, stripped
$ whereis arm_v5t_le-gcc
arm_v5t_le-gcc: /opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc

Any idea how to fix it ?

Thank you

pan64 06-16-2012 09:48 AM

so you want to build a tool for your arm device on an x86_64 machine. In this case the option -L/usr/lib is definitely not usable, because the libs located in /usr/lib belong to the OS and cannot be used on arm. You need to find the appropriate libpopt. Probably locate will tell you were is it (maybe somewhere here /opt/mv_pro_5.0/montavista/pro/devkit/arm)

knudfl 06-16-2012 09:58 AM

... And if there's no in /opt/mv_pro_5.0/montavista/pro/devkit/arm :

Then you will have to cross compile "popt" ( and all other dependencies )
to e.g. /opt/mv_pro_5.0/montavista/pro/devkit/arm.

martvefun 06-16-2012 10:34 AM

You are right. In the makefile there was this block


ifeq (,$(FORCE_GETOPT))
LIB_SEARCH = /lib /usr/lib /usr/local/lib
POPT_LIB = $(shell for i in $(LIB_SEARCH); do \
  if [ -f $$i/libpopt.a ]; then \
    if nm $$i/libpopt.a | fgrep -q poptGetContext; then \
        echo "-L$$i -lpopt"; \
    fi; \
  fi; \

I replaced the first line by


MVPATH = /opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target
LIB_SEARCH = $(MVPATH)/lib $(MVPATH)/usr/lib $(MVPATH)/usr/local/lib

and it works, thanks

All times are GMT -5. The time now is 07:35 AM.