Unix Technical Forum

Cannot run C compiled programs

This is a discussion on Cannot run C compiled programs within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> For several days, when I try to run ./configure, I get the error below. Can anybody help? Possible leads: ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 05:22 PM
rs
 
Posts: n/a
Default Cannot run C compiled programs

For several days, when I try to run ./configure, I get the error below. Can
anybody help? Possible leads: I recently installed Dropline Gnome. Also,
I'm running Slackware Current, up to date.

Here's the error:

"checking whether the C compiler works... configure: error: cannot run C
compiled programs. If you meant to cross compile,use '--host'."

Config.log has this under the Core Tests section:

==== begin config.log excerpt ====
configure:2448: $? = 0
configure:2450: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs
Configured with: ../gcc-3.3.4/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.4
configure:2453: $? = 0
configure:2455: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:2458: $? = 1
configure:2481: checking for C compiler default output file name
configure:2484: gcc conftest.c >&5
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld:
warning: cannot find entry symbol _start; defaulting to 00000000080481c0
configure:2487: $? = 0
configure:2533: result: a.out
configure:2538: checking whether the C compiler works
configure:2544: ./a.out
../configure: line 2545: 10561 Illegal instruction ./$ac_file
configure:2547: $? = 132
configure:2556: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
==== end config.log excerpt ====


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 05:22 PM
Joost Kremers
 
Posts: n/a
Default Re: Cannot run C compiled programs

rs <rsnidjik@gmx.co.uk> writes:

> For several days, when I try to run ./configure, I get the error below. Can
> anybody help? Possible leads: I recently installed Dropline Gnome. Also,
> I'm running Slackware Current, up to date.
>
> Here's the error:
>
> "checking whether the C compiler works... configure: error: cannot run C
> compiled programs. If you meant to cross compile,use '--host'."


heh, that's a cool one... the C compiler produces programs that cannot run
on the host that they are compiled on? ;-)

> Config.log has this under the Core Tests section:
>
> ==== begin config.log excerpt ====


be honest: this isn't from config.log, is it? ;-P this is from the screen
output from ./configure. config.log is much more elaborate.
[...]
> See `config.log' for more details.


see?

it'd be useful if you could post relevant sections of the actual
config.log, but looking through this, there is already one thing that
strikes me as odd:

[...]
> configure:2455: gcc -V </dev/null >&5
> gcc: `-V' option must have argument


this shouldn't happen. do you get the same thing with any program you try
to ./configure, or just one program in particular?

--
Joost Kremers
Life has its moments
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 05:22 PM
rs
 
Posts: n/a
Default Re: Cannot run C compiled programs

No, I promise, this is really from the "Core tests" section of my
config.log.

Which other sections of config.log are relevant? I excerpted this section
because it contained the error message that made to to the screen.

And, yes, I get this same error message when I try to compile anything -- or
at least the three progs I've tried to compile today as I've tried to
troubleshoot this.

I'd greatly appreciate any help. Yes, I'm a nooooooob.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 05:23 PM
Lew Pitcher
 
Posts: n/a
Default Re: Cannot run C compiled programs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

rs wrote:
> For several days, when I try to run ./configure, I get the error below. Can
> anybody help? Possible leads: I recently installed Dropline Gnome. Also,
> I'm running Slackware Current, up to date.
>
> Here's the error:
>
> "checking whether the C compiler works... configure: error: cannot run C
> compiled programs. If you meant to cross compile,use '--host'."
>
> Config.log has this under the Core Tests section:
>
> ==== begin config.log excerpt ====
> configure:2448: $? = 0
> configure:2450: gcc -v </dev/null >&5
> Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs
> Configured with: ../gcc-3.3.4/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.4
> configure:2453: $? = 0
> configure:2455: gcc -V </dev/null >&5
> gcc: `-V' option must have argument
> configure:2458: $? = 1
> configure:2481: checking for C compiler default output file name
> configure:2484: gcc conftest.c >&5
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld:
> warning: cannot find entry symbol _start; defaulting to 00000000080481c0


The above warning might be important.

> configure:2487: $? = 0
> configure:2533: result: a.out
> configure:2538: checking whether the C compiler works
> configure:2544: ./a.out
> ./configure: line 2545: 10561 Illegal instruction ./$ac_file
> configure:2547: $? = 132
> configure:2556: error: cannot run C compiled programs.
> If you meant to cross compile, use `--host'.


In the configure:2481-to-configure:2533 test, the gcc compiler was asked
to compile a program. This compile left a binary in the a.out file (a
binary that might have a problem due to an unresolved entrypoint), which
the test in configure:2538-to-configure:2556 tries to run.

The configure:2538-to-configure:2556 test finds that the binary from
configure:2481-to-configure:2533 fails to execute because of a SIGILL
signal ("Illegal Instruction"). This is a clue that the compile didn't
result in a binary that can be executed on your platform, and configure
/assumes/ that this is because of the compiler being configured for
cross-compilation to another processor platform.

I have a hunch that the SIGILL is a result of the missing entrypoint; if
the linker directs the default for that entrypoint to something that is
not a legal instruction, a SIGILL will result.

You probably should look into the configuration options and the
application's install instructions, and see if the missing _start
entrypoint can be resolved.



> See `config.log' for more details.
> ==== end config.log excerpt ====
>
>



- --

Lew Pitcher, IT Consultant, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFBmgFGagVFX4UWr64RApzmAKDqtMlbd5TAlGimdLYACP fm/N6TUgCgo4fT
tjp45AxdOLUgfqQlVe53LbQ=
=lMlC
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 05:23 PM
Joost Kremers
 
Posts: n/a
Default Re: Cannot run C compiled programs

Lew Pitcher <Lew.Pitcher@td.com> writes:

> rs wrote:
> The configure:2538-to-configure:2556 test finds that the binary from
> configure:2481-to-configure:2533 fails to execute because of a SIGILL
> signal ("Illegal Instruction").


could this also be the result of trying to run a binary optimized for a
specific processor on the wrong architecture?

to the OP, since you mentioned that you have this problem with any program
you try to ./configure, do you have any CFLAGS and/or CXXFLAGS set? if so,
unset them, and see what you get.

--
Joost Kremers
Life has its moments
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 05:23 PM
Laurenz Albe
 
Posts: n/a
Default Re: Cannot run C compiled programs

rs <rsnidjik@gmx.co.uk> wrote:
> For several days, when I try to run ./configure, I get the error below. Can
> anybody help? Possible leads: I recently installed Dropline Gnome. Also,
> I'm running Slackware Current, up to date.
>
> Here's the error:
>
> "checking whether the C compiler works... configure: error: cannot run C
> compiled programs. If you meant to cross compile,use '--host'."


Have you tried the very simple test:
Write a 'hello world' program, compile and run it?

Yours,
Laurenz Albe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 05:23 PM
Jeffrey Froman
 
Posts: n/a
Default Re: Cannot run C compiled programs

rs wrote:

> And, yes, I get this same error message when I try to compile anything --
> or at least the three progs I've tried to compile today as I've tried to
> troubleshoot this.


Might you be compiling on a partition that is mounted with the "noexec"
option? The "mount" command will tell you.

Jeffrey
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 05:23 PM
rs
 
Posts: n/a
Default Re: Cannot run C compiled programs

rs wrote:

> For several days, when I try to run ./configure, I get the error below.
> Can anybody help? Possible leads: I recently installed Dropline Gnome.
> Also, I'm running Slackware Current, up to date.
>
> Here's the error:
>
> "checking whether the C compiler works... configure: error: cannot run C
> compiled programs. If you meant to cross compile,use '--host'."
>
> Config.log has this under the Core Tests section:

[snip]

Thanks, everyone, for the instructive comments. I especially appreciated the
interpretation of the error messages.

I finally got things back to normal by reinstalling the glibc package.
Unfortunately, I was dumb enough to first uninstall it, crippling my
system. I had to boot from the Slack installation CD and use pkgtool to
reinstall glibc from a set of Current files that I had on my hard disk.

So all is fine now. I'm not exactly sure how glibc related to the error,
except that restoring it fixed things up again.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com