OpenWrt Forum Archive

Topic: ./helloworld: line 1: syntax error: unexpected ")"

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

Hello Friends ,

     I m having some problem while making my own package ... i started with simple package helloworld but when i installed it on my router i get the following error

root@OpenWrt:/bin# ./helloworld
./helloworld: line 1: syntax error: unexpected ")"


Also, when i was installing i didn't get Successfully terminated i.e
root@OpenWrt:/bin# opkg install helloworld_1_ar71xx.ipk
Installing helloworld (1) to root...
Configuring helloworld.

(I think i should get successfully terminated after configuring helloworld )


My router model of TP-LINK is "TL-WR941ND"  and i m using Backfire 10.03.1

I m using fedora 16
uname -a
Linux localhost.localdomain 3.1.0-7.fc16.i686.PAE #1 SMP Tue Nov 1 20:53:45 UTC 2011 i686 i686 i386 GNU/Linux


I m also attaching Makefile of cross compiling helloworld.c and Makefile for compiling c file
  package/helloworld/Makefile

include $(TOPDIR)/rules.mk

PKG_NAME := helloworld
PKG_RELEASE := 1

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/helloworld
        SECTION := utils
        CATEGORY := Utilities
        TITLE := Helloworld program
endef

#define Package/helloworld/description
#       it is a helloworld.
#endef

define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) ./src/* $(PKG_BUILD_DIR)/
endef


package/helloworld/src/helloworld.c

#include <stdio.h>

int main(void)
{
        printf("Hello World ");
        return 0;
}

package/helloworld/src/Makefile

helloworld: helloworld.o
        $(CC) $(LDFLAGS) helloworld.o -o helloworld
helloworld.o: helloworld.c
        $(CC) $(CFLAGS) -c helloworld.c

clean:
        rm *.o helloworld

Thank You

(Last edited by salmanhaider5 on 26 Apr 2013, 22:49)

It looks like you program was built for other platform, i.e. host platform. The reason simply perhaps OpenWRT doesn't know what CC is. So, you may have to tell OpenWRT what CC is. Try to insert the following lines into the Makefile for OpenWRT helloworld package, i.e. perhaps right after the package description section.

CONFIGURE_VARS+= \
        CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)"

(Last edited by mazilo on 27 Apr 2013, 00:09)

I think the `./helloworld` executed in OpenWrt is not actually a compiled program. Check the file with `file /bin/helloworld`.

Looks like the package Makefile missed a Package/helloworld/install section. Maybe there should also exists something like

$($(eval $(call BuildPackage,helloworld)))

(Last edited by yousong on 27 Apr 2013, 02:55)

mazilo wrote:

It looks like you program was built for other platform, i.e. host platform. The reason simply perhaps OpenWRT doesn't know what CC is. So, you may have to tell OpenWRT what CC is. Try to insert the following lines into the Makefile for OpenWRT helloworld package, i.e. perhaps right after the package description section.

CONFIGURE_VARS+= \
        CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)"


Still getting the same problem let me share my make V=99 so maybe you can identify the problem

make V=99
Collecting package info: done
Collecting target info: done
Checking 'non-root'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'flex'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
make[1]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[2]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[3]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/helloworld'
mkdir -p /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld
cp -fpR ./src/* /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/.prepared_ddea40bfb90e4c766dc06550219de3f6
(cd /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/./; if [ -x ./configure ]; then /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ -name config.guess | xargs -r chmod u+w; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ -name config.guess | xargs -r -n1 cp /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/scripts/config.guess; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ -name config.sub | xargs -r chmod u+w; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ -name config.sub | xargs -r -n1 cp /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/scripts/config.sub; AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CPPFLAGS="-I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib "  CC="/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/bin/mips-openwrt-linux-uclibc-gcc"  ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=i686-redhat-linux --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   ; fi; )
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/.configured_
make -C /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld
make[4]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld'
cc  -c helloworld.c
cc  helloworld.o -o helloworld
make[4]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld'
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/.built
rm -rf /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld
mkdir -p /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL
echo "Package: helloworld" > /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL/control
echo "Version: 1" >> /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL/control
( DEPENDS=''; for depend in ; do DEPENDS=${DEPENDS:+$DEPENDS, }${depend##+}; done; echo "Depends: $DEPENDS"; echo "Provides: "; echo "Source: package/helloworld"; echo "Section: utils"; echo "Status: unknown ok not-installed"; echo "Essential: no"; echo "Priority: optional"; echo "Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>"; echo "Architecture: ar71xx"; echo "Installed-Size: 0"; echo -n "Description: "; getvar V_Package_helloworld_description | sed -e 's,^[[:space:]]*, ,g'; ) >> /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL/control
chmod 644 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL/control
(cd /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/CONTROL;  )
install -d -m0755 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/bin
install -m0755 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/helloworld /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/bin/
mkdir -p /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/bin/ar71xx/packages
find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld -name 'CVS' -o -name '.svn' -o -name '.#*' | xargs -r rm -rf
NM="mips-openwrt-linux-uclibc-nm" STRIP="/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/sstrip" STRIP_KMOD="mips-openwrt-linux-uclibc-strip --strip-unneeded --remove-section=.comment --remove-section=.pdr --remove-section=.mdebug.abi32" /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/scripts/rstrip.sh /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld
rstrip.sh: /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld/bin/helloworld:executable
ipkg-build -c -o 0 -g 0 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/bin/ar71xx/packages
Packaged contents of /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/ipkg-ar71xx/helloworld into /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/bin/ar71xx/packages/helloworld_1_ar71xx.ipk
rm -rf /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld
mkdir -p /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/stamp /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld
install -d -m0755 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld/bin
install -m0755 /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld/helloworld /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld/bin/
cp -fpR /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld/. /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/
rm -rf /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/tmp-helloworld
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/root-ar71xx/stamp/.helloworld_installed
make[3]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/helloworld'
make[2]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[2]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
Generating index for package ./helloworld_1_ar71xx.ipk
make[2]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[1]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'


Please let me know if you know something more about this problem

You did not cross compile your code but rather compiled it using your host C compiler. If you want, try my OpenWRT feeds/packages/util/helloworld/Makefile for a helloworld package as shown below. You will need to save this Makefile under your FEEDS' packages/util/helloworld directory. You will also need to create a dl/helloworld-1.0.0.tar.xz package which contains your helloworld-1.0.0/Makefile and helloworld-1.0.0/helloworld.c files. You can use any compressed format for your tar helloworld-1.0.0 package. Just make sure the PKG_SOURCE name reflects to the compressed format used.

include $(TOPDIR)/rules.mk

PKG_NAME:=helloworld
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)    
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=$(PKG_NAME)
endef

define Package/$(PKG_NAME)/description
    This is a hello world package that contains a program to only print "hello world".
endef

CONFIGURE_VARS+= \
    CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)"

define Package/$(PKG_NAME)/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin
endef

$(eval $(call BuildPackage,$(PKG_NAME)))

(Last edited by mazilo on 27 Apr 2013, 12:19)

Thank you ,,, but can you please more explain what do you mean by FEEDS ? do i have to manually create the directory ?

Here is feeds. Probably, you don't have to worry about it since you use the OpenWRT SDK.

(Last edited by mazilo on 29 Apr 2013, 00:14)

Checking 'non-root'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'flex'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Collecting package info: done
Collecting target info: done
make[1] dirclean
[syed@localhost OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1]$ make V=99
Collecting package info: done
Collecting target info: done
Checking 'non-root'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'flex'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
make[1]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[2]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[3]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/helloworld'
gzip -dc /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/dl/helloworld-1.0.0.tar.gz | /bin/gtar -C /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/.. -xf -
ls: cannot access ./patches: No such file or directory
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/.prepared_e93b27fb701e3ef21bd06aa92f8551cd
(cd /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/./; if [ -x ./configure ]; then /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/ -name config.guess | xargs -r chmod u+w; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/ -name config.guess | xargs -r -n1 cp /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/scripts/config.guess; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/ -name config.sub | xargs -r chmod u+w; /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/bin/find /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/ -name config.sub | xargs -r -n1 cp /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/scripts/config.sub; AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CPPFLAGS="-I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib "  CC="/bin/"  ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=i686-redhat-linux --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   ; fi; )
touch /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/.configured_
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib " make -C /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[4]: Entering directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0'
mips-openwrt-linux-uclibc-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include  -c helloworld.c
mips-openwrt-linux-uclibc-gcc -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib  helloworld.o -o helloworld
/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: warning: ld-uClibc.so.0, needed by /home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so, not found (try using -rpath or -rpath-link)
/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so: undefined reference to `_dl_app_init_array'
/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so: undefined reference to `_dl_loaded_modules'
/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so: undefined reference to `_dl_app_fini_array'
collect2: ld returned 1 exit status
make[4]: *** [helloworld] Error 1
make[4]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0'
make[3]: *** [/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/helloworld-1.0.0/.built] Error 2
make[3]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/helloworld'
make[2]: *** [package/helloworld/compile] Error 2
make[2]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[1]: *** [/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/syed/Documents/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make: *** [world] Error 2


Now i m having these errors

how to cross compile our code rather then compiling it using your host C compiler?

The discussion might have continued from here.