OpenWrt Forum Archive

Topic: strange runtime errors with new package

The content of this topic has been archived on 7 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am porting the gigaset isdn driver and frontend to openwrt. The packages are compiling but when running the frontend application on a testing system in VMware with newest svn kamikaze version I get the following error.

root@OpenWrt:/usr/lib# gigacontr 
/usr/sbin/gigacontr: line 6: �a1h�a2p�a3x�a4��a5H�������=H���5ʰ!�%̰!@�%ʰ!h������%°!h������%��!h������%��!h������%��!h������%��!h������%��!h������%��!h�p����%��!�: not found
/usr/sbin/gigacontr: line 6: @@@@@@@@��@@@@����: not found
/usr/sbin/gigacontr: line 6: ELF: not found
/usr/sbin/gigacontr: line 7: syntax error: ")" unexpected

It also creates in the current directory an empty file named: �ah�ap�ax�a��a�a��a��a��a��a��a��a��a��a��a��a

Does someone have any idea how to solve this error?

gigacontr seems to be a script, but made for the bash shell or some other kind. OpenWRT uses ash from busybox. You have to port the script to busybox/ash.

Strange.  I have encountered this on AR7 and other MIPS-based devices when you are trying to run a binary compiled using OpenWrt's buildroot on the standard firmware.

The standard firmware for the devices where I've seen or heard of this happening have a uClibc compiled for MIPS-I.  OpenWrt's uClibc is not compiled for MIPS-I, and when you link a binary against it and try to run it on the standard firmware, this is the sort of problem you get.

Not sure how this happens on VMware.

I can't seem to get to www.linux-mips.org at the moment, but here are some Google-cached mailing list posts that might give you a hint about what's wrong with the binary you are trying to run, even if they don't tell you how it happened.

EDIT: I can get to www.linux-mips.org now, so I've updated the links.

http://www.linux-mips.org/archives/linu … 00058.html
http://www.linux-mips.org/archives/linu … 00061.html
http://www.linux-mips.org/archives/linu … 00062.html

i.e. run "readelf" on a working binary and the broken one and see what the differences are.

(Last edited by Wodin on 4 Jun 2008, 20:38)

I think the problem is that the package isn't compiled with the cross compiler but with the system compiler (x86_64) . Executing the binary build for openWRT on my x86_64 System is no problem, but executing it on a x86 system isn't working. It says "cannot execute binary file"

LOL. Cross-compile using the OpenWrt build-system and it should work. Easiest to do cross-compilation is creating or adapting an existing OpenWrt package Makefile for your own package.

(Last edited by forum2008 on 7 Jun 2008, 18:39)

This is the Makefile:

include $(TOPDIR)/rules.mk

PKG_NAME:=gigaset-frontend
PKG_VERSION:=0.5.3
PKG_RELEASE:=1

PKG_SOURCE:=gigaset-frontend-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/gigaset307x
PKG_MD5SUM:=2a494f9a68c07c0d7eb57fe248e4013e

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install


include $(INCLUDE_DIR)/package.mk

define Package/gigaset-frontend
  SECTION:=base
  DEPENDS:=+kmod-gigaset +libexpat
  CATEGORY:=Network
  TITLE:=Siemens GigaSet 307x isdn frontend
  URL:=http://gigaset307x.sourceforge.net/
endef

define Package/gigaset-frontend/description
 The Gigaset 3070 isdn (aka Sinus 45 isdn) and its descendants
 are ISDN DECT base stations allowing the connection of a PC via USB or DECT.
 This project is developing the Linux support (drivers and frontend utilities)
 which Siemens neglected to provide.
endef

define Build/Configure
    $(CP) ./files/Makefile.config $(PKG_BUILD_DIR)/Makefile.config
endef

CONFIGURE_ARGS += \
    --without-qt \
    --without-qtlibs \
    --without-expat \

define Build/Compile
    $(MAKE) -C $(PKG_BUILD_DIR) \
    DESTDIR="$(PKG_INSTALL_DIR)" \
        all install
endef

define Package/gigaset-frontend/install
    $(INSTALL_DIR) $(1)/usr/sbin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gigacontr $(1)/usr/sbin/
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gigaconf $(1)/usr/sbin/
endef
  
$(eval $(call BuildPackage,gigaset-frontend))

The full package can be downloaded at:
http://hauke-m.de/fileadmin/openwrt/gig … end.tar.gz
http://hauke-m.de/fileadmin/openwrt/gig … ver.tar.gz
http://hauke-m.de/fileadmin/openwrt/isdn4linux.tar.gz
All packages need some clean up.

I looked at the binary file generated for x86 with cat and in the file there is: "/lib64/ld-linux-x86-64.so.2"

(Last edited by Hauke on 7 Jun 2008, 18:52)

The discussion might have continued from here.