Tough question: errors while cross compiling to MIPS

James Peach jpeach at samba.org
Tue Jul 24 15:56:48 GMT 2007


On Jul 23, 2007, at 12:55 PM, Luther138 wrote:

>
> I can get it to compile but I still need to apply one hack to the  
> configure
> script.
> I always get this error msg:
> checking for prctl... yes
> configure: error: cannot run test program while cross compiling
>
> unless I change/comment out the following ... (line 34336 of the  
> configure)
> # glibc <= 2.3.2 has a broken getgrouplist
>       if test "$cross_compiling" = yes; then
> #       { { echo "$as_me:$LINENO: error: cannot run test program  
> while cross
> compiling
> #                                                                  See
> \`config.log' for more details." >&5
> #         echo "$as_me: error: cannot run test program while cross  
> compiling
> #           See \`config.log' for more details." >&2;}
> #      { (exit 1); exit 1; }; }
> (line added) linux_getgrouplist_ok=no
>
> So this would imply that the problem is not with prctl but actually  
> with
> linux_getgrouplist_ ok correct?

yep

> But is if set linux_getgrouplist_ok=no
> before hand it will still error out.  But as long as I do that one  
> hack to
> the configure script all the rest the variables I set seem to work. ie
> export SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes ; \
> export libreplace_cv_READDIR_GETDIRENTRIES=no ; \
> export libreplace_cv_READDIR_GETDENTS=no ; \
> export linux_getgrouplist_ok=no ; \
> export samba_cv_REPLACE_READDIR=no ; \
> export samba_cv_HAVE_WRFILE_KEYTAB=yes ; \
> export samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes ; \

Yes, the Linux grouplist test is broken for cross-compiling in the  
3.0.25 tree. You can just replace it with the test from the 3.2 tree:

     AC_CACHE_CHECK([for a broken Linux getgrouplist API],
             linux_getgrouplist_ok,
             [
                 AC_TRY_RUN([
#include <unistd.h>
#include <sys/utsname.h>

                     int main() {
                            /* glibc up to 2.3 has a broken  
getgrouplist */
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
                            int libc_major = __GLIBC__;
                            int libc_minor = __GLIBC_MINOR__;

                            if (libc_major < 2)
                                   return 1;
                            if ((libc_major == 2) && (libc_minor <= 3))
                                   return 1;
#endif
                            return 0;
                     }

                 ],
                 [linux_getgrouplist_ok=yes],
                 [linux_getgrouplist_ok=no],
                 [linux_getgrouplist_ok=cross])
        ])

        if test x"$linux_getgrouplist_ok" = x"yes"; then
           AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
        fi



> Is this a bug or am I still doing something wrong.  FYI I am not  
> using the
> config.site meathod because I only want to add my makefile (i.e.  
> only one
> file) to the directory above /source (i.e. samba 3-0.25b), and this  
> file
> invokes the configure and runs the ../source/Makefile.

just generate config.site from your makefile ...

CONFIG_SITE := `pwd`/config.site

config.site:
	SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes >> $@
	....

configure: config.site
	cd samba/source && env CONFIG_SITE=$(CONFIG_SITE) ./configure --blah
	
> Thank you again for
> your help.
> -Robb
> -- 
> View this message in context: http://www.nabble.com/Tough-question%3A-errors-while-cross-compiling-to-MIPS-tf4099335.html#a11751539
> Sent from the Samba - samba-technical mailing list archive at  
> Nabble.com.

--
James Peach | jpeach at samba.org



More information about the samba-technical mailing list