2

I am using National Instruments hardware cRIO 9068 with Linux-Realtime installed on the machine. From what I understand it is an embedded flavor of Linux using the opkg package manager. As is the case I need some software that is not available on opkg.

I have been trying to compile the source code for freeTDS and unixODBC drivers for use in a Linux system to talk to a Microsoft SQL Server. However when following the typical ./configure to set it up I get these errors for unixODBC:

checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) awk
checking for bison... bison -y
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/admin/sqlFiles/unixODBC-2.3.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

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 unixODBC configure 2.3.2-pre, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ./configure 

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

hostname = NI-cRIO-9068-193EAD1
uname -m = armv7l
uname -r = 3.2.35-rt52-2.0.0f0
uname -s = Linux
uname -v = #1 SMP PREEMPT RT Tue Jun 3 20:49:19 CDT 2014

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

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

PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/natinst/bin


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

configure:2623: checking for a BSD-compatible install
configure:2691: result: ./install-sh -c
configure:2702: checking whether build environment is sane
configure:2752: result: yes
configure:2893: checking for a thread-safe mkdir -p
configure:2932: result: ./install-sh -c -d
configure:2945: checking for gawk
configure:2975: result: no
configure:2945: checking for mawk
configure:2975: result: no
configure:2945: checking for nawk
configure:2975: result: no
configure:2945: checking for awk
configure:2961: found /usr/bin/awk
configure:2972: result: awk
configure:2983: checking whether make sets $(MAKE)
configure:3005: result: yes
configure:3090: checking for gawk
configure:3117: result: awk
configure:3132: checking for bison
configure:3148: found /usr/bin/bison
configure:3159: result: bison -y
configure:3183: checking for style of include used by make
configure:3211: result: GNU
configure:3282: checking for gcc
configure:3298: found /usr/bin/gcc
configure:3309: result: gcc
configure:3538: checking for C compiler version
configure:3547: gcc --version >&5
gcc (GCC) 4.7.2
Copyright (C) 2012 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:3558: $? = 0
configure:3547: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/gcc/arm-nilrt-linux-gnueabi/4.7.2/lto-wrapper
Target: arm-nilrt-linux-gnueabi
Configured with: /home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/work-shared/gcc-4.7.2-r20/gcc-4.7.2/configure --build=x86_64-linux --host=arm-nilrt-linux-gnueabi --target=arm-nilrt-linux-gnueabi --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib/gcc --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-nilrt-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-sysroot=/ --with-build-sysroot=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq --with-native-system-header-dir=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq/usr/include --with-gxx-include-dir=/usr/include/c++/ --enable-nls
Thread model: posix
gcc version 4.7.2 (GCC) 
configure:3558: $? = 0
configure:3547: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3558: $? = 1
configure:3547: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3558: $? = 1
configure:3578: checking whether the C compiler works
configure:3600: gcc    conftest.c  >&5
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
configure:3604: $? = 1
configure:3642: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "unixODBC"
| #define PACKAGE_TARNAME "unixodbc"
| #define PACKAGE_VERSION "2.3.2-pre"
| #define PACKAGE_STRING "unixODBC 2.3.2-pre"
| #define PACKAGE_BUGREPORT "nick@unixodbc.org "
| #define PACKAGE_URL ""
| #define PACKAGE "unixODBC"
| #define VERSION "2.3.2"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3647: error: in `/home/admin/sqlFiles/unixODBC-2.3.2':
configure:3649: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_AWK=awk
ac_cv_prog_YACC='bison -y'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

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

ACLOCAL='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run aclocal-1.11'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AR=''
ARGZ_H=''
AS=''
AUTOCONF='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run autoconf'
AUTOHEADER='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run autoheader'
AUTOMAKE='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run automake-1.11'
AWK='awk'
BIN_PREFIX=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CONVENIENCE_LTDL_FALSE=''
CONVENIENCE_LTDL_TRUE=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFLIB_PATH=''
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
DRIVERC_FALSE=''
DRIVERC_TRUE=''
DRIVERS_FALSE=''
DRIVERS_TRUE=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEC_PREFIX=''
EXEEXT=''
FGREP=''
GREP=''
HAVE_FLEX_FALSE=''
HAVE_FLEX_TRUE=''
ICONV_CHAR_ENCODING=''
ICONV_UNICODE_ENCODING=''
INCLTDL=''
INCLUDE_PREFIX=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_LTDL_FALSE=''
INSTALL_LTDL_TRUE=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LFLAGS=''
LIBADD_CRYPT=''
LIBADD_DL=''
LIBADD_DLD_LINK=''
LIBADD_DLOPEN=''
LIBADD_POW=''
LIBADD_SHL_LOAD=''
LIBICONV=''
LIBLTDL=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIB_PREFIX=''
LIB_VERSION=''
LIPO=''
LN_S=''
LTDLDEPS=''
LTDLINCL=''
LTDLOPEN=''
LTLIBOBJS=''
LT_CONFIG_H=''
LT_DLLOADERS=''
LT_DLPREOPEN=''
MAKEINFO='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run makeinfo'
MANIFEST_TOOL=''
MKDIR_P='./install-sh -c -d'
MSQL_FALSE=''
MSQL_TRUE=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='unixODBC'
PACKAGE_BUGREPORT='nick@unixodbc.org '
PACKAGE_NAME='unixODBC'
PACKAGE_STRING='unixODBC 2.3.2-pre'
PACKAGE_TARNAME='unixodbc'
PACKAGE_URL=''
PACKAGE_VERSION='2.3.2-pre'
PATH_SEPARATOR=':'
PREFIX=''
PTH_CFLAGS=''
PTH_CPPFLAGS=''
PTH_LDFLAGS=''
PTH_LIBS=''
QNX_FALSE=''
QNX_TRUE=''
RANLIB=''
READLINE=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SHLIBEXT=''
STRIP=''
SYSTEM_FILE_PATH=''
SYSTEM_LIB_PATH=''
VERSION='2.3.2'
WITHLT_FALSE=''
WITHLT_TRUE=''
YACC='bison -y'
YFLAGS=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
ltdl_LIBOBJS=''
ltdl_LTLIBOBJS=''
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/./install-sh -c -d'
msql_headers=''
msql_libraries=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sys_symbol_underscore=''
sysconfdir='${prefix}/etc'
target_alias=''

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

/* confdefs.h */
#define PACKAGE_NAME "unixODBC"
#define PACKAGE_TARNAME "unixodbc"
#define PACKAGE_VERSION "2.3.2-pre"
#define PACKAGE_STRING "unixODBC 2.3.2-pre"
#define PACKAGE_BUGREPORT "nick@unixodbc.org "
#define PACKAGE_URL ""
#define PACKAGE "unixODBC"
#define VERSION "2.3.2"

configure: exit 77

Been stuck on this one for some time now, hoping the good people on this website can help me with my issue.

Thanks, Adam

adamxyzgg
  • 51
  • 1
  • 4
  • I'd suggest you try building a trivial hello world program directly invoking gcc, as the error message makes it sound like you have an incomplete compiler install. A lot of linux distros actually ship that way, where `which gcc` will give an answer, but it cannot actually build programs. You typically have to install a particular package to build things, for example on a debian derived distro you need build essential. – Chris Stratton Oct 24 '14 at 18:10
  • 1
    After a little more digging, that seems to be the case. I could not compile a simple hello world program, which lead me to believe the compiler was bust. I ran "opkg install gnupg-dev" and everything started working. Thanks for the help guys. – adamxyzgg Oct 24 '14 at 19:34
  • The code the congigure script is compiling is even simpler that "hello world" - its am empty main() function. – Clifford Oct 24 '14 at 19:41

3 Answers3

1

You are compiling the code for quite an unusual platform. Although the auto-tools try their best to do a decent job of configuring the software, in this case your system and toolchain are too exotic.

Unfortunately you are on your own on this one. Your best bet is to generate the Makefiles on a normal linux computer and then use this as the start of your platform port.

doron
  • 27,972
  • 12
  • 65
  • 103
0

The critical part of the log is these two lines:

/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find crtbegin.o: No such file or directory

/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find -lgcc

The C runtime start-up code (crtbegin.o) and libgcc.a are linked by default for any gcc invocation. It appears that they are either missing or in an unexpected location, or that the location is not defined.

I am no autotools expert (or Linux for that matter), but it seems odd that the "configured with" line says: --exec_prefix=/usr, then later the log shows exec_prefix='NONE', The path that the linker used for these files by default is ${exec_prefix}/lib/gcc I believe.

There are a number of environment variables that affect GCC, you may need to explicitly set some of these; in particular GCC_EXEC_PREFIX and perhaps LIBRARY_PATH.

Clifford
  • 88,407
  • 13
  • 85
  • 165
0

I believe the problem here is that the autoconf generated configure script does tests to see whether things can be built. However, the compiler you are using (arm-nilrt-linux-gnueabi-gcc) does not support the -qversion option, or the -V option, so compilation fails in these tests. To avoid this you can hack the configure script, like in the answer to this question. There may be better ways to solve this.

crobar
  • 2,810
  • 4
  • 28
  • 46