Hello! I got problems with building CLN on PowerPC64. uname -a Linux blade1 2.6.5-7.252-pseries64 #1 SMP Tue Feb 14 11:11:04 UTC 2006 ppc64 ppc64 ppc64 GNU/Linux make ... In file included from base/cl_N.h:6, from base/cl_as_err.cc:7: ../include/cln/number.h: In constructor `cln::cl_number::cl_number()': ../include/cln/number.h:191: error: `cl_FN_tag' undeclared (first use this function) ../include/cln/number.h:191: error: (Each undeclared identifier is reported only once for each function it appears in.) And it seems i know why does it happen: <config.h> ... #ifndef __powerpc64__ #define __powerpc64__ 1 #endif ... <object.h> ... #if defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__sparc64__) || defined(__x86_64__) #define cl_word_alignment 8 #endif ... // Definition of the tags. #if !defined(CL_WIDE_POINTERS) #if (cl_word_alignment == 2) #define cl_FN_tag 1 #define cl_SF_tag 3 // must satisfy the cl_immediate_p predicate! #endif #if (cl_word_alignment == 4) #define cl_FN_tag 1 #define cl_SF_tag 2 #endif #else // CL_WIDE_POINTERS // Single Floats are immediate as well. #define cl_FN_tag 1 #define cl_SF_tag 2 #define cl_FF_tag 3 #endif There is no branch defining tags for powerpc64 (cl_word_alignment==8) Please, tell me what values should i write in #define or explain what am i doing wrong. Thank you! -- Best regards, Dmitry mailto:khutornoy@gmail.com
Hello, Dmitry Khutornoy wrote:
I got problems with building CLN on PowerPC64.
uname -a Linux blade1 2.6.5-7.252-pseries64 #1 SMP Tue Feb 14 11:11:04 UTC 2006 ppc64 ppc64 ppc64 GNU/Linux
make ... In file included from base/cl_N.h:6, from base/cl_as_err.cc:7: ../include/cln/number.h: In constructor `cln::cl_number::cl_number()': ../include/cln/number.h:191: error: `cl_FN_tag' undeclared (first use this function) ../include/cln/number.h:191: error: (Each undeclared identifier is reported only once for each function it appears in.)
And it seems i know why does it happen:
<config.h> ... #ifndef __powerpc64__ #define __powerpc64__ 1 #endif ...
<object.h> ... #if defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__sparc64__) || defined(__x86_64__) #define cl_word_alignment 8 #endif ... // Definition of the tags. #if !defined(CL_WIDE_POINTERS) #if (cl_word_alignment == 2) #define cl_FN_tag 1 #define cl_SF_tag 3 // must satisfy the cl_immediate_p predicate! #endif #if (cl_word_alignment == 4) #define cl_FN_tag 1 #define cl_SF_tag 2 #endif #else // CL_WIDE_POINTERS // Single Floats are immediate as well. #define cl_FN_tag 1 #define cl_SF_tag 2 #define cl_FF_tag 3 #endif
There is no branch defining tags for powerpc64 (cl_word_alignment==8)
On 64-bit CPUs the macro CL_WIDE_POINTERS should be defined. Can you please show the contents of the autogenerated cln/intparam.h ? Bruno
Hello Bruno, thanks for answer! Here is cln/intparam.h: /* Integers of type char have 8 bits. */ #define char_bitsize 8 /* Integers of type short have 16 bits. */ #define short_bitsize 16 /* Integers of type int have 32 bits. */ #define int_bitsize 32 /* Integers of type long have 32 bits. */ #define long_bitsize 32 /* Integers of type long long have 64 bits. */ #define long_long_bitsize 64 /* Integers of type unsigned char have 8 bits. */ /* Integers of type unsigned short have 16 bits. */ /* Integers of type unsigned int have 32 bits. */ /* Integers of type unsigned long have 32 bits. */ /* Integers of type unsigned long long have 64 bits. */ /* Integer types char and unsigned char have the same binary representation. */ /* Integer types short and unsigned short have the same binary representation. */ /* Integer types int and unsigned int have the same binary representation. */ /* Integer types long and unsigned long have the same binary representation. */ /* Integer types long long and unsigned long long have the same binary representation. */ /* Pointers of type char * have 32 bits. */ #define pointer_bitsize 32 /* Casts from long * to char * is OK (does nothing). */ /* Casts from char * to long * is OK (does nothing). */ /* Casts from function * to char * is OK (does nothing). */ /* Casts from char * to function * is OK (does nothing). */ /* Type char has sizeof = 1 and alignment = 1. */ #define sizeof_char 1 #define alignment_char 1 /* Type unsigned char has sizeof = 1 and alignment = 1. */ /* Type short has sizeof = 2 and alignment = 2. */ #define sizeof_short 2 #define alignment_short 2 /* Type unsigned short has sizeof = 2 and alignment = 2. */ /* Type int has sizeof = 4 and alignment = 4. */ #define sizeof_int 4 #define alignment_int 4 /* Type unsigned int has sizeof = 4 and alignment = 4. */ /* Type long has sizeof = 4 and alignment = 4. */ #define sizeof_long 4 #define alignment_long 4 /* Type unsigned long has sizeof = 4 and alignment = 4. */ /* Type long long has sizeof = 8 and alignment = 8. */ #define sizeof_long_long 8 #define alignment_long_long 8 /* Type unsigned long long has sizeof = 8 and alignment = 8. */ /* Type float has sizeof = 4 and alignment = 4. */ #define sizeof_float 4 #define alignment_float 4 /* Type double has sizeof = 8 and alignment = 8. */ #define sizeof_double 8 #define alignment_double 8 /* Type char * has sizeof = 4 and alignment = 4. */ /* Type long * has sizeof = 4 and alignment = 4. */ /* Type function * has sizeof = 4 and alignment = 4. */ /* Type unsigned short is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */ #define short_big_endian /* Type unsigned int is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */ #define int_big_endian /* Type unsigned long is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */ #define long_big_endian /* Type unsigned long long is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */ #define long_long_big_endian /* Stack grows down, ca. 32 bytes per function call. */ #define stack_grows_down Thursday, March 30, 2006, 4:54:13 PM, you wrote:
On 64-bit CPUs the macro CL_WIDE_POINTERS should be defined. Can you please show the contents of the autogenerated cln/intparam.h ?
Bruno
-- Best regards, Dmitry mailto:khutornoy@gmail.com
Dmitry Khutornoy wrote:
/* Integers of type long have 32 bits. */ #define long_bitsize 32 /* Pointers of type char * have 32 bits. */ #define pointer_bitsize 32
OK, you are compiling in PowerPC 32-bit mode, but CLN's configuration was confused because you have a 64-bit CPU. The immediate workaround for you is to change include/cln/config.h so that it defines __rs6000__ and not __powerpc64__, do a "make clean" and "make". The fix should be to add code to m4/general.m4 to distinguish 32-bit and 64-bit PowerPC, like it's already done for Sparc / Sparc64. Can someone please do that? I don't have the time. Bruno
Hello. I have tried to compile with defined __rs6000__ and make reports following error now: ... g++ -shared -nostdlib /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib/crti.o /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtbeginS.o .libs/cl_abort.o ... -Wl,--rpath -Wl,/usr/lib/../lib -Wl,--rpath -Wl,/usr/lib/../lib -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3 -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../powerpc-suse-linux/lib/../lib -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../powerpc-suse-linux/lib -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../.. -L/lib/../lib -L/usr/lib/../lib /usr/lib/../lib/libstdc++.so -lm -lc -lgcc_s /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtsavres.o /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtendS.o /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib/crtn.o -Wl,-soname -Wl,libcln.so.4 -o .libs/libcln.so.4.0.1 make[1]: Leaving directory `/nethome/apa/cln-1.1.11/src' /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../powerpc-suse-linux/bin/ld: Error: The symbol `cl_module__cl_prin_globals__ctorend' has a R_PPC_REL24 relocation, that means '.libs/cl_prin_globals.o' was compiled without -fPIC. collect2: ld returned 1 exit status make[1]: *** [libcln.la] Error 1 make: *** [all] Error 2 though everything was compiled with -fPIC: g++ -O -I../include -I../include -I./base -c ./base/output/cl_prin_globals.cc -fPIC -DPIC -o .libs/cl_prin_globals.o Maybe this is completely different problem and it is concerned with system i'm compiling on so i post again my configuration: Linux blade1 2.6.5-7.252-pseries64 #1 SMP Tue Feb 14 11:11:04 UTC 2006 ppc64 ppc64 ppc64 GNU/Linux
OK, you are compiling in PowerPC 32-bit mode, but CLN's configuration was confused because you have a 64-bit CPU.
The immediate workaround for you is to change include/cln/config.h so that it defines __rs6000__ and not __powerpc64__, do a "make clean" and "make".
The fix should be to add code to m4/general.m4 to distinguish 32-bit and 64-bit PowerPC, like it's already done for Sparc / Sparc64. Can someone please do that? I don't have the time.
-- Best regards, Dmitry mailto:khutornoy@gmail.com
Hi, On 2006-03-30, Bruno Haible wrote:
Dmitry Khutornoy wrote:
/* Integers of type long have 32 bits. */ #define long_bitsize 32 /* Pointers of type char * have 32 bits. */ #define pointer_bitsize 32
OK, you are compiling in PowerPC 32-bit mode, but CLN's configuration was confused because you have a 64-bit CPU.
The immediate workaround for you is to change include/cln/config.h so that it defines __rs6000__ and not __powerpc64__, do a "make clean" and "make".
The fix should be to add code to m4/general.m4 to distinguish 32-bit and 64-bit PowerPC, like it's already done for Sparc / Sparc64. Can someone please do that? I don't have the time.
According to the GCC sources, __powerpc64__ is a builtin define. So, I wonder if this patch is safe to apply without being able to do any testing whatsoever: Index: general.m4 =================================================================== RCS file: /home/cvs/cln/m4/general.m4,v retrieving revision 1.3 diff -u -r1.3 general.m4 --- general.m4 13 Jun 2006 18:31:18 -0000 1.3 +++ general.m4 5 Dec 2007 21:01:39 -0000 @@ -200,6 +200,21 @@ else host_cpu=i386 fi +dnl PowerPC64 is another case where 'uname -m' and userland may disagree. + powerpc64 ) + AC_CACHE_CHECK([for 64-bit userland on powerpc64], cl_cv_host_powerpc64, [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#if !defined __powerpc64__ +# error __powerpc64__ not defined +#endif +]]) +], [cl_cv_host_powerpc64=yes], [cl_cv_host_powerpc64=no]) +]) +if test $cl_cv_host_powerpc64 = yes; then + host_cpu=powerpc64 +else + host_cpu=powerpc +fi ;; esac dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (3)
-
Bruno Haible
-
Dmitry Khutornoy
-
Richard B. Kreckel