Cross-compiling and configure.ac macros
Andreas Vinsander
andreas+jemalloc at vinsander.se
Fri Apr 15 07:07:55 PDT 2011
2011/4/14 Andreas Vinsander <andreas+jemalloc at vinsander.se>:
> Hi,
>
> I am trying to cross-compile jemalloc for evaluation on an embedded
> device running a Linux home brew distro.
>
> I have some problems with the way jemalloc tests for various support
> of the host (target) system.
I found another test that doesn't work for me.
The test for ffsl complains about:
conftest.c:58: warning: conflicting types for built-in function 'ffsl'
where conftests.c look this way:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_VOID_P 4
| #define LG_SIZEOF_PTR 2
| #define SIZEOF_INT 4
| #define LG_SIZEOF_INT 2
| #define SIZEOF_LONG 4
| #define LG_SIZEOF_LONG 2
| #define CPU_SPINWAIT
| #define JEMALLOC_PURGE_MADVISE_DONTNEED 1
| #define JEMALLOC_HAVE_ATTR
| #define JEMALLOC_MREMAP_FIXED 1
| #define JEMALLOC_TINY
| #define JEMALLOC_TCACHE
| #define STATIC_PAGE_SHIFT 12
| #define HAVE_PTHREAD_H 1
| #define HAVE_DLFCN_H 1
| #define JEMALLOC_LAZY_LOCK
| /* end confdefs.h. */
| /* Define ffsl to an innocuous variant, in case <limits.h> declares ffsl.
| For example, HP-UX 11i <limits.h> declares gettimeofday. */
| #define ffsl innocuous_ffsl
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char ffsl (); below.
| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
| <limits.h> exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|
| #undef ffsl
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char ffsl ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined __stub_ffsl || defined __stub___ffsl
| choke me
| #endif
|
| int
| main ()
| {
| return ffsl ();
| ;
| return 0;
| }
Seems like autoconf has its own idea where ffsl should be found.
According to manual pages on my Fedora desktop, ffsl should be found
in string.h if _GNU_SOURCE is defined.
Any idea what is going on here?
/Andreas
More information about the jemalloc-discuss
mailing list