LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   c compiler cannot create executables (https://www.linuxquestions.org/questions/slackware-14/c-compiler-cannot-create-executables-368343/)

karphead 09-30-2005 12:00 AM

c compiler cannot create executables
 
Trying to install proftpd 1.2.10. Running ./configure gives me this:

Code:

> ./configure                     
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.


Here's the config.log:

Code:

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

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

hostname = Pupshaw
uname -m = i686
uname -r = 2.6.11
uname -s = Linux
uname -v = #1 SMP Sun Mar 13 05:38:01 PST 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/.bin
PATH: /root/Muse
PATH: /sbin
PATH: /usr/sbin
PATH: /bin
PATH: /usr/bin
PATH: /etc
PATH: /usr/ucb
PATH: /local/bin
PATH: /usr/local/bin
PATH: /usr/X11R6/bin
PATH: /opt/bin/


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

configure:1397: checking build system type
configure:1415: result: i686-pc-linux-gnu
configure:1423: checking host system type
configure:1437: result: i686-pc-linux-gnu
configure:1445: checking target system type
configure:1459: result: i686-pc-linux-gnu
configure:1533: checking for gcc
configure:1549: found /usr/bin/gcc
configure:1559: result: gcc
configure:1803: checking for C compiler version
configure:1806: gcc --version </dev/null >&5
gcc (GCC) 3.3.6
Copyright (C) 2003 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:1809: $? = 0
configure:1811: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.6/specs
Configured with: ../gcc-3.3.6/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.3.6
configure:1814: $? = 0
configure:1816: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:1819: $? = 1
configure:1843: checking for C compiler default output
configure:1846: gcc    conftest.c  >&5
/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: unrecognized option '--as-needed'
/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
configure:1849: $? = 1
configure: failed program was:
| #line 1822 "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:1888: error: C compiler cannot create executables
See `config.log' for more details.

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

ac_cv_build=i686-pc-linux-gnu
ac_cv_build_alias=i686-pc-linux-gnu
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_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_host=i686-pc-linux-gnu
ac_cv_host_alias=i686-pc-linux-gnu
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=i686-pc-linux-gnu
ac_cv_target_alias=i686-pc-linux-gnu

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

ADDL_DIRS=''
ALLOCA=''
BINDIR=''
BUILD_MODULE_OBJS=''
CC='gcc'
CFLAGS=''
CPP=''
CPPFLAGS=''
CURSES_LIBS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
INCLUDES=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTALL_STRIP=''
LDFLAGS=''
LIBOBJS=''
LIBRARIES=''
LIBS=''
LIB_OBJS=''
LOCALSTATEDIR=''
LTLIBOBJS=''
MODULE_OBJS=''
OBJEXT=''
OSREL='-DLINUX'
OSTYPE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SBINDIR=''
SET_MAKE=''
SHELL='/bin/sh'
SYSCONFDIR=''
VERSION=''
ac_ct_CC='gcc'
ac_ct_RANLIB=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_group=''
install_user=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='i686-pc-linux-gnu'
target_alias=''
target_cpu='i686'
target_os='linux-gnu'
target_vendor='pc'

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

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

configure: exit 77



From scouring the internet I've troubleshot shot this by:

-Downloading and installing the latest gcc, gcc++. gcc-g77, make, nasm, automake, binutils, gettext, libtool packages. Restarted.

-Used swaret to upgrade everything. Restarted.

-Drank a lot of beer and cursed a lot.

All to no avail - I still get the same error. If I had to guess I'd say that my install of gcc is somewhat screwy but that's about all I can think of and I don't know how to troubleshoot that if it is...help.-

kodon 09-30-2005 12:08 AM

1. there is nothing wrong with the official gcc, et al.
2. there is nothing wrong with the official proftpd
3. vsftpd

karphead 09-30-2005 12:25 AM

Quote:

Originally posted by kodon
1. there is nothing wrong with the official gcc, et al.
2. there is nothing wrong with the official proftpd
3. vsftpd

4. Run into another error while running make:

Code:

> make       
gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o ssl.o sysutil.o sysdeputil.o -Wl,-s `./vsf_findlibs.sh`
/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: unrecognized option '--as-needed'
/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [vsftpd] Error 1

I don't have a /usr/lib/gcc-lib/i486-slackware-linux/3.3.6/bin/ directory and I don't know why or whether that's the problem. Here is what's in there though:

Code:

[/usr/lib/gcc-lib/i486-slackware-linux/3.3.6]> ls
total 20213
drwxr-xr-x  6 root root    592 2005-07-08 14:54 ./
drwxr-xr-x  3 root root      72 2005-07-08 14:54 ../
drwxr-xr-x  2 root root  22992 2005-07-08 14:52 adainclude/
drwxr-xr-x  2 root root  11848 2005-07-08 14:54 adalib/
-rwxr-xr-x  1 root root 2964340 2005-07-08 14:54 cc1*
-rwxr-xr-x  1 root root 3022324 2005-07-08 14:54 cc1obj*
-rwxr-xr-x  1 root root 3477620 2005-07-08 14:54 cc1plus*
-rwxr-xr-x  1 root root  83004 2005-07-08 14:54 collect2*
-rw-r--r--  1 root root    1628 2005-07-08 14:52 crtbegin.o
-rw-r--r--  1 root root    1996 2005-07-08 14:52 crtbeginS.o
-rw-r--r--  1 root root    2028 2005-07-08 14:52 crtbeginT.o
-rw-r--r--  1 root root    1288 2005-07-08 14:52 crtend.o
-rw-r--r--  1 root root    1340 2005-07-08 14:52 crtendS.o
-rwxr-xr-x  1 root root 3276252 2005-07-08 14:54 f771*
-rwxr-xr-x  1 root root 4699512 2005-07-08 14:54 gnat1*
drwxr-xr-x  7 root root    640 2005-07-08 14:54 include/
drwxr-xr-x  3 root root    224 2005-07-08 14:54 install-tools/
-rwxr-xr-x  1 root root 2983820 2005-07-08 14:54 jc1*
-rwxr-xr-x  1 root root    9976 2005-07-08 14:54 jvgenmain*
-rw-r--r--  1 root root  49488 2005-07-08 14:54 libgcc.a
-rw-r--r--  1 root root  31202 2005-07-08 14:54 libgcc_eh.a
-rw-r--r--  1 root root    3896 2005-07-08 14:52 specs


wpyh 09-30-2005 06:14 AM

What does this:

ld --help | grep need

give you?

karphead 09-30-2005 07:03 PM

Quote:

Originally posted by wpyh
What does this:

ld --help | grep need

give you?

That just returns me to my prompt - no output.

Last night I deleted everything gcc related and reinstalled just the gcc package, rebooted, and I'm still getting the same messages. I had a couple of different versions showing up so I thought there might have been a conflict but looks like that was wrong.

egag 09-30-2005 08:14 PM

do you have the binutils package installed ?
( binutils-2.15.92.0.2-i486-3 in Slack-10.2 )

egag

karphead 09-30-2005 08:26 PM

Quote:

Originally posted by egag
do you have the binutils package installed ?
( binutils-2.15.92.0.2-i486-3 in Slack-10.2 )

egag

Yep. I actually checked and had two versions installed so I went ahead and deleted them both and reinstalled the latest.

Here's what I get for 'ld --help':

Code:

Usage: ld [options] file...
Options:
  -a KEYWORD                  Shared library control for HP/UX compatibility
  -A ARCH, --architecture ARCH
                              Set architecture
  -b TARGET, --format TARGET  Specify target for following input files
  -c FILE, --mri-script FILE  Read MRI format linker script
  -d, -dc, -dp                Force common symbols to be defined
  -e ADDRESS, --entry ADDRESS Set start address
  -E, --export-dynamic        Export all dynamic symbols
  -EB                        Link big-endian objects
  -EL                        Link little-endian objects
  -f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table
  -F SHLIB, --filter SHLIB    Filter for shared object symbol table
  -g                          Ignored
  -G SIZE, --gpsize SIZE      Small data size (if no size, same as --shared)
  -h FILENAME, -soname FILENAME
                              Set internal name of shared library
  -I PROGRAM, --dynamic-linker PROGRAM
                              Set PROGRAM as the dynamic linker to use
  -l LIBNAME, --library LIBNAME
                              Search for library LIBNAME
  -L DIRECTORY, --library-path DIRECTORY
                              Add DIRECTORY to library search path
  -m EMULATION                Set emulation
  -M, --print-map            Print map file on standard output
  -n, --nmagic                Do not page align data
  -N, --omagic                Do not page align data, do not make text readonly
  --no-omagic                Page align data, make text readonly
  -o FILE, --output FILE      Set output file name
  -O                          Optimize output file
  -Qy                        Ignored for SVR4 compatibility
  -q, --emit-relocs          Generate relocations in final output
  -r, -i, --relocatable      Generate relocatable output
  -R FILE, --just-symbols FILE
                              Just link symbols (if directory, same as --rpath)
  -s, --strip-all            Strip all symbols
  -S, --strip-debug          Strip debugging symbols
  --strip-discarded          Strip symbols in discarded sections
  --no-strip-discarded        Do not strip symbols in discarded sections
  -t, --trace                Trace file opens
  -T FILE, --script FILE      Read linker script
  -u SYMBOL, --undefined SYMBOL
                              Start with undefined reference to SYMBOL
  --unique [=SECTION]        Don't merge input [SECTION | orphan] sections
  -Ur                        Build global constructor/destructor tables
  -v, --version              Print version information
  -V                          Print version and emulation information
  -x, --discard-all          Discard all local symbols
  -X, --discard-locals        Discard temporary local symbols (default)
  --discard-none              Don't discard any local symbols
  -y SYMBOL, --trace-symbol SYMBOL
                              Trace mentions of SYMBOL
  -Y PATH                    Default search path for Solaris compatibility
  -(, --start-group          Start a group
  -), --end-group            End a group
  --accept-unknown-input-arch Accept input files whose architecture cannot be determined
  --no-accept-unknown-input-arch
                              Reject input files whose architecture is unknown
  -assert KEYWORD            Ignored for SunOS compatibility
  -Bdynamic, -dy, -call_shared
                              Link against shared libraries
  -Bstatic, -dn, -non_shared, -static
                              Do not link against shared libraries
  -Bsymbolic                  Bind global references locally
  --check-sections            Check section addresses for overlaps (default)
  --no-check-sections        Do not check section addresses for overlaps
  --cref                      Output cross reference table
  --defsym SYMBOL=EXPRESSION  Define a symbol
  --demangle [=STYLE]        Demangle symbol names [using STYLE]
  --demangler DSO:FUNCTION    Set DSO and demangler function
  --embedded-relocs          Generate embedded relocs
  -fini SYMBOL                Call SYMBOL at unload-time
  --force-exe-suffix          Force generation of file with .exe suffix
  --gc-sections              Remove unused sections (on some targets)
  --no-gc-sections            Don't remove unused sections (default)
  --help                      Print option help
  -init SYMBOL                Call SYMBOL at load-time
  -Map FILE                  Write a map file
  --no-define-common          Do not define Common storage
  --no-demangle              Do not demangle symbol names
  --no-keep-memory            Use less memory and more disk I/O
  --no-undefined              Do not allow unresolved references in object files
  --allow-shlib-undefined    Allow unresolved references in shared libaries
  --no-allow-shlib-undefined  Do not allow unresolved references in shared libs
  --allow-multiple-definition Allow multiple definitions
  --no-undefined-version      Disallow undefined version
  --no-warn-mismatch          Don't warn about mismatched input files
  --no-whole-archive          Turn off --whole-archive
  --noinhibit-exec            Create an output file even if errors occur
  -nostdlib                  Only use library directories specified on
                                the command line
  --oformat TARGET            Specify target of output file
  -qmagic                    Ignored for Linux compatibility
  --relax                    Relax branches on certain targets
  --retain-symbols-file FILE  Keep only symbols listed in FILE
  -rpath PATH                Set runtime shared library search path
  -rpath-link PATH            Set link time shared library search path
  -shared, -Bshareable        Create a shared library
  -pie, --pic-executable      Create a position independent executable
  --sort-common              Sort common symbols by size
  --spare-dynamic-tags COUNT  How many tags to reserve in .dynamic section
  --split-by-file [=SIZE]    Split output sections every SIZE octets
  --split-by-reloc [=COUNT]  Split output sections every COUNT relocs
  --stats                    Print memory usage statistics
  --target-help              Display target specific options
  --task-link SYMBOL          Do task level linking
  --traditional-format        Use same format as native linker
  --section-start SECTION=ADDRESS
                              Set address of named section
  -Tbss ADDRESS              Set address of .bss section
  -Tdata ADDRESS              Set address of .data section
  -Ttext ADDRESS              Set address of .text section
  --unresolved-symbols=<method>
                              How to handle unresolved symbols.  <method> is:
                                ignore-all, report-all, ignore-in-object-files,
                                ignore-in-shared-libs
  --verbose                  Output lots of information during link
  --version-script FILE      Read version information script
  --version-exports-section SYMBOL
                              Take export symbols list from .exports, using
                                SYMBOL as the version.
  --warn-common              Warn about duplicate common symbols
  --warn-constructors        Warn if global constructors/destructors are seen
  --warn-multiple-gp          Warn if the multiple GP values are used
  --warn-once                Warn only once per undefined symbol
  --warn-section-align        Warn if start of section changes due to alignment
  --warn-unresolved-symbols  Report unresolved symbols as warnings
  --error-unresolved-symbols  Report unresolved symbols as errors
  --fatal-warnings            Treat warnings as errors
  --whole-archive            Include all objects from following archives
  --wrap SYMBOL              Use wrapper functions for SYMBOL
  --mpc860c0 [=WORDS]        Modify problematic branches in last WORDS (1-10,
                                default 5) words of a page
ld: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf64-x86-64 elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex binary ihex trad-core
ld: supported emulations: elf_i386 i386linux elf_x86_64
ld: emulation specific options:
elf_i386:
  -Bgroup                Selects group name lookup rules for DSO
  --disable-new-dtags        Disable new dynamic tags
  --enable-new-dtags        Enable new dynamic tags
  --eh-frame-hdr        Create .eh_frame_hdr section
  -z combreloc                Merge dynamic relocs into one section and sort
  -z defs                Report unresolved symbols in object files.
  -z execstack                Mark executable as requiring executable stack
  -z initfirst                Mark DSO to be initialized first at runtime
  -z interpose                Mark object to interpose all DSOs but executable
  -z loadfltr                Mark object requiring immediate process
  -z muldefs                Allow multiple definitions
  -z nocombreloc        Don't merge dynamic relocs into one section
  -z nocopyreloc        Don't create copy relocs
  -z nodefaultlib        Mark object not to use default search paths
  -z nodelete                Mark DSO non-deletable at runtime
  -z nodlopen                Mark DSO not available to dlopen
  -z nodump                Mark DSO not available to dldump
  -z noexecstack        Mark executable as not requiring executable stack
  -z now                Mark object non-lazy runtime binding
  -z origin                Mark object requiring immediate $ORIGIN processing
                          at runtime
  -z KEYWORD                Ignored for Solaris compatibility
elf_x86_64:
  -Bgroup                Selects group name lookup rules for DSO
  --disable-new-dtags        Disable new dynamic tags
  --enable-new-dtags        Enable new dynamic tags
  --eh-frame-hdr        Create .eh_frame_hdr section
  -z combreloc                Merge dynamic relocs into one section and sort
  -z defs                Report unresolved symbols in object files.
  -z execstack                Mark executable as requiring executable stack
  -z initfirst                Mark DSO to be initialized first at runtime
  -z interpose                Mark object to interpose all DSOs but executable
  -z loadfltr                Mark object requiring immediate process
  -z muldefs                Allow multiple definitions
  -z nocombreloc        Don't merge dynamic relocs into one section
  -z nocopyreloc        Don't create copy relocs
  -z nodefaultlib        Mark object not to use default search paths
  -z nodelete                Mark DSO non-deletable at runtime
  -z nodlopen                Mark DSO not available to dlopen
  -z nodump                Mark DSO not available to dldump
  -z noexecstack        Mark executable as not requiring executable stack
  -z now                Mark object non-lazy runtime binding
  -z origin                Mark object requiring immediate $ORIGIN processing
                          at runtime
  -z KEYWORD                Ignored for Solaris compatibility


Supported demangler style: {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat,compaq}

Report bugs to bug-binutils@gnu.org and hjl@lucon.org


egag 09-30-2005 08:37 PM

which package version have you got ?

my ld --help gives more...

--------
--fatal-warnings Treat warnings as errors
--whole-archive Include all objects from following archives
--add-needed Set DT_NEEDED tags for DT_NEEDED entries in
following dynamic libs
--no-add-needed Do not set DT_NEEDED tags for DT_NEEDED entries
in following dynamic libs
--as-needed Only set DT_NEEDED for following dynamic libs if used
--no-as-needed Always set DT_NEEDED for following dynamic libs
--wrap SYMBOL Use wrapper functions for SYMBOL
ld: supported targets: ....[etc]
-----------------

egag

karphead 09-30-2005 10:20 PM

Quote:

Originally posted by egag
which package version have you got ?

my ld --help gives more...

--------
--fatal-warnings Treat warnings as errors
--whole-archive Include all objects from following archives
--add-needed Set DT_NEEDED tags for DT_NEEDED entries in
following dynamic libs
--no-add-needed Do not set DT_NEEDED tags for DT_NEEDED entries
in following dynamic libs
--as-needed Only set DT_NEEDED for following dynamic libs if used
--no-as-needed Always set DT_NEEDED for following dynamic libs
--wrap SYMBOL Use wrapper functions for SYMBOL
ld: supported targets: ....[etc]
-----------------

egag

Thanks egag - I had reinstalled the older version without noticing it. I reinstalled the newer version (the flags above were available this time) and was able to make the vsftpd binary :cool:


All times are GMT -5. The time now is 04:26 AM.