Problems building with ltib: hal and libusb?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems building with ltib: hal and libusb?

2,716 Views
marknordstrand
Contributor III

Building for imx6q and as I run ltib, hal's configure runs and echos:

Processing: hal

=================

Build path taken because: directory build, build key set, no prebuilt rpm,

rpmbuild --dbpath /home/mark/freescale/src/ltib/rootfs//var/lib/rpm --target arm --define '_unpackaged_files_terminate_build 0' --define '_target_cpu arm' --define '__strip strip' --define '_topdir /home/mark/freescale/src/ltib/rpm' --define '_prefix /usr' --define '_tmppath /home/mark/freescale/src/ltib/tmp' --define '_rpmdir /home/mark/freescale/src/ltib/rpm/RPMS'  --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bc --short-circuit  /home/mark/freescale/src/ltib/dist/lfs-5.1/hal/hal.spec

Building target platforms: arm

Building for target arm

Executing(%build): /bin/sh -e /home/mark/freescale/src/ltib/tmp/rpm-tmp.67640

+ umask 022

+ cd /home/mark/freescale/src/ltib/rpm/BUILD

+ cd hal-0.5.10

+ ./configure --prefix=/usr --host=arm-linux --build=x86_64-unknown-linux-gnu --enable-verbose-mode --with-hal-user=haldaemon --with-hal-group=haldaemon --with-backend=linux --with-dbus-sys=/usr/etc/dbus-1/system.d/ --with-cpufreq=no --with-usb-csr=no --with-pci-ids=/usr/share/ --with-usb-ids=/usr/share/

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /bin/mkdir -p

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for arm-linux-strip... arm-linux-strip

checking whether to enable maintainer-specific portions of Makefiles... no

checking for style of include used by make... GNU

checking for arm-linux-gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... yes

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking dependency style of gcc... gcc3

checking for library containing strerror... none required

checking for arm-linux-gcc... (cached) gcc

checking whether we are using the GNU C compiler... (cached) yes

checking whether gcc accepts -g... (cached) yes

checking for gcc option to accept ISO C89... (cached) none needed

checking dependency style of gcc... (cached) gcc3

checking whether gcc and cc understand -c and -o together... yes

checking how to run the C preprocessor... gcc -E

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking for ANSI C header files... yes

checking build system type... x86_64-unknown-linux-gnu

checking host system type... arm-unknown-linux-gnu

checking for a sed that does not truncate output... /bin/sed

checking for ld used by gcc... ld

checking if the linker (ld) is GNU ld... yes

checking for ld option to reload object files... -r

checking for BSD-compatible nm... /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-linux-nm -B

checking whether ln -s works... yes

checking how to recognize dependent libraries... pass_all

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking dlfcn.h usability... yes

checking dlfcn.h presence... yes

checking for dlfcn.h... yes

checking whether we are using the GNU C++ compiler... yes

checking whether g++ accepts -g... yes

checking dependency style of g++... gcc3

checking how to run the C++ preprocessor... g++ -E

checking for arm-linux-g77... no

checking for arm-linux-xlf... no

checking for arm-linux-f77... no

checking for arm-linux-frt... no

checking for arm-linux-pgf77... no

checking for arm-linux-cf77... no

checking for arm-linux-fort77... no

checking for arm-linux-fl32... no

checking for arm-linux-af77... no

checking for arm-linux-xlf90... no

checking for arm-linux-f90... no

checking for arm-linux-pgf90... no

checking for arm-linux-pghpf... no

checking for arm-linux-epcf90... no

checking for arm-linux-gfortran... no

checking for arm-linux-g95... no

checking for arm-linux-xlf95... no

checking for arm-linux-f95... no

checking for arm-linux-fort... no

checking for arm-linux-ifort... no

checking for arm-linux-ifc... no

checking for arm-linux-efc... no

checking for arm-linux-pgf95... no

checking for arm-linux-lf95... no

checking for arm-linux-ftn... no

checking for g77... no

checking for xlf... no

checking for f77... no

checking for frt... no

checking for pgf77... no

checking for cf77... no

checking for fort77... no

checking for fl32... no

checking for af77... no

checking for xlf90... no

checking for f90... no

checking for pgf90... no

checking for pghpf... no

checking for epcf90... no

checking for gfortran... no

checking for g95... no

checking for xlf95... no

checking for f95... no

checking for fort... no

checking for ifort... no

checking for ifc... no

checking for efc... no

checking for pgf95... no

checking for lf95... no

checking for ftn... no

checking whether we are using the GNU Fortran 77 compiler... no

checking whether  accepts -g... no

checking the maximum length of command line arguments... 1572864

checking command to parse /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-linux-nm -B output from gcc object... ok

checking for objdir... .libs

checking for arm-linux-ar... ar

checking for arm-linux-ranlib... arm-linux-ranlib

checking for arm-linux-strip... (cached) arm-linux-strip

checking if gcc supports -fno-rtti -fno-exceptions... no

checking for gcc option to produce PIC... -fPIC

checking if gcc PIC flag -fPIC works... yes

checking if gcc static flag -static works... yes

checking if gcc supports -c -o file.o... yes

checking whether the gcc linker (ld) supports shared libraries... yes

checking whether -lc should be explicitly linked in... no

checking dynamic linker characteristics... GNU/Linux ld.so

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... yes

configure: creating libtool

appending configuration tag "CXX" to libtool

checking for ld used by g++... ld

checking if the linker (ld) is GNU ld... yes

checking whether the g++ linker (ld) supports shared libraries... yes

checking for g++ option to produce PIC... -fPIC

checking if g++ PIC flag -fPIC works... yes

checking if g++ static flag -static works... yes

checking if g++ supports -c -o file.o... yes

checking whether the g++ linker (ld) supports shared libraries... yes

checking dynamic linker characteristics... GNU/Linux ld.so

checking how to hardcode library paths into programs... immediate

appending configuration tag "F77" to libtool

checking whether make sets $(MAKE)... (cached) yes

checking whether ln -s works... yes

checking for special C compiler options needed for large files... no

checking for _FILE_OFFSET_BITS value needed for large files... 64

checking for arm-linux-pkg-config... no

checking for pkg-config... /opt/freescale/ltib/usr/bin/pkg-config

configure: WARNING: In the future, Autoconf will not detect cross-tools

whose name does not start with the host triplet.  If you think this

configuration is useful to you, please write to autoconf@gnu.org.

checking pkg-config is at least version 0.9.0... yes

checking sys/ioccom.h usability... no

checking sys/ioccom.h presence... no

checking for sys/ioccom.h... no

checking sys/inotify.h usability... yes

checking sys/inotify.h presence... yes

checking for sys/inotify.h... yes

checking expat.h usability... yes

checking expat.h presence... yes

checking for expat.h... yes

checking for XML_ParserCreate in -lexpat... yes

checking usb.h usability... yes

checking usb.h presence... yes

checking for usb.h... yes

checking for usb_find_devices in -lusb... yes

checking for SMBIOSFreeMemory in -lsmbios... no

checking pci/pci.h usability... no

checking pci/pci.h presence... no

checking for pci/pci.h... no

checking for gperf... no

checking whether to rebuild gperf header files... checking for DBUS... yes

checking for GLIB... yes

checking for VOLUME_ID... yes

checking for pgoff_t... no

checking for BLKGETSIZE64... yes

checking for getgrouplist... yes

checking for asprintf... yes

checking for mallopt... yes

checking for strndup... yes

checking for xmlto... no

checking whether to build DocBook documentation... checking for xmllint... /usr/bin/xmllint

yes

checking for Sony PIC headers... yes

configure: creating ./config.status

config.status: creating hal.pc

config.status: creating hal-storage.pc

config.status: creating hal.conf

config.status: creating Makefile

config.status: creating hald/Makefile

config.status: creating hald/dummy/Makefile

config.status: creating hald/linux/Makefile

config.status: creating hald/linux/probing/Makefile

config.status: creating hald/linux/addons/Makefile

config.status: creating hald/solaris/Makefile

config.status: creating hald/solaris/probing/Makefile

config.status: creating hald/solaris/addons/Makefile

config.status: creating hald/freebsd/Makefile

config.status: creating hald/freebsd/probing/Makefile

config.status: creating hald/freebsd/libprobe/Makefile

config.status: creating hald/freebsd/addons/Makefile

config.status: creating hald-runner/Makefile

config.status: creating libhal/Makefile

config.status: creating libhal-storage/Makefile

config.status: creating tools/Makefile

config.status: creating tools/freebsd/Makefile

config.status: creating tools/linux/Makefile

config.status: creating partutil/Makefile

config.status: creating policy/Makefile

config.status: creating fdi/Makefile

config.status: creating fdi/information/Makefile

config.status: creating fdi/information/10freedesktop/Makefile

config.status: creating fdi/information/20thirdparty/Makefile

config.status: creating fdi/policy/Makefile

config.status: creating fdi/policy/10osvendor/Makefile

config.status: creating fdi/policy/20thirdparty/Makefile

config.status: creating fdi/preprobe/Makefile

config.status: creating fdi/preprobe/10freedesktop/Makefile

config.status: creating fdi/preprobe/20thirdparty/Makefile

config.status: creating doc/Makefile

config.status: creating doc/api/Makefile

config.status: creating doc/api/libhal/Makefile

config.status: creating doc/api/libhal/version.xml

config.status: creating doc/api/libhal-storage/Makefile

config.status: creating doc/api/libhal-storage/version.xml

config.status: creating doc/spec/Makefile

config.status: creating doc/spec/hal-spec.xml.in

config.status: creating doc/man/Makefile

config.status: creating config.h

config.status: config.h is unchanged

config.status: executing depfiles commands

                    HAL 0.5.10

                  ==============

        prefix:                      /usr

        libdir:                      ${exec_prefix}/lib

        libexecdir:                  ${exec_prefix}/libexec

        bindir:                      ${exec_prefix}/bin

        sbindir:                     ${exec_prefix}/sbin

        datadir:                     ${datarootdir}

        sysconfdir:                  ${prefix}/etc

        localstatedir:               ${prefix}/var

        docdir:                      ${datarootdir}/doc/${PACKAGE_TARNAME}

        dbus-1 system.d dir:         /usr/etc/dbus-1/system.d/

        pci.ids dir:                 /usr/share/

        usb.ids dir:                 /usr/share/

        compiler:                    gcc

        cflags:                      -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare

        ldflags:                     -Wl,--as-needed

        cppflags:                   

        xmlto:                       no

    xmllint:                     /usr/bin/xmllint

        User for HAL:                haldaemon

        Group for HAL:               haldaemon

        hald pidfile:                ${prefix}/var/run/hald/pid

        hald socket dir:             ${prefix}/var/run/hald

        eject program:               /usr/bin/eject

        OS backend:                  linux

        use acpi kernel interface:   yes

        use acpid interface:         yes

        use libusb:                  yes

        use libpci:                  no

        use libparted:               no

        use gperf:                   no

        use PolicyKit:               no

        use ConsoleKit:              no

        use ACL management:          no

        use umount.hal helper:       no

        use ACPI:                    yes

        use PMU:                     yes

        use APM:                     yes

        use Sony PIC:                yes

        Macbook backlight support:   no (Linux only, x86 only, requires libpci)

        Macbook Pro utils:           no (Linux only, x86 only, requires libpci)

        OMAP utils:                  yes (Linux only, arm only)

        CPU frequency scaling:       no (Linux only)

        Re-map multimedia keys:      no (Linux only, requires gperf)

        Forward IBM ACPI events:     no (Linux only)

        Forward Toshiba ACPI events: no (Linux only)

    USB wireless mouse power:    no (Linux only, requires libusb)

    Dell Backlight:              no (Linux only, requires libsmbios >= 0.13.4)

        Maintainer mode:             no

        Building verbose mode:       yes

        Building api docs:           no

        Building docs:               no

        Building man pages:          yes

NOTE: building with verbose mode increases library size, may slightly

      increase security risk, and decreases performance.

NOTE: You have to install init scripts yourself and tweak your own policy

NOTE: Remember to create user haldaemon and group haldaemon before make install

NOTE: For development, use run-hald.sh and debug-hald.sh scripts in hald/ to

      use programs (callouts, probers, addons) and device information files

      from build directories. You may still need 'make install' to

      install the udev rule to receive events from udev.

and then make runs, and does its stuff.  But dies with several lines like:

gcc -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wl,--as-needed -o .libs/hald-probe-input probe-input.o logger.o  ../../../libhal/.libs/libhal.so -L/home/mark/freescale/src/ltib/rootfs/usr/lib -ldbus-1 -lusb /usr/lib/libusb.so

/usr/lib/libusb.so: file not recognized: File format not recognized

collect2: ld returned 1 exit status

make[5]: *** [hald-probe-serial] Error 1

I'm sure due to parallel make, there's several of these all complaining about /usr/lib/libusb.so.


I've dug into hal's configure and Makefile (and little into hal.spec), but for the life of me, I can't see how it picks up /usr/lib/libusb.so.  The valid (arm) one can be found from the -L and -l switches. Any idea on either how to get the extra libusb.so out of the gcc command, or at least why it ends up there?


0 Kudos
11 Replies

1,355 Views
PeterChan
NXP Employee
NXP Employee

I also got similar error while building the HAL library using LTIB for the i.MX50 gnome profile. The PC host is Ubuntu 10.04 and the BSP L2.6.35_MX508_ER_1104 (ER6). May I know how to resolve this error?

0 Kudos

1,355 Views
LeonardoSandova
Specialist I

Hi Peter,

have you tried the clean previous compilation and building again? move to the source code folder and type make clean, then build again. This has worked for me for the type of errors you are getting.

Leo

0 Kudos

1,355 Views
PeterChan
NXP Employee
NXP Employee

Hello Leo,

Thank you for your suggestion. I have tried it but no luck. I have even removed this folder "hal-0.5.10" and let ltib to extract and configure it again but still got the same error.

0 Kudos

1,355 Views
PeterChan
NXP Employee
NXP Employee

Finally, to workaround on this error I backup my original /usr/lib/libusb.so at my Ubuntu host machine, copy the target 's libusb.so from rootfs/usr/lib/libusb-0.1.4.4.0 to /usr/lib/libusb.so. Luckily it works!  (Please restore the original /usr/lib/libusb.so after build!)

It looks the "hal-0.5.10" is referring to the wrong path for the target's libusb.so, perhaps something goes wrong with the configure or build scripts. I don't have the knowledge to fix the error. Does anyone know how to fix this?

0 Kudos

1,355 Views
jimmychan
NXP TechSupport
NXP TechSupport

you can try to add "-L/<absolute path of the library>" for the additional library path. for example, if your ltib folder is in /home/lucid/ ,  "-L/home/lucid/ltib/rootfs/usr/lib/libusb.so".

0 Kudos

1,355 Views
PeterChan
NXP Employee
NXP Employee

Unfortunately, the makefile is auto-generated from the configure script and I don't know how to modify it : (

0 Kudos

1,355 Views
LeonardoSandova
Specialist I

Hi Pete,

Modify the Makefile, then create a patched recipe (spec) with the command

./ltib -p <package name> -m patchmerge

Now remove the rpm/BUILD/<package name>

and execute the ltib's triad prep-scbuild-scdeploy. That ltib way to patch autobuild tools and source code.

Leo

0 Kudos

1,355 Views
jimmychan
NXP TechSupport
NXP TechSupport

sorry, I typo, -L should link to a lib directory, not a file.

so please try to add the LDFLAGS in the configure like this.  ./configure  LDFLAGS="-L/home/lucid/ltib/rootfs/usr/lib"  .......

So you can modify the hal.spec file in ltib.

0 Kudos

1,356 Views
YixingKong
Senior Contributor IV

Mark, please click Correct Answer/Helpful Answer if your issue has been resolved.

Thanks,

Yixing

0 Kudos

1,356 Views
GraceH
Senior Contributor II

ltib will set the gcc compiler to correct version. If you don't use ltib to build, you need set the gcc to correct path.

you can try "ltib -m shell". In the shell, you can run "gcc -v", then you can see the gcc version like

gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20)

You can try to build the package in the shell with the script.

-Grace

0 Kudos

1,356 Views
marknordstrand
Contributor III

That helps.  But, my build environment has been subject to repeated changes, so I probably won't get a chance to really nail this down for a bit.  Current SWAG is autoconf/configure or how they're called....

0 Kudos