Bug 3906

Summary: cannot compile iptables using MIPS target arch
Product: [Yocto Project Subprojects] ADT Reporter: Alexandru Georgescu <alexandru.c.georgescu>
Component: adtAssignee: Jessica <jessica.zhang>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: Undecided CC: laurentiu.palcu, poky.adt.watcher, poky.watcher
Version: 1.4   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
config log none

Description Alexandru Georgescu 2013-02-18 16:31:12 UTC

    
Comment 1 Alexandru Georgescu 2013-02-18 16:38:43 UTC
Created attachment 1075 [details]
config log
Comment 2 Alexandru Georgescu 2013-02-18 16:40:31 UTC
poky commit: 3ec4df57540421df2cda6b83c615bfb7cebccefd

STEPS TO REPRODUCE

1. clone poky and checkout the commit from above.
2. build adt-installer: $ bitbake adt-installer
3. I configured in adt_installer.conf:
YOCTOADT_REPO="http://adtrepo-dev.yoctoproject.org/1.3+snapshot-3ec4df57540421df2cda6b83c615bfb7cebccefd" 
and to use MIPS target architecture

4. Configure  opkg/conf/opkg-sdk-x86_64.conf with: 
src http://adtrepo-dev.yoctoproject.org/1.3+snapshot-3ec4df57540421df2cda6b83c615bfb7cebccefd/adt-ipk/x86_64-nativesdk/

5. Install adt-installer in the default location ( or a specified one)

6. Get http://netfilter.org/projects/iptables/files/iptables-1.4.15.tar.bz2 and extract it

7. source the environment: 
source source /opt/poky/1.3+snapshot/environment-setup-mips32-poky-linux

8. Compile iptables:
[tester@yocto-asus iptables-1.4.15]$ ./configure $CONFIGURE_FLAGS
configure: WARNING: unrecognized options: --with-libtool-sysroot
configure: loading site script /opt/poky/1.3+snapshot/site-config-mips32-poky-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mips-poky-linux-strip... mips-poky-linux-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for mips-poky-linux-gcc... mips-poky-linux-gcc  -meb -mabi=32   -mhard-float -march=mips32 --sysroot=##SDKTARGETSYSROOT##
checking whether the C compiler works... no
configure: error: in `/home/tester/adt-0214/adt-installer/iptables-1.4.15':
configure: error: C compiler cannot create executables
See `config.log' for more details
[tester@yocto-asus iptables-1.4.15]$


9 See log file (in attachment)
Comment 3 Alexandru Georgescu 2013-02-18 16:45:07 UTC
Compiling a simple g++ file I have the following:

[tester@yocto-asus adt-installer]$ cat testplus.cpp 
#include <stdio.h>
#include <math.h>

double
convert(long long l)
{
   return (double)l;    // or double(l)
}

int
main(int argc, char * argv[])
{
   long long l = 10;
   double f;

   f = convert(l);
   printf("convert: %lld => %f\n", l, f);

   f = 1234.67;
   printf("floorf(%f) = %f\n", f, floorf(f));
   return 0;
}
[tester@yocto-asus adt-installer]$ 



[tester@yocto-asus adt-installer]$ $CXX $CXXFLAGS testplus.cpp 
testplus.cpp:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
Comment 4 Alexandru Georgescu 2013-02-18 16:49:17 UTC
Marking it in needinfo for more details
Comment 5 Jessica 2013-02-18 17:02:23 UTC
Alex,

Is your adt installed correctly?  look at your config steps, the sysroot is not set.  If there's no sysroot set, no wonder it can't find the needed header files.
Comment 6 Laurentiu Palcu 2013-02-19 08:38:44 UTC
I just compiled meta-toolchain for mips and built ipatables with it. It should work just fine with adt-installer too.

Please do an "echo $CONFIGURE_FLAGS" before running "./configure $CONFIGURE_FLAGS" to make sure you have sourced the environment script correctly.
Comment 7 Laurentiu Palcu 2013-02-19 08:49:05 UTC
On the other hand, looking at the config.log you attached, I saw this:

./configure --target=mips-poky-linux --host=mips-poky-linux --build=x86_64-linux --with-libtool-sysroot=##SDKTARGETSYSROOT##

Something tells me that your environment script has not been correctly generated. You should not have ##SDKTARGETSYSROOT## anywhere in that line. That's why the compilation failed. The target sysroot has not been expanded in the environment-setup script.

Please, repeat the procedure and, before trying to compile the iptables package, check the environment-setup script. If you see ##SDKTARGETSYSROOT##, then we have an issue...
Comment 8 Alexandru Georgescu 2013-02-19 09:41:51 UTC
Hello, 
I am marking this as invalid since the installer wasn't correctly used (that's why I have marked it as needinfo).
I have reinstalled it correctly now and it works.

Regards,
Alex.
Comment 9 Alexandru Georgescu 2013-02-19 09:42:04 UTC
verified.