Pcc: constant too big for cross-compiler

e$B@.@%$G$9!#e(B

pcc 0.9.8 for i386–netbsdelf e$B$Ge(B trunk
e$B$r%3%s%Q%$%k$7$h$&$H$9$k$H!"e(B

pcc -g -O2 -fPIC -I. -I.ext/include/i386-netbsdelf3.1.1.
-I…/trunk/include -I…/trunk -DRUBY_EXPORT -c …/trunk/array.c
…/trunk/include/ruby/ruby.h, line 686: constant too big for
cross-compiler
…/trunk/include/ruby/ruby.h, line 690: constant too big for
cross-compiler
*** Error code 1

Stop.

e$B$HE$i$l$k$N$G$9$,!"$3$l$O;EMM$H9M$($F$$$$$N$G$7$g$&$+!#e(B

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B$HE$i$l$k$N$G$9$,!"$3$l$O;EMM$H9M$($F$$$$$N$G$7$g$&$+!#e(B
e$B$=$C$+!#e(Benum e$B$Oe(B int e$B$^$G$7$+J]>Z$5$l$F$J$$$s$G$9$M!#e(B

e$B0J2<$G$I$&$G$7$g$&$+!#e(B

Index: include/ruby/ruby.h

— include/ruby/ruby.h (e$B%j%S%8%g%se(B 13647)
+++ include/ruby/ruby.h (e$B:n6H%3%T!<e(B)
@@ -626,67 +626,65 @@

enum ruby_value_flags {
RUBY_FL_MARK = (1<<5),
-#define FL_MARK RUBY_FL_MARK
+#define FL_MARK ((VALUE)RUBY_FL_MARK)
RUBY_FL_RESERVED = (1<<6) /* will be used in the future GC */,
-#define FL_RESERVED RUBY_FL_RESERVED
+#define FL_RESERVED ((VALUE)RUBY_FL_RESERVED)
RUBY_FL_FINALIZE = (1<<7),
-#define FL_FINALIZE RUBY_FL_FINALIZE
+#define FL_FINALIZE ((VALUE)RUBY_FL_FINALIZE)
RUBY_FL_TAINT = (1<<8),
-#define FL_TAINT RUBY_FL_TAINT
+#define FL_TAINT ((VALUE)RUBY_FL_TAINT)
RUBY_FL_EXIVAR = (1<<9),
-#define FL_EXIVAR RUBY_FL_EXIVAR
+#define FL_EXIVAR ((VALUE)RUBY_FL_EXIVAR)
RUBY_FL_FREEZE = (1<<10),
-#define FL_FREEZE RUBY_FL_FREEZE
+#define FL_FREEZE ((VALUE)RUBY_FL_FREEZE)
RUBY_FL_SINGLETON = (1<<11),
-#define FL_SINGLETON RUBY_FL_SINGLETON
+#define FL_SINGLETON ((VALUE)RUBY_FL_SINGLETON)

 RUBY_FL_USHIFT    = 11,

-#define FL_USHIFT RUBY_FL_USHIFT
+#define FL_USHIFT ((VALUE)RUBY_FL_USHIFT)

 RUBY_FL_USER0     = (1<<(FL_USHIFT+0)),

-#define FL_USER0 RUBY_FL_USER0
+#define FL_USER0 ((VALUE)RUBY_FL_USER0)
RUBY_FL_USER1 = (1<<(FL_USHIFT+1)),
-#define FL_USER1 RUBY_FL_USER1
+#define FL_USER1 ((VALUE)RUBY_FL_USER1)
RUBY_FL_USER2 = (1<<(FL_USHIFT+2)),
-#define FL_USER2 RUBY_FL_USER2
+#define FL_USER2 ((VALUE)RUBY_FL_USER2)
RUBY_FL_USER3 = (1<<(FL_USHIFT+3)),
-#define FL_USER3 RUBY_FL_USER3
+#define FL_USER3 ((VALUE)RUBY_FL_USER3)
RUBY_FL_USER4 = (1<<(FL_USHIFT+4)),
-#define FL_USER4 RUBY_FL_USER4
+#define FL_USER4 ((VALUE)RUBY_FL_USER4)
RUBY_FL_USER5 = (1<<(FL_USHIFT+5)),
-#define FL_USER5 RUBY_FL_USER5
+#define FL_USER5 ((VALUE)RUBY_FL_USER5)
RUBY_FL_USER6 = (1<<(FL_USHIFT+6)),
-#define FL_USER6 RUBY_FL_USER6
+#define FL_USER6 ((VALUE)RUBY_FL_USER6)
RUBY_FL_USER7 = (1<<(FL_USHIFT+7)),
-#define FL_USER7 RUBY_FL_USER7
+#define FL_USER7 ((VALUE)RUBY_FL_USER7)
RUBY_FL_USER8 = (1<<(FL_USHIFT+8)),
-#define FL_USER8 RUBY_FL_USER8
+#define FL_USER8 ((VALUE)RUBY_FL_USER8)
RUBY_FL_USER9 = (1<<(FL_USHIFT+9)),
-#define FL_USER9 RUBY_FL_USER9
+#define FL_USER9 ((VALUE)RUBY_FL_USER9)
RUBY_FL_USER10 = (1<<(FL_USHIFT+10)),
-#define FL_USER10 RUBY_FL_USER10
+#define FL_USER10 ((VALUE)RUBY_FL_USER10)
RUBY_FL_USER11 = (1<<(FL_USHIFT+11)),
-#define FL_USER11 RUBY_FL_USER11
+#define FL_USER11 ((VALUE)RUBY_FL_USER11)
RUBY_FL_USER12 = (1<<(FL_USHIFT+12)),
-#define FL_USER12 RUBY_FL_USER12
+#define FL_USER12 ((VALUE)RUBY_FL_USER12)
RUBY_FL_USER13 = (1<<(FL_USHIFT+13)),
-#define FL_USER13 RUBY_FL_USER13
+#define FL_USER13 ((VALUE)RUBY_FL_USER13)
RUBY_FL_USER14 = (1<<(FL_USHIFT+14)),
-#define FL_USER14 RUBY_FL_USER14
+#define FL_USER14 ((VALUE)RUBY_FL_USER14)
RUBY_FL_USER15 = (1<<(FL_USHIFT+15)),
-#define FL_USER15 RUBY_FL_USER15
+#define FL_USER15 ((VALUE)RUBY_FL_USER15)
RUBY_FL_USER16 = (1<<(FL_USHIFT+16)),
-#define FL_USER16 RUBY_FL_USER16
+#define FL_USER16 ((VALUE)RUBY_FL_USER16)
RUBY_FL_USER17 = (1<<(FL_USHIFT+17)),
-#define FL_USER17 RUBY_FL_USER17
+#define FL_USER17 ((VALUE)RUBY_FL_USER17)
RUBY_FL_USER18 = (1<<(FL_USHIFT+18)),
-#define FL_USER18 RUBY_FL_USER18
+#define FL_USER18 ((VALUE)RUBY_FL_USER18)
RUBY_FL_USER19 = (1<<(FL_USHIFT+19)),
-#define FL_USER19 RUBY_FL_USER19
+#define FL_USER19 ((VALUE)RUBY_FL_USER19)
RUBY_FL_USER20 = (1<<(FL_USHIFT+20)),
-#define FL_USER20 RUBY_FL_USER20

  • RUBY_FL_DUMMY = ~(VALUE)0 >> 1 /* make sizeof(enum
    ruby_value_flags)
  •                                       equal to sizeof(VALUE). */
    

+#define FL_USER20 ((VALUE)RUBY_FL_USER20)
};

#define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x))

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B$.$j$.$j$G%(%i!<$,=P$^$9$M!#e(B

e$B$L$%!#$G$Oe(B enum e$B$8$c$J$/$Fe(B const
e$B$K$9$k$H$$$&$3$H$G0J2<$J$ie(B
e$B$I$&$G$7$g$&$+!#e(B

Index: include/ruby/ruby.h

— include/ruby/ruby.h (e$B%j%S%8%g%se(B 13647)
+++ include/ruby/ruby.h (e$B:n6H%3%T!<e(B)
@@ -624,71 +624,40 @@
#define RFILE(obj) (R_CAST(RFile)(obj))
#define RVALUES(obj) (R_CAST(RValues)(obj))

-enum ruby_value_flags {

  • RUBY_FL_MARK = (1<<5),
    -#define FL_MARK RUBY_FL_MARK

  • RUBY_FL_RESERVED = (1<<6) /* will be used in the future GC */,
    -#define FL_RESERVED RUBY_FL_RESERVED

  • RUBY_FL_FINALIZE = (1<<7),
    -#define FL_FINALIZE RUBY_FL_FINALIZE

  • RUBY_FL_TAINT = (1<<8),
    -#define FL_TAINT RUBY_FL_TAINT

  • RUBY_FL_EXIVAR = (1<<9),
    -#define FL_EXIVAR RUBY_FL_EXIVAR

  • RUBY_FL_FREEZE = (1<<10),
    -#define FL_FREEZE RUBY_FL_FREEZE

  • RUBY_FL_SINGLETON = (1<<11),
    -#define FL_SINGLETON RUBY_FL_SINGLETON
    +#define FL_MARK ((VALUE)(1<<5))

  • RUBY_FL_USHIFT = 11,
    -#define FL_USHIFT RUBY_FL_USHIFT
    +/* will be used in the future GC */
    +#define FL_RESERVED ((VALUE)(1<<6))

  • RUBY_FL_USER0 = (1<<(FL_USHIFT+0)),
    -#define FL_USER0 RUBY_FL_USER0

  • RUBY_FL_USER1 = (1<<(FL_USHIFT+1)),
    -#define FL_USER1 RUBY_FL_USER1

  • RUBY_FL_USER2 = (1<<(FL_USHIFT+2)),
    -#define FL_USER2 RUBY_FL_USER2

  • RUBY_FL_USER3 = (1<<(FL_USHIFT+3)),
    -#define FL_USER3 RUBY_FL_USER3

  • RUBY_FL_USER4 = (1<<(FL_USHIFT+4)),
    -#define FL_USER4 RUBY_FL_USER4

  • RUBY_FL_USER5 = (1<<(FL_USHIFT+5)),
    -#define FL_USER5 RUBY_FL_USER5

  • RUBY_FL_USER6 = (1<<(FL_USHIFT+6)),
    -#define FL_USER6 RUBY_FL_USER6

  • RUBY_FL_USER7 = (1<<(FL_USHIFT+7)),
    -#define FL_USER7 RUBY_FL_USER7

  • RUBY_FL_USER8 = (1<<(FL_USHIFT+8)),
    -#define FL_USER8 RUBY_FL_USER8

  • RUBY_FL_USER9 = (1<<(FL_USHIFT+9)),
    -#define FL_USER9 RUBY_FL_USER9

  • RUBY_FL_USER10 = (1<<(FL_USHIFT+10)),
    -#define FL_USER10 RUBY_FL_USER10

  • RUBY_FL_USER11 = (1<<(FL_USHIFT+11)),
    -#define FL_USER11 RUBY_FL_USER11

  • RUBY_FL_USER12 = (1<<(FL_USHIFT+12)),
    -#define FL_USER12 RUBY_FL_USER12

  • RUBY_FL_USER13 = (1<<(FL_USHIFT+13)),
    -#define FL_USER13 RUBY_FL_USER13

  • RUBY_FL_USER14 = (1<<(FL_USHIFT+14)),
    -#define FL_USER14 RUBY_FL_USER14

  • RUBY_FL_USER15 = (1<<(FL_USHIFT+15)),
    -#define FL_USER15 RUBY_FL_USER15

  • RUBY_FL_USER16 = (1<<(FL_USHIFT+16)),
    -#define FL_USER16 RUBY_FL_USER16

  • RUBY_FL_USER17 = (1<<(FL_USHIFT+17)),
    -#define FL_USER17 RUBY_FL_USER17

  • RUBY_FL_USER18 = (1<<(FL_USHIFT+18)),
    -#define FL_USER18 RUBY_FL_USER18

  • RUBY_FL_USER19 = (1<<(FL_USHIFT+19)),
    -#define FL_USER19 RUBY_FL_USER19

  • RUBY_FL_USER20 = (1<<(FL_USHIFT+20)),
    -#define FL_USER20 RUBY_FL_USER20

  • RUBY_FL_DUMMY = ~(VALUE)0 >> 1 /* make sizeof(enum
    ruby_value_flags)

  •                                       equal to sizeof(VALUE). */
    

-};
+#define FL_FINALIZE ((VALUE)(1<<7))
+#define FL_TAINT ((VALUE)(1<<8))
+#define FL_EXIVAR ((VALUE)(1<<9))
+#define FL_FREEZE ((VALUE)(1<<10))
+#define FL_SINGLETON ((VALUE)(1<<11))

+#define FL_USHIFT 11
+#define FL_USER0 ((VALUE)(1<<(FL_USHIFT+0)))
+#define FL_USER1 ((VALUE)(1<<(FL_USHIFT+1)))
+#define FL_USER2 ((VALUE)(1<<(FL_USHIFT+2)))
+#define FL_USER3 ((VALUE)(1<<(FL_USHIFT+3)))
+#define FL_USER4 ((VALUE)(1<<(FL_USHIFT+4)))
+#define FL_USER5 ((VALUE)(1<<(FL_USHIFT+5)))
+#define FL_USER6 ((VALUE)(1<<(FL_USHIFT+6)))
+#define FL_USER7 ((VALUE)(1<<(FL_USHIFT+7)))
+#define FL_USER8 ((VALUE)(1<<(FL_USHIFT+8)))
+#define FL_USER9 ((VALUE)(1<<(FL_USHIFT+9)))
+#define FL_USER10 ((VALUE)(1<<(FL_USHIFT+10)))
+#define FL_USER11 ((VALUE)(1<<(FL_USHIFT+11)))
+#define FL_USER12 ((VALUE)(1<<(FL_USHIFT+12)))
+#define FL_USER13 ((VALUE)(1<<(FL_USHIFT+13)))
+#define FL_USER14 ((VALUE)(1<<(FL_USHIFT+14)))
+#define FL_USER15 ((VALUE)(1<<(FL_USHIFT+15)))
+#define FL_USER16 ((VALUE)(1<<(FL_USHIFT+16)))
+#define FL_USER17 ((VALUE)(1<<(FL_USHIFT+17)))
+#define FL_USER18 ((VALUE)(1<<(FL_USHIFT+18)))
+#define FL_USER19 ((VALUE)(1<<(FL_USHIFT+19)))
+#define FL_USER20 ((VALUE)(1<<(FL_USHIFT+20)))
+
#define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x))

#define FL_ABLE(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) != T_NODE)
Index: ruby.c

— ruby.c (e$B%j%S%8%g%se(B 13647)
+++ ruby.c (e$B:n6H%3%T!<e(B)
@@ -58,11 +58,40 @@
static const union {
enum ruby_special_consts special_consts;
enum ruby_value_type value_type;

  • enum ruby_value_flags value_flags;
    enum node_type node_type;
    enum ruby_node_flags node_flags;
    } dummy_gdb_enums;

+const VALUE RUBY_FL_MARK = FL_MARK;
+const VALUE RUBY_FL_RESERVED = FL_RESERVED;
+const VALUE RUBY_FL_FINALIZE = FL_FINALIZE;
+const VALUE RUBY_FL_TAINT = FL_TAINT;
+const VALUE RUBY_FL_EXIVAR = FL_EXIVAR;
+const VALUE RUBY_FL_FREEZE = FL_FREEZE;
+const VALUE RUBY_FL_SINGLETON = FL_SINGLETON;
+const VALUE RUBY_FL_USER0 = FL_USER0;
+const VALUE RUBY_FL_USER1 = FL_USER1;
+const VALUE RUBY_FL_USER2 = FL_USER2;
+const VALUE RUBY_FL_USER3 = FL_USER3;
+const VALUE RUBY_FL_USER4 = FL_USER4;
+const VALUE RUBY_FL_USER5 = FL_USER5;
+const VALUE RUBY_FL_USER6 = FL_USER6;
+const VALUE RUBY_FL_USER7 = FL_USER7;
+const VALUE RUBY_FL_USER8 = FL_USER8;
+const VALUE RUBY_FL_USER9 = FL_USER9;
+const VALUE RUBY_FL_USER10 = FL_USER10;
+const VALUE RUBY_FL_USER11 = FL_USER11;
+const VALUE RUBY_FL_USER12 = FL_USER12;
+const VALUE RUBY_FL_USER13 = FL_USER13;
+const VALUE RUBY_FL_USER14 = FL_USER14;
+const VALUE RUBY_FL_USER15 = FL_USER15;
+const VALUE RUBY_FL_USER16 = FL_USER16;
+const VALUE RUBY_FL_USER17 = FL_USER17;
+const VALUE RUBY_FL_USER18 = FL_USER18;
+const VALUE RUBY_FL_USER19 = FL_USER19;
+const VALUE RUBY_FL_USER20 = FL_USER20;
+const int RUBY_FL_USHIFT = FL_USHIFT;
+
#ifndef HAVE_STDLIB_H
char *getenv();
#endif

e$B@.@%$G$9!#e(B

Tanaka A. wrote:

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B$.$j$.$j$G%(%i!<$,=P$^$9$M!#e(B

e$B$L$%!#$G$Oe(B enum e$B$8$c$J$/$Fe(B const e$B$K$9$k$H$$$&$3$H$G0J2<$J$ie(B
e$B$I$&$G$7$g$&$+!#e(B

e$B$*$)!“DL$k$h$&$K$J$j$^$7$?!”$"$j$,$H$&$4$6$$$^$9!#e(B
e$BJL$N$H$3$m$G$3$1$k$h$&$K$J$C$?$N$G$=$l$O$^$?2~$a$F!#e(B

e$B@.@%$G$9!#e(B

NARUSE, Yui wrote:

e$BJL$N$H$3$m$G$3$1$k$h$&$K$J$C$?$N$G$=$l$O$^$?2~$a$F!#e(B

e$B$C$H!";W$C$?$iK\BN$OF0$/$h$&$K$J$C$?$N$G%a%b$^$G$K!#e(B
…/trunk/configure --program-suffix=19p && make CC=pcc CFLAGS="-g -O2
-D’__builtin_next_arg(last)=((char *)(&last) + __va_size(last))’"

e$B$G%3%s%Q%$%k$G$-$^$7$?e(B

e$B$J$*!"e(B–enable-shared e$B$r$D$1$k$H:G8e$N:G8e$Ge(B
making ruby19p
pcc -g -O2 -D’__builtin_next_arg(last)=((char *)(&last) +
__va_size(last))’ -L. -Wl,-export-dynamic main.o -Wl,-R
-Wl,/usr/local/lib -L/usr/local/lib -lruby19p -lpthread -lcrypt -lm -o
ruby19p
ld: warning: type and size of dynamic symbol ruby_run_node' are not defined ld: warning: type and size of dynamic symbolruby_sysinit’ are not
defined
ld: warning: type and size of dynamic symbol ruby_init_stack' are not defined ld: warning: type and size of dynamic symbolruby_init’ are not defined
ld: warning: type and size of dynamic symbol `ruby_options’ are not
defined
e$B$H%j%s%+$,E$j=P$7$^$9!#e(B

e$B@.@%$G$9!#e(B

Tanaka A. wrote:

Stop.

e$B$HE$i$l$k$N$G$9$,!"$3$l$O;EMM$H9M$($F$$$$$N$G$7$g$&$+!#e(B

e$B$=$C$+!#e(Benum e$B$Oe(B int e$B$^$G$7$+J]>Z$5$l$F$J$$$s$G$9$M!#e(B

e$B0J2<$G$I$&$G$7$g$&$+!#e(B

e$BAGAa$$JV?.$"$j$,$H$&$4$6$$$^$9!#e(B
e$B$.$j$.$j$G%(%i!<$,=P$^$9$M!#e(B

pcc -g -I. -I.ext/include/i386-netbsdelf3.1.1. -I…/trunk/include
-I…/trunk -DRUBY_EXPORT -c …/trunk/array.c
…/trunk/include/ruby/ruby.h, line 686: constant too big for
cross-compiler
*** Error code 1

Stop.
make: stopped in /home/naruse/src/ruby/pcc-trunk

686e$B9TL$Ne(B
RUBY_FL_USER20 = (1<<(FL_USHIFT+20)),
e$B$,e(B2147483648e$B$@$+$ie(B1e$B%*!<%P!<$H$$$&$3$H$G$7$g$&$+!#e(B