LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   [make] Build ipvsadm, libpopt.so: file not recognized (https://www.linuxquestions.org/questions/linux-general-1/%5Bmake%5D-build-ipvsadm-libpopt-so-file-not-recognized-4175411792/)

martvefun 06-16-2012 09:28 AM

[make] Build ipvsadm, libpopt.so: file not recognized
 
Hello,

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 :

Code:

$ 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/libpopt.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status

I have the problematic library exists and seems fine
Code:

$ file /usr/lib/libpopt.*
/usr/lib/libpopt.a:        current ar archive
/usr/lib/libpopt.so:      symbolic link to `libpopt.so.0.0.0'
/usr/lib/libpopt.so.0:    symbolic link to `libpopt.so.0.0.0'
/usr/lib/libpopt.so.0.0.0: 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 libpopt.so 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

Code:

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; \
done)
endif

I replaced the first line by

Code:

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 12:41 AM.