Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with 0.1.1 release on x86-64

0 views
Skip to first unread message

Brian Wheeler

unread,
Oct 14, 2004, 1:11:18 AM10/14/04
to perl6-i...@perl.org
* PARROT_CPU_ARCH is defined as "i386" and PARROT_OS_NAME is "nojit"
when jit determination fails. It now correctly (?) reports 'x86_64' and
'linux'.

* Memory alignment tests warn about a pointer size difference in cast.
A new configuration setting ptrcast is either 'int' or 'long' depending
on what type a pointer is safe to cast to/from. I suspect that all
cases will be 'long', but you never really know.

* 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/) {


Leopold Toetsch

unread,
Oct 14, 2004, 7:37:43 AM10/14/04
to Brian Wheeler, perl6-i...@perl.org
Brian Wheeler wrote:
>
> * 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.

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

Brian Wheeler

unread,
Oct 18, 2004, 1:28:01 AM10/18/04
to Leopold Toetsch, perl6-i...@perl.org
Sorry for the delay...work interfered with my playing and I had to
transfer my CVS repo to my x86-64 machine. I don't know if I'd
classify it as "silence thereafter..." as in the summary, but its pretty
close :)

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

Leopold Toetsch

unread,
Oct 19, 2004, 5:01:06 AM10/19/04
to Brian Wheeler, perl6-i...@perl.org
Brian Wheeler <bdwh...@indiana.edu> wrote:

> 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 Wheeler

unread,
Oct 19, 2004, 2:40:40 PM10/19/04
to l...@toetsch.at, perl6-i...@perl.org
Sigh. I'll get this right sometime!

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

Leopold Toetsch

unread,
Oct 20, 2004, 4:03:19 AM10/20/04
to Brian Wheeler, perl6-i...@perl.org
Brian Wheeler <bdwh...@indiana.edu> wrote:
> Sigh. I'll get this right sometime!

Thanks, applied.
leo

0 new messages