搜尋此網誌

Check Sharelibrary usage for embedded system application





host (x86) 機器上, 使用 arm-linux-readelf -d $target_prog 來查某個目的程式缺什麼庫。
target(arm)機器上,使用 /lib/ld.so.2 --list $prog   列出該 prog 所需的依賴庫。

OpenWrt CCmake linker error (half fixed)

   When build openwrt from trunk 2012/9/26 . i found on one of Linux host
build Cmake always fail , check the configure difference between success linux host,i found is install QT or not.

     But after google for a long time, i can only disable one of the Cmake feature to fix this temporary.

       find CMakeCache.txt edit follow build option from  the

BUILD_CursesDialog:BOOL=ON
   
to

BUILD_CursesDialog:BOOL=OFF

             Ok, don't clean the Cmake package on openwrt, continue build
  make V=s ....

OpenWRT build order change how to

 
          For a openwrt user/development, the build sequence(order) is very important, here i will show you how to change the build order without change your package name :

     First open your package's Makefile , and quicky find the setion:

####################################
define Package/build_order_test_package

endef
#####################################

     please add DEPENDS:= key word.
then decide which should build before your package build

     for example , i want librt build before my build_order_test_package build .

define Package/build_order_test_package
  DEPENDS:=  librt 
endef
         Ok ,after finished the modification of the Makefile.
  please do make menuconfig again .

           make menuconfig ARCH=xxx V=s

      Now just type

              make V=s 

         and  check the build log now ,
     you'll  find the librt will  build before your package been build.
   







 
   


openwrt tool cmake build fail due to lacking /lib/libtinfo.so.5

  
         The cmake make file friendly tell us to add /lib/libtinfo.so.5 into linker command line, but it's didn't
   tell us how in detail.

          I spent a lot of time to figure out it, try follow :

            just export LDFLAGS="-ltinfo"; before you run cmake bootstrap shell script.
     so, it would look like this:

                   export LDFLAGS="-ltinfo"; ./bootstrap; make ;make install.

         on openwrt build root :

       add overlap build target on tools/cmake/Makefile:

define Host/Configure

echo "####################### overlap host configure ###################"
cd $(HOST_BUILD_DIR) && LibArchive_LIBRARY=libtinfo.so.5 LibArchive_INCLUDE_DIR=/lib export LDFLAGS="-ltinfo"; \
./bootstrap --system-libs --no-system-zlib --system-bzip2 --no-qt-gui --no-system-libarchive \
--prefix=$(STAGING_DIR_HOST) --docdir=$(STAGING_DIR_HOST)/doc --mandir=$(STAGING_DIR_HOST)/man
endef

Add private patch build when OPENWRT library dependence build fail

    1. Open your package/Makefile

       add for build opkg ,opkg/host and ncurse
#++++++++++++++++++++++++++++++++++
define Build/Compile/library
    @echo "**************************************************************************"
    @echo "************************ Build VOIP Required Library  ********************"
    @echo "**************************************************************************"
    sleep 3; \
    cd $(TOPDIR) && make package/opkg/install V=s; \
    cd $(TOPDIR) && make package/opkg/host/install V=s; \
    cd $(TOPDIR) && make package/ncurse/install V=99
endef
#++++++++++++++++++++++++++++++++++++

     2. Put our private define on OPENWRT standard package compile build flow

define Build/Compile
    $(call Build/Compile/library)  # Insert call our private compile make target.
   $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins
    $(MAKE) -C $(PKG_BUILD_DIR) \
        DESTDIR="$(PKG_INSTALL_DIR)" \
        SHELL="/bin/bash" \
        all
endef