* cast warnings in default.pmc. Changing static int cant_do_method to
static long cant_do_method makes it compile without warnings, but its
not the right fix.
* Build fails with:
gcc -shared -fPIC -g \
-o runtime/parrot/dynext/libnci.so src/nci_test.o
/usr/bin/ld: src/nci_test.o: relocation R_X86_64_32 can not be used when
making a shared object; recompile with -fPIC
src/nci_test.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [runtime/parrot/dynext/libnci.so] Error 1
No idea how to fix this one...adding --ccflags=-fPIC doesn't help the
compile.
Below is a patch which fixes the first 3.
Brian Wheeler
bdwh...@indiana.edu
diff -ur ../parrot-0.1.1/classes/default.pmc ./classes/default.pmc
--- ../parrot-0.1.1/classes/default.pmc 2004-10-06 10:55:36.000000000 -0500
+++ ./classes/default.pmc 2004-10-13 23:22:01.089477209 -0500
@@ -52,7 +52,7 @@
*/
-static int
+static long
cant_do_method(Parrot_Interp interpreter, PMC * pmc, const char *methname)
{
internal_exception(ILL_INHERIT,
diff -ur ../parrot-0.1.1/config/auto/jit.pl ./config/auto/jit.pl
--- ../parrot-0.1.1/config/auto/jit.pl 2004-03-08 04:29:29.000000000 -0500
+++ ./config/auto/jit.pl 2004-10-13 22:59:05.551927726 -0500
@@ -171,9 +171,9 @@
else {
Configure::Data->set(
jitarchname => 'nojit',
- jitcpuarch => 'i386',
- jitcpu => 'I386',
- jitosname => 'nojit',
+ jitcpuarch => $cpuarch,
+ jitcpu => $cpuarch,
+ jitosname => $osname,
jitcapable => 0,
execcapable => 0,
cc_hasjit => '',
diff -ur ../parrot-0.1.1/config/auto/memalign/test_c2.in ./config/auto/memalign/test_c2.in
--- ../parrot-0.1.1/config/auto/memalign/test_c2.in 2003-07-13 13:52:58.000000000 -0500
+++ ./config/auto/memalign/test_c2.in 2004-10-13 23:09:54.875709999 -0500
@@ -20,6 +20,6 @@
* arbitrary allocation size)
*/
int i = posix_memalign(&p, s, 177);
- puts(((int)p & 0xff) == 0 && i == 0 ? "ok" : "nix");
+ puts(((${ptrcast})p & 0xff) == 0 && i == 0 ? "ok" : "nix");
return i;
}
diff -ur ../parrot-0.1.1/config/auto/memalign/test_c.in ./config/auto/memalign/test_c.in
--- ../parrot-0.1.1/config/auto/memalign/test_c.in 2003-07-13 13:52:58.000000000 -0500
+++ ./config/auto/memalign/test_c.in 2004-10-13 23:09:59.903596577 -0500
@@ -9,6 +9,6 @@
int main(int argc, char **argv) {
void *ptr = memalign(256, 17);
- puts(ptr && ((int)ptr & 0xff) == 0 ? "ok" : "nix");
+ puts(ptr && ((${ptrcast})ptr & 0xff) == 0 ? "ok" : "nix");
return 0;
}
diff -ur ../parrot-0.1.1/config/auto/memalign.pl ./config/auto/memalign.pl
--- ../parrot-0.1.1/config/auto/memalign.pl 2004-03-13 13:46:24.000000000 -0500
+++ ./config/auto/memalign.pl 2004-10-13 23:09:48.870037359 -0500
@@ -39,6 +39,14 @@
Configure::Data->set('malloc_header', 'stdlib.h');
}
+ if (Configure::Data->get('ptrsize') == Configure::Data->get('intsize')) {
+ Configure::Data->set('ptrcast','int');
+ }
+ else {
+ Configure::Data->set('ptrcast','long');
+ }
+
+
cc_gen('config/auto/memalign/test_c.in');
eval { cc_build(); };
unless ($@ || cc_run_capture() !~ /ok/) {
Better would be to split the return statement and the exception in the
generated code.
> Below is a patch which fixes the first 3.
Doesn't apply. Please rediff to current CVS and attach the patch.
Thanks,
leo
Here's the diff against the current CVS. It doesn't mess with the
default class that needs the split for the return & exception.
Brian Wheeler
bdwh...@indiana.edu
Index: config/auto/jit.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/jit.pl,v
retrieving revision 1.33
diff -u -r1.33 jit.pl
--- config/auto/jit.pl 8 Mar 2004 08:49:05 -0000 1.33
+++ config/auto/jit.pl 18 Oct 2004 05:25:57 -0000
@@ -171,9 +171,9 @@
else {
Configure::Data->set(
jitarchname => 'nojit',
- jitcpuarch => 'i386',
- jitcpu => 'I386',
- jitosname => 'nojit',
+ jitcpuarch => $cpuarch,
+ jitcpu => $cpuarch,
+ jitosname => $osname,
jitcapable => 0,
execcapable => 0,
cc_hasjit => '',
Index: config/auto/memalign.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign.pl,v
retrieving revision 1.10
diff -u -r1.10 memalign.pl
--- config/auto/memalign.pl 13 Oct 2004 14:37:59 -0000 1.10
+++ config/auto/memalign.pl 18 Oct 2004 05:25:57 -0000
@@ -42,6 +42,13 @@
Configure::Data->set('malloc_header', 'stdlib.h');
}
+ if (Configure::Data->get('ptrsize') == Configure::Data->get('intsize')) {
+ Configure::Data->set('ptrcast','int');
+ }
+ else {
+ Configure::Data->set('ptrcast','long');
+ }
+
cc_gen('config/auto/mema
> leolign/test_c.in');
eval { cc_build(); };
unless ($@ || cc_run_capture() !~ /ok/) {
Index: config/auto/memalign/test_c.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c.in,v
retrieving revision 1.4
diff -u -r1.4 test_c.in
--- config/auto/memalign/test_c.in 13 Jul 2003 18:52:37 -0000 1.4
+++ config/auto/memalign/test_c.in 18 Oct 2004 05:25:57 -0000
@@ -9,6 +9,6 @@
int main(int argc, char **argv) {
void *ptr = memalign(256, 17);
- puts(ptr && ((int)ptr & 0xff) == 0 ? "ok" : "nix");
+ puts(ptr && ((${ptrcast})ptr & 0xff) == 0 ? "ok" : "nix");
return 0;
}
Index: config/auto/memalign/test_c2.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c2.in,v
retrieving revision 1.3
diff -u -r1.3 test_c2.in
--- config/auto/memalign/test_c2.in 13 Jul 2003 18:52:37 -0000 1.3
+++ config/auto/memalign/test_c2.in 18 Oct 2004 05:25:57 -0000
> Here's the diff against the current CVS.
Please append the patch.
,--[ messed up ]---------------------------------------
| > +
| > cc_gen('config/auto/mema
|
| > On Thu, 2004-10-14 at 06:37, Leopold Toetsch wrote:
`------------------------------------------------------
leo
Brian
Index: config/auto/jit.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/jit.pl,v
retrieving revision 1.33
diff -u -r1.33 jit.pl
--- config/auto/jit.pl 8 Mar 2004 08:49:05 -0000 1.33
+++ config/auto/jit.pl 19 Oct 2004 18:38:41 -0000
@@ -171,9 +171,9 @@
else {
Configure::Data->set(
jitarchname => 'nojit',
- jitcpuarch => 'i386',
- jitcpu => 'I386',
- jitosname => 'nojit',
+ jitcpuarch => $cpuarch,
+ jitcpu => $cpuarch,
+ jitosname => $osname,
jitcapable => 0,
execcapable => 0,
cc_hasjit => '',
Index: config/auto/memalign.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign.pl,v
retrieving revision 1.10
diff -u -r1.10 memalign.pl
--- config/auto/memalign.pl 13 Oct 2004 14:37:59 -0000 1.10
+++ config/auto/memalign.pl 19 Oct 2004 18:38:41 -0000
@@ -42,6 +42,13 @@
Configure::Data->set('malloc_header', 'stdlib.h');
}
+ if (Configure::Data->get('ptrsize') == Configure::Data->get('intsize')) {
+ Configure::Data->set('ptrcast','int');
+ }
+ else {
+ Configure::Data->set('ptrcast','long');
+ }
+
cc_gen('config/auto/memalign/test_c.in');
eval { cc_build(); };
unless ($@ || cc_run_capture() !~ /ok/) {
Index: config/auto/memalign/test_c.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c.in,v
retrieving revision 1.4
diff -u -r1.4 test_c.in
--- config/auto/memalign/test_c.in 13 Jul 2003 18:52:37 -0000 1.4
+++ config/auto/memalign/test_c.in 19 Oct 2004 18:38:41 -0000
@@ -9,6 +9,6 @@
int main(int argc, char **argv) {
void *ptr = memalign(256, 17);
- puts(ptr && ((int)ptr & 0xff) == 0 ? "ok" : "nix");
+ puts(ptr && ((${ptrcast})ptr & 0xff) == 0 ? "ok" : "nix");
return 0;
}
Index: config/auto/memalign/test_c2.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c2.in,v
retrieving revision 1.3
diff -u -r1.3 test_c2.in
--- config/auto/memalign/test_c2.in 13 Jul 2003 18:52:37 -0000 1.3
+++ config/auto/memalign/test_c2.in 19 Oct 2004 18:38:41 -0000
Thanks, applied.
leo