Summary:ASTERISK-09498: menuselect: configuration error: C compiler cannot create executables
Reporter:Ovidiu Sas (ovi)Labels:
Date Opened:2007-05-23 12:48:48Date Closed:2007-07-11 19:59:05
Versions:Frequency of
Environment:Attachments:( 0) 9784.patch.txt
( 1) logs.tar.gz
Description:I was trying to add asterisk 1.4 to the openembedded repository, but it is failing to configure properly for menuselect.  It seems that the cross-compile options are passed to the native host compiler.

from menuselect/config.log:
configure:2190: checking for C compiler default output file name
configure:2217: cc -isystem/home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/staging/armeb-linux/include -Os -fomit-frame-pointer -frename-registers -fno-unroll-loops -fno-inline-functions -fweb -funit-at-a-time -isystem/home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/staging/armeb-linux/include -L/home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/staging/armeb-linux/lib -Wl,-rpath-link,/home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/staging/armeb-linux/lib -Wl,-O1 conftest.c  >&5
cc1: error: unrecognized option `-fweb'
cc1: error: unrecognized option `-funit-at-a-time'
configure:2220: $? = 1
configure:2258: result:
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| /* end confdefs.h.  */
| int
| main ()
| {
|   ;
|   return 0;
| }
configure:2265: error: C compiler cannot create executables

Pls check the attached logs (build scripts + output and config.log).
Comments:By: Jason Parker (jparker) 2007-05-24 09:38:03

This is a problem with your build system.  Clearly, if your C compiler cannot compile simple code like in the log, then you have other problems, completely unrelated to asterisk.

It may help to look at the --host= and --target= options to the configure script.

By: Ovidiu Sas (ovi) 2007-05-24 10:08:22

I don't think it's a problem related to the build system.  Hundreds of packages are compiled ok using this build system.

It is related to the fact that the options for the arm compiler are passed to the x86 compiler wile building menuselect.

Here's the main configure:
./configure --build=i686-linux --host=armeb-linux --target=armeb-linux ...

In the logs, I have attached the main config.log and menuselect/config.log

I worked before with russellb on fixing some other cross compilation issues for arm.

By: Russell Bryant (russell) 2007-05-24 10:30:48

Menuselect should not be compiled for the target system.  It should be compiled for the host.  Using the host compiler is the correct thing for the menuselect configure script to do.

Please try the attached simple patch.

By: Ovidiu Sas (ovi) 2007-05-24 11:04:32

russellb: the patch fixes this issue (thank you), but then I run into the next one (undeclared PATH_MAX):

Generating input for menuselect ...
menuselect/menuselect --check-deps   menuselect.makeopts
Generating embedded module rules ...
  [CC] stereorize.c -> stereorize.o
  [CC] frame.c -> frame.o
  [LD] stereorize.o frame.o -> stereorize
  [CC] streamplayer.c -> streamplayer.o
  [LD] streamplayer.o -> streamplayer
  [CC] aelparse.c -> aelparse.o
In file included from /home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/work/asterisk14-1.4.4-r1/asterisk-1.4.4/include/asterisk.h:32,
                from ael_lex.c:19:
/home/admin/slug-3.10/releases/slugos-3.10-beta/openslug-nslu2.tmp/work/asterisk14-1.4.4-r1/asterisk-1.4.4/include/asterisk/paths.h:23: error: `PATH_MAX' undeclared here (not in a function)
make[1]: *** [aelparse.o] Error 1
make: *** [utils] Error 2

By: Russell Bryant (russell) 2007-05-24 12:02:13

Well, the code includes limits.h, which is where we end up getting PATH_MAX for other platforms.  You will probably have to figure out what needs to get included to get that defined for your target.

By: Ovidiu Sas (ovi) 2007-05-24 12:09:37

ok.  I will dig more on my end.
Are you going to integrate the patch for the next 1.4?
We can close this bug (the issue is addressed).

Thank you

By: Ovidiu Sas (ovi) 2007-05-24 12:25:10

passed the PATH_MAX issue by forcing ASTCFLAGS:
export ASTCFLAGS = "-fsigned-char -DPATH_MAX=4096"

By: Russell Bryant (russell) 2007-05-24 14:06:35

This has been committed to 1.4 and trunk in revisions 65978 and 65982.  Thanks