Page MenuHome GnuPG

Error on include order
Closed, ResolvedPublic

Description

OS: MacOS X
version: 10.10.3
compiler: clang 6.0
prefix: /local/gpg2

Historical context:

libgpg-error-1.19       ./configure --prefix=/local/gpg2 ; make ; make

install

libgcrypt-1.6.3         ./configure --prefix=/local/gpg2 ; make ; make

install

libksba-1.3.3           ./configure --prefix=/local/gpg2 ; make ; make

install

libassuan-2.2.1         ./configure --prefix=/local/gpg2 ; make ; make

install

pth-2.0.7               ./configure --prefix=/local/gpg2 ; make ; make

install

gnupg-2.0.27            ./configure --prefix=/local/gpg2
                        make fails with

make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in m4
make[2]: Nothing to be done for `all'.
Making all in gl
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \

  cat ./alloca_.h; \
} > alloca.h-t

mv -f alloca.h-t alloca.h
rm -f stdint.h-t stdint.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \

sed -e 's/@''HAVE_WCHAR_H''@/1/g' \
    -e 's/@''HAVE_STDINT_H''@/1/g' \
    -e

's|@''ABSOLUTE_STDINT_H''@|"///Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h"|g'
\

      -e 's/@''HAVE_SYS_TYPES_H''@/1/g' \
      -e 's/@''HAVE_INTTYPES_H''@/1/g' \
      -e 's/@''HAVE_SYS_INTTYPES_H''@/0/g' \
      -e 's/@''HAVE_SYS_BITYPES_H''@/0/g' \
      -e 's/@''HAVE_LONG_LONG_INT''@/1/g' \
      -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/1/g' \
      -e 's/@''BITSIZEOF_PTRDIFF_T''@/64/g' \
      -e 's/@''PTRDIFF_T_SUFFIX''@/l/g' \
      -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/32/g' \
      -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/1/g' \
      -e 's/@''SIG_ATOMIC_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_SIZE_T''@/64/g' \
      -e 's/@''SIZE_T_SUFFIX''@/ul/g' \
      -e 's/@''BITSIZEOF_WCHAR_T''@/32/g' \
      -e 's/@''HAVE_SIGNED_WCHAR_T''@/1/g' \
      -e 's/@''WCHAR_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_WINT_T''@/32/g' \
      -e 's/@''HAVE_SIGNED_WINT_T''@/1/g' \
      -e 's/@''WINT_T_SUFFIX''@//g' \
      < ./stdint_.h; \
} > stdint.h-t

mv stdint.h-t stdint.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -Wno-pointer-sign -Wpointer-arith
-MT allocsa.o -MD -MP -MF .deps/allocsa.Tpo -c -o allocsa.o allocsa.c
In file included from allocsa.c:21:
In file included from ./allocsa.h:23:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
In file included from /usr/include/sys/resource.h:72:
In file included from ./stdint.h:66:
/usr/include/inttypes.h:235:8: error: unknown type name 'intmax_t'
extern intmax_t

^

/usr/include/inttypes.h:236:9: error: unknown type name 'intmax_t'
imaxabs(intmax_t j);

^

/usr/include/inttypes.h:240:2: error: unknown type name 'intmax_t'

intmax_t quot;
^

/usr/include/inttypes.h:241:2: error: unknown type name 'intmax_t'

intmax_t rem;
^

/usr/include/inttypes.h:246:9: error: unknown type name 'intmax_t'
imaxdiv(intmax_t numer, intmax_t denom);

^

/usr/include/inttypes.h:246:27: error: unknown type name 'intmax_t'
imaxdiv(intmax_t numer, intmax_t denom);

^

/usr/include/inttypes.h:250:8: error: unknown type name 'intmax_t'
extern intmax_t

^

/usr/include/inttypes.h:256:8: error: unknown type name 'uintmax_t'; did you
mean 'uintptr_t'?
extern uintmax_t

^

/usr/include/sys/_types/_uintptr_t.h:30:24: note: 'uintptr_t' declared here
typedef unsigned long uintptr_t;

^

In file included from allocsa.c:21:
In file included from ./allocsa.h:23:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
In file included from /usr/include/sys/resource.h:72:
In file included from ./stdint.h:66:
/usr/include/inttypes.h:263:8: error: unknown type name 'intmax_t'
extern intmax_t

^

/usr/include/inttypes.h:269:8: error: unknown type name 'uintmax_t'; did you
mean 'uintptr_t'?
extern uintmax_t

^

/usr/include/sys/_types/_uintptr_t.h:30:24: note: 'uintptr_t' declared here
typedef unsigned long uintptr_t;

^

10 errors generated.
make[3]: * [allocsa.o] Error 1
make[2]:
* [all] Error 2
make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2

My analysis is that the include order within the locally built
gl/stdint.h is wrong:

gl/stdint.h:66:#include /usr/include/inttypes.h

    /usr/include/inttypes.h:235: intmax_t is referenced but not yet defined
    /usr/include/inttypes.h:229: #include /usr/include/stdint.h
        /usr/include/stdint.h:58: #include /usr/include/_types/_intmax.h
            /usr/include/_types/_intmax.h:29 intmax_t is defined but too late

gl/stdint.h:220: intmax_t is redefined but too late

How may this be fixed without breaking any other build chain and context?

Details

Version
2.0.27

Event Timeline

dan_gpg added projects: gnupg, Bug Report.
dan_gpg added a subscriber: dan_gpg.

This 1st step debugging modification on configure

  • configure 2015/06/03 14:56:54 1.1
  • configure 2015/06/03 14:57:45
  • 14873,14878 ****
  • 14873,14879 ---- else HAVE_INTTYPES_H=0 fi

+ HAVE_INTTYPES_H=0


      if test $ac_cv_header_sys_types_h = yes; then

permit a complete make && make check

dan_gpg added a project: Restricted Project.Jun 3 2015, 5:30 PM
werner removed a project: Restricted Project.Sep 9 2015, 4:35 PM
werner added a subscriber: werner.

AFAIK, this is a bug in oner version of the OSX toolchain. Others have shown
that it is possible to build the vanilla tarball on OSX. If your problem
persists, please search the gnupg-users mailing lits and ask there for help.

werner claimed this task.
werner added a project: Not A Bug.