Nick Wellnhofer wrote on 3/16/13 10:34 AM:
> 
> On Mar 16, 2013, at 03:06 , Peter Karman <[email protected]> wrote:
> 
>> perl tests do not pass either:
>>
>> cc -Isrc -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
>> -I/opt/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAS_BOOL
>> -I/home/karpet/src/lucy/perl  -c src/Charmonizer/Test/TestLargeFiles.c -o
>> src/Charmonizer/Test/TestLargeFiles.o
>> src/Charmonizer/Test/TestLargeFiles.c: In function ‘S_run_tests’:
>> src/Charmonizer/Test/TestLargeFiles.c:73: error: ‘off64_t’ undeclared (first 
>> use
>> in this function)
> 
> Hmm, that's strange. It might be caused by the Charmonizer LargeFiles probe 
> defining off64_t etc. when using CHAZ_USE_SHORT_NAMES. This looks extremely 
> fragile to me.
> 
> Can you post the contents of your generated charmony.h?

/* Header file auto-generated by Charmonizer.
 * DO NOT EDIT THIS FILE!!
 */

#ifndef H_CHARMONY
#define H_CHARMONY 1


/* BuildEnv */
#define CHY_CC cc
#define CHY_CFLAGS  -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -I/opt/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64
#define CHY_EXTRA_CFLAGS -std=gnu99 -D_GNU_SOURCE -DHAS_BOOL -DLUCY_NOTHREADS

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define CC CHY_CC
  #define CFLAGS CHY_CFLAGS
  #define EXTRA_CFLAGS CHY_EXTRA_CFLAGS
#endif /* USE_SHORT_NAMES */


/* DirManip */
#define CHY_HAS_DIRENT_H
#define CHY_HAS_DIRENT_D_TYPE
#define chy_makedir(_dir, _mode) mkdir(_dir, _mode)
#define CHY_MAKEDIR_MODE_IGNORED 0
#define CHY_DIR_SEP "/"
#define CHY_DIR_SEP_CHAR '/'
#define CHY_REMOVE_ZAPS_DIRS

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_DIRENT_H CHY_HAS_DIRENT_H
  #define HAS_DIRENT_D_TYPE CHY_HAS_DIRENT_D_TYPE
  #define makedir(_dir, _mode) chy_makedir(_dir, _mode)
  #define MAKEDIR_MODE_IGNORED CHY_MAKEDIR_MODE_IGNORED
  #define DIR_SEP CHY_DIR_SEP
  #define DIR_SEP_CHAR CHY_DIR_SEP_CHAR
  #define REMOVE_ZAPS_DIRS CHY_REMOVE_ZAPS_DIRS
#endif /* USE_SHORT_NAMES */


/* Headers */
#define CHY_HAS_POSIX
#define CHY_HAS_C89
#define CHY_HAS_C90
#define CHY_HAS_CPIO_H
#define CHY_HAS_DIRENT_H
#define CHY_HAS_FCNTL_H
#define CHY_HAS_GRP_H
#define CHY_HAS_PWD_H
#define CHY_HAS_REGEX_H
#define CHY_HAS_SYS_STAT_H
#define CHY_HAS_SYS_TIMES_H
#define CHY_HAS_SYS_TYPES_H
#define CHY_HAS_SYS_UTSNAME_H
#define CHY_HAS_SYS_WAIT_H
#define CHY_HAS_TAR_H
#define CHY_HAS_TERMIOS_H
#define CHY_HAS_UNISTD_H
#define CHY_HAS_UTIME_H
#define CHY_HAS_ASSERT_H
#define CHY_HAS_CTYPE_H
#define CHY_HAS_ERRNO_H
#define CHY_HAS_FLOAT_H
#define CHY_HAS_LIMITS_H
#define CHY_HAS_LOCALE_H
#define CHY_HAS_MATH_H
#define CHY_HAS_SETJMP_H
#define CHY_HAS_SIGNAL_H
#define CHY_HAS_STDARG_H
#define CHY_HAS_STDDEF_H
#define CHY_HAS_STDIO_H
#define CHY_HAS_STDLIB_H
#define CHY_HAS_STRING_H
#define CHY_HAS_TIME_H
#define CHY_HAS_PTHREAD_H

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_POSIX CHY_HAS_POSIX
  #define HAS_C89 CHY_HAS_C89
  #define HAS_C90 CHY_HAS_C90
  #define HAS_CPIO_H CHY_HAS_CPIO_H
  #define HAS_DIRENT_H CHY_HAS_DIRENT_H
  #define HAS_FCNTL_H CHY_HAS_FCNTL_H
  #define HAS_GRP_H CHY_HAS_GRP_H
  #define HAS_PWD_H CHY_HAS_PWD_H
  #define HAS_REGEX_H CHY_HAS_REGEX_H
  #define HAS_SYS_STAT_H CHY_HAS_SYS_STAT_H
  #define HAS_SYS_TIMES_H CHY_HAS_SYS_TIMES_H
  #define HAS_SYS_TYPES_H CHY_HAS_SYS_TYPES_H
  #define HAS_SYS_UTSNAME_H CHY_HAS_SYS_UTSNAME_H
  #define HAS_SYS_WAIT_H CHY_HAS_SYS_WAIT_H
  #define HAS_TAR_H CHY_HAS_TAR_H
  #define HAS_TERMIOS_H CHY_HAS_TERMIOS_H
  #define HAS_UNISTD_H CHY_HAS_UNISTD_H
  #define HAS_UTIME_H CHY_HAS_UTIME_H
  #define HAS_ASSERT_H CHY_HAS_ASSERT_H
  #define HAS_CTYPE_H CHY_HAS_CTYPE_H
  #define HAS_ERRNO_H CHY_HAS_ERRNO_H
  #define HAS_FLOAT_H CHY_HAS_FLOAT_H
  #define HAS_LIMITS_H CHY_HAS_LIMITS_H
  #define HAS_LOCALE_H CHY_HAS_LOCALE_H
  #define HAS_MATH_H CHY_HAS_MATH_H
  #define HAS_SETJMP_H CHY_HAS_SETJMP_H
  #define HAS_SIGNAL_H CHY_HAS_SIGNAL_H
  #define HAS_STDARG_H CHY_HAS_STDARG_H
  #define HAS_STDDEF_H CHY_HAS_STDDEF_H
  #define HAS_STDIO_H CHY_HAS_STDIO_H
  #define HAS_STDLIB_H CHY_HAS_STDLIB_H
  #define HAS_STRING_H CHY_HAS_STRING_H
  #define HAS_TIME_H CHY_HAS_TIME_H
  #define HAS_PTHREAD_H CHY_HAS_PTHREAD_H
#endif /* USE_SHORT_NAMES */


/* AtomicOps */

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
#endif /* USE_SHORT_NAMES */


/* FuncMacro */
#define CHY_HAS_FUNC_MACRO
#define CHY_FUNC_MACRO __func__
#define CHY_HAS_ISO_FUNC_MACRO
#define CHY_HAS_GNUC_FUNC_MACRO
#define CHY_INLINE __inline

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_FUNC_MACRO CHY_HAS_FUNC_MACRO
  #define FUNC_MACRO CHY_FUNC_MACRO
  #define HAS_ISO_FUNC_MACRO CHY_HAS_ISO_FUNC_MACRO
  #define HAS_GNUC_FUNC_MACRO CHY_HAS_GNUC_FUNC_MACRO
  #define INLINE CHY_INLINE
#endif /* USE_SHORT_NAMES */


/* Booleans */
#define CHY_HAS_STDBOOL_H
#include <stdbool.h>

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_STDBOOL_H CHY_HAS_STDBOOL_H
#endif /* USE_SHORT_NAMES */


/* Integers */
#define CHY_LITTLE_END
#define CHY_HAS_INTTYPES_H
#define CHY_HAS_STDINT_H
#define CHY_HAS_LONG_LONG
#define CHY_SIZEOF_CHAR 1
#define CHY_SIZEOF_SHORT 2
#define CHY_SIZEOF_INT 4
#define CHY_SIZEOF_LONG 4
#define CHY_SIZEOF_PTR 4
#define CHY_SIZEOF_LONG_LONG 8
#define CHY_HAS_INT8_T
#define CHY_HAS_INT16_T
#define CHY_HAS_INT32_T
#define CHY_HAS_INT64_T
#include <inttypes.h>
#define CHY_PTR_TO_I64(ptr) ((int64_t)(uint32_t)(ptr))
#define CHY_U64_TO_DOUBLE(num) ((double)(num))

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define LITTLE_END CHY_LITTLE_END
  #define HAS_INTTYPES_H CHY_HAS_INTTYPES_H
  #define HAS_STDINT_H CHY_HAS_STDINT_H
  #define HAS_LONG_LONG CHY_HAS_LONG_LONG
  #define SIZEOF_CHAR CHY_SIZEOF_CHAR
  #define SIZEOF_SHORT CHY_SIZEOF_SHORT
  #define SIZEOF_INT CHY_SIZEOF_INT
  #define SIZEOF_LONG CHY_SIZEOF_LONG
  #define SIZEOF_PTR CHY_SIZEOF_PTR
  #define SIZEOF_LONG_LONG CHY_SIZEOF_LONG_LONG
  #define HAS_INT8_T CHY_HAS_INT8_T
  #define HAS_INT16_T CHY_HAS_INT16_T
  #define HAS_INT32_T CHY_HAS_INT32_T
  #define HAS_INT64_T CHY_HAS_INT64_T
  #define PTR_TO_I64(ptr) CHY_PTR_TO_I64(ptr)
  #define U64_TO_DOUBLE(num) CHY_U64_TO_DOUBLE(num)
#endif /* USE_SHORT_NAMES */


/* Floats */
typedef union { uint32_t i; float f; } chy_floatu32;
typedef union { uint64_t i; double d; } chy_floatu64;
static const chy_floatu32 chy_f32inf    = {UINT32_C(0x7f800000)};
static const chy_floatu32 chy_f32neginf = {UINT32_C(0xff800000)};
static const chy_floatu32 chy_f32nan    = {UINT32_C(0x7fc00000)};
static const chy_floatu64 chy_f64inf    = {UINT64_C(0x7ff0000000000000)};
static const chy_floatu64 chy_f64neginf = {UINT64_C(0xfff0000000000000)};
static const chy_floatu64 chy_f64nan    = {UINT64_C(0x7ff8000000000000)};
#define CHY_F32_INF (chy_f32inf.f)
#define CHY_F32_NEGINF (chy_f32neginf.f)
#define CHY_F32_NAN (chy_f32nan.f)
#define CHY_F64_INF (chy_f64inf.d)
#define CHY_F64_NEGINF (chy_f64neginf.d)
#define CHY_F64_NAN (chy_f64nan.d)

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define F32_INF CHY_F32_INF
  #define F32_NEGINF CHY_F32_NEGINF
  #define F32_NAN CHY_F32_NAN
  #define F64_INF CHY_F64_INF
  #define F64_NEGINF CHY_F64_NEGINF
  #define F64_NAN CHY_F64_NAN
#endif /* USE_SHORT_NAMES */


/* LargeFiles */
#define CHAZ_HAS_SYS_STAT_H
#define CHAZ_HAS_FCNTL_H
#define CHAZ_HAS_STAT_ST_SIZE
#define CHAZ_HAS_STAT_ST_BLOCKS
#define CHY_HAS_64BIT_OFFSET_TYPE
#define chy_off64_t off64_t
#define CHY_HAS_64BIT_STDIO
#define chy_fopen64 fopen64
#define chy_ftello64 ftello64
#define chy_fseeko64 fseeko64
#define CHY_HAS_64BIT_LSEEK
#define chy_lseek64 lseek64
#define CHY_HAS_64BIT_PREAD
#define chy_pread64 pread64

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_64BIT_OFFSET_TYPE CHY_HAS_64BIT_OFFSET_TYPE
  #define HAS_64BIT_STDIO CHY_HAS_64BIT_STDIO
  #define HAS_64BIT_LSEEK CHY_HAS_64BIT_LSEEK
  #define HAS_64BIT_PREAD CHY_HAS_64BIT_PREAD
#endif /* USE_SHORT_NAMES */


/* Memory */
#define CHY_HAS_SYS_MMAN_H
#define CHY_HAS_ALLOCA_H
#define chy_alloca alloca

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_SYS_MMAN_H CHY_HAS_SYS_MMAN_H
  #define HAS_ALLOCA_H CHY_HAS_ALLOCA_H
#endif /* USE_SHORT_NAMES */


/* RegularExpressions */

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
#endif /* USE_SHORT_NAMES */


/* SymbolVisibility */
#define CHY_EXPORT __attribute__ ((visibility ("default")))
#define CHY_IMPORT

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define EXPORT CHY_EXPORT
  #define IMPORT CHY_IMPORT
#endif /* USE_SHORT_NAMES */


/* UnusedVars */
#define CHY_UNUSED_VAR(x) ((void)x)
#define CHY_UNREACHABLE_RETURN(type) return (type)0

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define UNUSED_VAR(x) CHY_UNUSED_VAR(x)
  #define UNREACHABLE_RETURN(type) CHY_UNREACHABLE_RETURN(type)
#endif /* USE_SHORT_NAMES */


/* VariadicMacros */
#define CHY_HAS_VARIADIC_MACROS
#define CHY_HAS_ISO_VARIADIC_MACROS
#define CHY_HAS_GNUC_VARIADIC_MACROS

#if defined(CHY_USE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)
  #define HAS_VARIADIC_MACROS CHY_HAS_VARIADIC_MACROS
  #define HAS_ISO_VARIADIC_MACROS CHY_HAS_ISO_VARIADIC_MACROS
  #define HAS_GNUC_VARIADIC_MACROS CHY_HAS_GNUC_VARIADIC_MACROS
#endif /* USE_SHORT_NAMES */

#ifdef CHY_HAS_SYS_TYPES_H
  #include <sys/types.h>
#endif

#ifdef CHY_HAS_STDARG_H
  #include <stdarg.h>
#endif

#ifdef CHY_HAS_ALLOCA_H
  #include <alloca.h>
#elif defined(CHY_HAS_MALLOC_H)
  #include <malloc.h>
#elif defined(CHY_ALLOCA_IN_STDLIB_H)
  #include <stdlib.h>
#endif

#ifdef CHY_HAS_WINDOWS_H
  /* Target Windows XP. */
  #ifndef WINVER
    #define WINVER 0x0500
  #endif
  #ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0x0500
  #endif
#endif

#endif /* H_CHARMONY */


> 
> Can you try to move the line
> 
>     #include "charmony.h"
> 
> after all other #includes in 
> charmonizer/src/Charmonizer/Test/TestLargeFiles.c?
> 

that does not affect the outcome; still fails.


-- 
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to