git/list[1] front-page[2] threads[3] people[4] search[5] about
 

autoconf: C99 format check

From
JNJulius Naperkowski <j.nap@gmx.de>
Date
Jan 15, 2009, 13:22 UTC
Message-ID
<loom.20090115T123123-915@post.gmane.org>

I am trying to cross-compile git for mips on a x86 host. But it seems that it is impossible to pass the C99 Format check in the configure script when cross_compile mode is activated because the script quits even before it starts the testprogramm. Is this behavior intentional?

configure: CHECKS for programs checking for mips-linux-cc... ccache mips-linux-uclibc-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether ccache mips-linux-uclibc-gcc accepts -g... yes checking for ccache mips-linux-uclibc-gcc option to accept ISO C89... none needed checking if linker supports -R... no checking if linker supports -Wl,-rpath,... yes checking for mips-linux-gar... mips-linux-uclibc-ar checking for gtar... /bin/tar checking for asciidoc... no configure: CHECKS for libraries checking for SHA1_Init in -lcrypto... no checking for SHA1_Init in -lssl... no checking for curl_global_init in -lcurl... no checking for XML_ParserCreate in -lexpat... no checking for iconv in -lc... no checking for iconv in -liconv... no checking for deflateBound in -lz... no checking for socket in -lc... yes configure: CHECKS for header files checking how to run the C preprocessor... ccache mips-linux-uclibc-gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking for old iconv()... yes configure: CHECKS for typedefs, structures, and compiler characteristics checking for struct dirent.d_ino... yes checking for struct dirent.d_type... yes checking for struct sockaddr_storage... yes checking for struct addrinfo... yes checking for getaddrinfo... (cached) yes checking for library containing getaddrinfo... none required checking whether formatted IO functions support C99 size specifiers... configure: error: cannot run test program while cross compiling See `config.log' for more details.

A snippet of the configure script:

... 4928: # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) 4929: # do not support the 'size specifiers' introduced by C99, namely ll, hh, 4930: # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). 4931: # some C compilers supported these specifiers prior to C99 as an extension. 4932: { echo "$as_me:$LINENO: checking whether formatted IO functions support C99 size specifiers" >&5 4933: echo $ECHO_N "checking whether formatted IO functions support C99 size specifiers... $ECHO_C" >&6; } 4934: if test "${ac_cv_c_c99_format+set}" = set; then 4935: echo $ECHO_N "(cached) $ECHO_C" >&6 4936: else 4937: # Actually git uses only %z (%zu) in alloc.c, and %t (%td) in mktag.c 4938: if test "$cross_compiling" = yes; then 4939: { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 4940: See \`config.log' for more details." >&5 4941: echo "$as_me: error: cannot run test program while cross compiling 4942: See \`config.log' for more details." >&2;} 4943: { (exit 1); exit 1; }; } 4944: else 4945: cat >conftest.$ac_ext <<_ACEOF 4946: /* confdefs.h. */ 4947: _ACEOF 4948: cat confdefs.h >>conftest.$ac_ext 4949: cat >>conftest.$ac_ext <<_ACEOF ...

-- Julius

Next: Ralf Wildenhues
Message 1 of 8 in “autoconf: C99 format check”
  1. Julius NaperkowskiJan 15, 2009
  2. Ralf WildenhuesJan 16, 2009
  3. Provide pessimistic defaults for cross compilation tests.Ralf Wildenhues, Jan 19, 2009
  4. Johannes SchindelinJan 19, 2009
  5. Junio C HamanoJan 20, 2009
  6. Ralf WildenhuesJan 20, 2009
  7. Junio C HamanoJan 20, 2009
  8. Ralf WildenhuesJan 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.