MantisBT - CMake
View Issue Details
0013321CMakeCMakepublic2012-06-20 01:552012-11-05 14:33
Daniel Richard G. 
Brad King 
normalminoralways
closedfixed 
PA-RISCHP-UX11.00
CMake 2.8.8 
 
0013321: ABI.h doesn't know about older HP compilers
Bootstrapping CMake 2.8.8 on HP-UX 11.00 with the vendor-provided C compiler fails with

[ 0%] Building C object Utilities/KWIML/test/CMakeFiles/cmIML_test.dir/test_ABI_C.c.o
        cd /tmp/cmake-2.8.8/_build/Utilities/KWIML/test && /opt/ansic/bin/cc -DKWIML_NAMESPACE=cmIML -DKWIML_LANGUAGE_C -DKWIML_LANGUAGE_CXX -Aa -Ae -Ae +DA2.0 +ESlit +w1 -z -Wp,-H262144 +O2 -I/tmp/cmake-2.8.8/_build/Utilities/KWIML/test -I/tmp/cmake-2.8.8/_build/Utilities -o CMakeFiles/cmIML_test.dir/test_ABI_C.c.o -c /tmp/cmake-2.8.8/Utilities/KWIML/test/test_ABI_C.c
cpp: "/tmp/cmake-2.8.8/_build/Utilities/cmIML/ABI.h", line 163: error 4062: "Signedness of 'char' unknown."
cpp: "/tmp/cmake-2.8.8/_build/Utilities/cmIML/ABI.h", line 257: error 4062: "Existence of 'long long' unknown."
*** Error exit code 1


This compiler does not define __HP_cc nor __HP_aCC. I think it may be necessary to do the equivalent of

    #if defined(__hpux) && \
       !defined(__HP_cc) && \
       !defined(__HP_aCC) && \
       !defined(__GNUC__)

in order to catch this case. (__hpux is specifically mentioned in the cpp(1) man page.)

Version information on this compiler, for reference:

    $ cc -V -c foo.c
    cpp.ansi: HP92453-01 A.11.01.20 HP C Preprocessor (ANSI)
    ccom: HP92453-01 A.11.01.20 HP C Compiler
No tags attached.
related to 0013320closed Brad King UINT32_C() et al. macro shenanigans break build on HP-UX 
Issue History
2012-06-20 01:55Daniel Richard G.New Issue
2012-06-20 08:20Brad KingRelationship addedrelated to 0013320
2012-06-20 08:28Brad KingNote Added: 0029763
2012-06-20 11:53Daniel Richard G.Note Added: 0029770
2012-06-20 13:20Brad KingNote Added: 0029774
2012-06-20 13:22Brad KingNote Edited: 0029774bug_revision_view_page.php?bugnote_id=29774#r694
2012-06-21 01:13Daniel Richard G.Note Added: 0029792
2012-06-21 08:00Brad KingNote Edited: 0029792bug_revision_view_page.php?bugnote_id=29792#r702
2012-06-21 08:33Brad KingNote Added: 0029796
2012-06-21 08:33Brad KingAssigned To => Brad King
2012-06-21 08:33Brad KingStatusnew => resolved
2012-06-21 08:33Brad KingResolutionopen => fixed
2012-11-05 14:33David ColeNote Added: 0031459
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029763)
Brad King   
2012-06-20 08:28   
Does the compiler provide 'long long'? With size 8?

Is char signed by default? Does the +uc option (making char unsigned) add any preprocessor definitions?
(0029770)
Daniel Richard G.   
2012-06-20 11:53   
Both cc and gcc provide "long long" as well as [u]int64_t on this system. Both are size 8.

The char type is signed by default; the cc(1) man page mentions +uc. I see nothing in there about cpp symbols being affected by this option.
(0029774)
Brad King   
2012-06-20 13:20   
(edited on: 2012-06-20 13:22)
Try this patch:
diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in
index e85a1c5..33b2f8c 100644
--- a/Utilities/KWIML/ABI.h.in
+++ b/Utilities/KWIML/ABI.h.in
@@ -156,6 +156,8 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
 #  define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
 # elif defined(__BORLANDC__) /* Borland default */
 #  define @KWIML@_ABI_CHAR_IS_SIGNED 1
+# elif defined(__hpux) /* Old HP: no __HP_cc/__HP_aCC/__GNUC__ above */
+#  define @KWIML@_ABI_CHAR_IS_SIGNED 1 /* (unless +uc) */
 # endif
 #endif
 #if !defined(@KWIML@_ABI_CHAR_IS_UNSIGNED) && !defined(@KWIML@_ABI_CHAR_IS_SIGNED) \
@@ -239,6 +241,8 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
 #  define @KWIML@_ABI_SIZEOF_LONG_LONG 8
 # elif defined(__INTEL_COMPILER) /* Intel */
 #  define @KWIML@_ABI_SIZEOF_LONG_LONG 8
+# elif defined(__GNUC__) /* GNU */
+#  define @KWIML@_ABI_SIZEOF_LONG_LONG 8
 # elif defined(__BORLANDC__) /* Borland */
 #  if __BORLANDC__ >= 0x0560
 #   define @KWIML@_ABI_SIZEOF_LONG_LONG 8
@@ -251,6 +255,8 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
 #  else
 #   define @KWIML@_ABI_SIZEOF_LONG_LONG 0
 #  endif
+# elif defined(__hpux) /* Old HP: no __HP_cc/__HP_aCC/__GNUC__ above */
+#  define @KWIML@_ABI_SIZEOF_LONG_LONG 8
 # endif
 #endif
 #if !defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && !defined(@KWIML@_ABI_NO_ERROR_LONG_LONG)


(0029792)
Daniel Richard G.   
2012-06-21 01:13   
(edited on: 2012-06-21 08:00)
As reported in 0013320:0029791, building with cc now gets at least as far as cmIML_test (and finishes successfully with gcc). The patch checks out for me.

(I'm a little leery of presuming that __GNUC__ means an eight-byte "long long", however, simply because gcc exists in so many different forms...)

(0029796)
Brad King   
2012-06-21 08:33   
Applied fix without assumption for GNU:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6dc05311 [^]
(0031459)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.