OpenWrt Forum Archive

Topic: OpenWRT SDK >> GPSD 1.10 >> C Compiler cannot create executables

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

I know the there is a .ipk for GPSD 2.30 but that version is not stable/compatible with Kismet so I need to build a .ipk using the GPSD 1.10 source

So, I read the Howto on building packages and I'm using the latest OpenWRT SDK. I downloaded the and modified as necessary the current GPSD Config.in , gpsd.control and Makefile

In the makefile I changed the
PKG_VERSION
PKG_MD5SUM
PKG_SOURCE_URL
lines as that's all that appeared to need changing.

I tried compiling and here's what happened

root@wd1:~/OpenWrt-SDK-Linux-i686-1# make clean && make compile
make[1]: Entering directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
rm -f /root/OpenWrt-SDK-Linux-i686-1/bin/packages/gpsd_1.10-1_mipsel.ipk
rm -rf \
        /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include/gps{,d}.h \
        /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include/libgpsmm.h \
        /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib/libgps.{a,so*} \

rm -rf /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10
make[1]: Leaving directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
rm -rf /root/OpenWrt-SDK-Linux-i686-1/build_mipsel
rm -rf bin
mkdir -p /root/OpenWrt-SDK-Linux-i686-1/build_mipsel
mkdir -p /root/OpenWrt-SDK-Linux-i686-1/dl
make[1]: Entering directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
rm -rf /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10
mkdir -p /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10
zcat /root/OpenWrt-SDK-Linux-i686-1/dl/gpsd-1.10.tar.gz | tar -C /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/.. -xf -
if [ -d ./patches ]; then \
        /root/OpenWrt-SDK-Linux-i686-1/scripts/patch-kernel.sh /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10 ./patches ; \
fi

Applying ./patches/* using plaintext:
cat: ./patches/*: No such file or directory
touch /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/.prepared
make[1]: Leaving directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
make[1]: Entering directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
/root/OpenWrt-SDK-Linux-i686-1/scripts/make-ipkg-dir.sh /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/ipkg/gpsd ./ipkg/gpsd.control 1.10-1 mipsel
if [ "" != "" ]; then echo "Depends: " >> /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/ipkg/gpsd/CONTROL/control; fi
for file in conffiles preinst postinst prerm postrm; do [ -f ./ipkg/gpsd.$file ] && cp ./ipkg/gpsd.$file /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/ipkg/gpsd/CONTROL/$file || true; done
( cd /root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10; rm -rf config.{cache,status}; \
        PATH=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/bin:/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin:/bin:/sbin:/usr/bin:/usr/sbin AR=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-ar AS=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-as LD=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-ld NM=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-nm CC=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc GCC=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc CXX=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-g++ RANLIB=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-ranlib \
        CFLAGS="-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time " \
        CXXFLAGS="-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time  -fno-builtin -fno-rtti -nostdinc++"  \
        CPPFLAGS="-I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include" \
        LDFLAGS="-nodefaultlibs -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/lib" \
        LIBS="-luClibc++ -lc -lm -lnotimpl" \
        ./configure \
                --target=mipsel-linux \
                --host=mipsel-linux \
                --build=i386-pc-linux-gnu \
                --program-prefix="" \
                --program-suffix="" \
                --prefix=/usr \
                --exec-prefix=/usr \
                --bindir=/usr/bin \
                --datadir=/usr/share \
                --includedir=/usr/include \
                --infodir=/usr/share/info \
                --libdir=/usr/lib \
                --libexecdir=/usr/lib \
                --localstatedir=/var \
                --mandir=/usr/share/man \
                --sbindir=/usr/sbin \
                --sysconfdir=/etc \
                 \
                --disable-nls \
                --enable-shared \
                --enable-static \
                --with-gnu-ld \
);
checking for a BSD-compatible install... /usr/bin/install -c
checking for mipsel-linux-gcc... /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [/root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/.configured] Error 77
make[1]: Leaving directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
make: *** [gpsd-compile] Error 2
root@wd1:~/OpenWrt-SDK-Linux-i686-1#

Here is the config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.57.  Invocation command line was

  $ ./configure --target=mipsel-linux --host=mipsel-linux --build=i386-pc-linux-gnu --program-prefix= --program-suffix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --datadir=/usr/share --includedir=/usr/include --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --sbindir=/usr/sbin --sysconfdir=/etc --disable-nls --enable-shared --enable-static --with-gnu-ld

## --------- ##
## Platform. ##
## --------- ##

hostname = wd1
uname -m = i686
uname -r = 2.6.12-112505729
uname -s = Linux
uname -v = #1 Fri Nov 25 11:59:41 EST 2005

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = i686
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/bin
PATH: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin
PATH: /bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1312: checking for a BSD-compatible install
configure:1366: result: /usr/bin/install -c
configure:1386: checking for mipsel-linux-gcc
configure:1412: result: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc
configure:1694: checking for C compiler version
configure:1697: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc --version </dev/null >&5
mipsel-linux-uclibc-gcc (GCC) 3.4.4
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1700: $? = 0
configure:1702: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -v </dev/null >&5
Reading specs from /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/../lib/gcc/mipsel-linux-uclibc/3.4.4/specs
Configured with: /home/wbx/rc4/openwrt/branches/whiterussian/openwrt/toolchain_build_mipsel/gcc-3.4.4/configure --prefix=/home/wbx/rc4/openwrt/branches/whiterussian/openwrt/staging_dir_mipsel --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mipsel-linux-uclibc --enable-languages=c,c++ --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls
Thread model: posix
gcc version 3.4.4
configure:1705: $? = 0
configure:1707: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -V </dev/null >&5
mipsel-linux-uclibc-gcc: `-V' option must have argument
configure:1710: $? = 1
configure:1734: checking for C compiler default output
configure:1737: /root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time  -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include -nodefaultlibs -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/lib conftest.c -luClibc++ -lc -lm -lnotimpl >&5
/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/../lib/gcc/mipsel-linux-uclibc/3.4.4/../../../../mipsel-linux-uclibc/bin/ld: cannot find -lnotimpl
collect2: ld returned 1 exit status
configure:1740: $? = 1
configure: failed program was:
| #line 1713 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:1779: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time '
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-nodefaultlibs -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/lib'
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i386-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=mipsel-linux
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=mipsel-linux
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_CC=/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

CC='/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc'
CFLAGS='-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time '
CPP=''
CPPFLAGS='-I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDFLAGS='-nodefaultlibs -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -L/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/lib'
LIBC=''
LIBGEN=''
LIBM=''
LIBNSL=''
LIBOBJS=''
LIBS='-luClibc++ -lc -lm -lnotimpl'
LIBSOCKET=''
LTLIBOBJS=''
MISSING_MOTIF=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SHELL='/bin/sh'
X11_LIBS=''
XAW_LIBS=''
XEXT_LIBS=''
XM_LIBS=''
XPM_LIBS=''
XP_LIBS=''
XT_LIBS=''
X_CFLAGS=''
X_EXTRA_LIBS=''
X_LIBS=''
X_PRE_LIBS=''
ac_ct_CC=''
bindir='/usr/bin'
build_alias='i386-pc-linux-gnu'
datadir='/usr/share'
exec_prefix='/usr'
host_alias='mipsel-linux'
includedir='/usr/include'
infodir='/usr/share/info'
libdir='/usr/lib'
libexecdir='/usr/lib'
localstatedir='/var'
mandir='/usr/share/man'
oldincludedir='/usr/include'
prefix='/usr'
program_transform_name='s,x,x,'
sbindir='/usr/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='/etc'
target_alias='mipsel-linux'

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""

configure: exit 77

I running Ubuntu Linux 5.10 and I'm assuming that I'm just missing a package or it's a configuration issue.

I hate to have to bump this but I'm still banging my head against a wall trying to get this error resolved. ANY help would be appreciated. No-one has a clue what's going on here?

Remove this check from the configure script. A lot of configure scripts are broken for cross-compiling...

Thank you. I'm one step closer. It made it alot further in  the compile. I'm now off to track down the cause of
impossible constraint in 'asm' error.

By "not stable" do you mean that kismet keeps saying "Lost GPS signal", "Acquired GPS signal"? I had the same issue, it might be because of a mode that gpsd initializes the receiver in, but I didn't look into it further because gpsd 2.09 has always worked for me (on laptop previously), so just change PKG_VERSION to 2.09, wget the tarball and md5sum, make package/gpsd-install, should work.
But if that version doesn't work for you either, try running the NMEA commands from kismet's gpsd.cc manually through gpsd using nc localhost 2947 (or just add some debugging to the code) and see where it's failing.

waddler wrote:

By "not stable" do you mean that kismet keeps saying "Lost GPS signal", "Acquired GPS signal"? I had the same issue, it might be because of a mode that gpsd initializes the receiver in, but I didn't look into it further because gpsd 2.09 has always worked for me (on laptop previously), so just change PKG_VERSION to 2.09, wget the tarball and md5sum, make package/gpsd-install, should work.
But if that version doesn't work for you either, try running the NMEA commands from kismet's gpsd.cc manually through gpsd using nc localhost 2947 (or just add some debugging to the code) and see where it's failing.

This is strange.T his was compiling for me direct from svn as of as recently as last week. Working with kismet as well. The gpsd package within kamikaze hasnt' changed since 10/31/05. Did something in one of the dependancies change?

Actually I was having the lost/acquired problem, but I attributed that to having the GPS indoors not to gpsd itself.

(Last edited by whm3 on 19 Jan 2006, 16:27)

The current release of Kismet ( not newcore) does not support the 2.x version of GPSD due to the autobauding code in GPSD. It causes the lost/acquired issue as well as other issues (driving at 70mph displays only 20mph through kismet). Dragorn has completely re-worked this in the newcore release and it will support GPSD 2.x. There's rumors that GPSD may not be needed an kismet will talk directly to a GPS device.

I've had issues with GPSD 2.30

Anyway, I've been unable to even get the 2.30 version to compile using the SDK on my laptop due to assembler unrecognized opcodes. I'm trying to get a cross compiler working now and then maybe get kismet newcore cross-compiled for the WRT otherwise it's back to getting 1.10 to work.

current errors using the SDK to compile GPSD 1.10

make[2]: Entering directory `/root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10'
/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -I/root/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include -DHAVE_CONFIG_H -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time  -Wall -Werror -c -I. -I/usr/X11R6/include  -I/usr/include -o gpsd.o gpsd.c
gpsd.c: In function `send_nmea':
gpsd.c:577: error: impossible constraint in `asm'
{standard input}: Assembler messages:
{standard input}:474: Error: unrecognized opcode `btrl $2,0($4)'
{standard input}:478: Error: unrecognized opcode `btrl $2,0($3)'
make[2]: *** [gpsd.o] Error 1
make[2]: Leaving directory `/root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10'
make[1]: *** [/root/OpenWrt-SDK-Linux-i686-1/build_mipsel/gpsd-1.10/.built] Error 2
make[1]: Leaving directory `/root/OpenWrt-SDK-Linux-i686-1/package/gpsd'
make: *** [gpsd-compile] Error 2

(Last edited by beakmyn on 19 Jan 2006, 20:02)

In case other have issues here's the solution

replace
-I/usr/include
with
-I/home/user/trunk/openwrt/staging_dir_mipsel/usr/include

This can be done with the use of CFLAGS and CPPFLAGS (consult your source ./configure --help

otherwise you can search and replace in the the Makefile

The discussion might have continued from here.