Re: [Chicken-users] [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Nicolas Pelletier
Hello John,

Thank you for your suggestions. Here is the next episode of my sparc
adventures...

On Thu, Nov 10, 2011 at 00:36, John Cowan  wrote:
>
> Currently, sparc is not a supported CPU.  The first thing is to add it
> to the list of known CPU architectures.  Add the line
>
>        sparc) echo "sparc";;

I added the line as:

sun4u) echo "sparc";;

since this is what uname -m says.

> 1) Try copying apply-hack.sparc64.S to apply-hack.sparc.S and hope
> it works.  If it does build, be sure to run the tests.

This does not work. The assembler complains about setx, ldx... saying
instructions from a set more recent than sparcv8 are unsupported. Fair
enough. Looking at what the code does, it seems it expects the number
of arguments, and a base address for a function, treats the first 6
arguments as passed through registers and loads the rest from the
stack. Hmm... Now, looking a little at the output of objects with
objdump and dbx, here is how things look like on this machine:

the object format is elf32-sparc. I am unsure about the C ABI.
the addresses are 32-bit
the global and output registers seem to be 64 bits wide, the local and
input registers 32 bits wide (weird, maybe wrong).

There are some magic constants in the apply-hack.sparc64.S file which
I do not understand. What is the 2047? And the 176? The code just
before these looks as if it already reserved a "window" for the
registers on the stack, so what is this?

In the case of sparc, if it is possible to use the same general scheme
(no pun intended), I would have to replace ldx, sllx and co with
shorter instructions, saving the higher, then the lower part of the %g
and %o registers I suppose... And of course, modify the various other
constants (8, -2, 3) to accomodate for the different register width.
Does this make any kind of sense?

> 2) If that fails, try disabling APPLY_HACK by adding the following patch
> to Makefile.solaris after the comment line "# options":
>
> ifeq ($(ARCH),sparc)
>        APPLY_HACK=
> endif
>
> As far as I know, nobody has tried to build Chicken without an apply-hack
> in a long time.

This was a simple thing to do, but did not work. As the first part of
installilng chicken, I must first bootstrap it, with:

  gmake PLATFORM=solaris CHICKEN=/bin/true PREFIX=$HOME boot-chicken

and after compiling for a few moments, the build fails with:

gcc -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
-DC_ENABLE_PTABLES -c c-backend.c -o c-backend-static.o -I. -I./
gmake[2]: *** No rule to make target `apply-hack.sparc.S', needed by
`apply-hack.sparc.o'. Stop.

Note on the /bin/true part: README is lying ;-) There is no bootstrap
compiler included in the stable releases (1st lie), and there is no
pre-compiled bootstrap compiler to be downloaded from the Chicken site
(2nd lie). But thankfully the .c files are already there, so the
vicious circle of having chicken to bootstrap chicken does not happen.

Advice, comments, directions are most welcome.

-- 
Nicolas

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Christian Kellermann
* Nicolas Pelletier  [10 12:10]:
> Note on the /bin/true part: README is lying ;-) There is no bootstrap
> compiler included in the stable releases (1st lie), and there is no
> pre-compiled bootstrap compiler to be downloaded from the Chicken site
> (2nd lie). But thankfully the .c files are already there, so the
> vicious circle of having chicken to bootstrap chicken does not happen.

True, this aspect of the manual has been changed in master some
weeks ago.

-- 
Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Mario Domenech Goulart
Hi Nicolas,

On Thu, 10 Nov 2011 20:10:10 +0900 Nicolas Pelletier 
 wrote:

> Note on the /bin/true part: README is lying ;-) There is no bootstrap
> compiler included in the stable releases (1st lie), and there is no
> pre-compiled bootstrap compiler to be downloaded from the Chicken site
> (2nd lie).

I don't get the 1st lie.  What section mentions that?

The second lie has been fixed in the chicken-core git repository.

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Nicolas Pelletier
Hello Mario,

On Thu, Nov 10, 2011 at 20:05, Mario Domenech Goulart
 wrote:
> Hi Nicolas,
>
> On Thu, 10 Nov 2011 20:10:10 +0900 Nicolas Pelletier 
>  wrote:
>
>> Note on the /bin/true part: README is lying ;-) There is no bootstrap
>> compiler included in the stable releases (1st lie), and there is no
>> pre-compiled bootstrap compiler to be downloaded from the Chicken site
>> (2nd lie).
>
> I don't get the 1st lie.  What section mentions that?

I am refering to the secion "6. Bootstrapping" in README:

make PLATFORM= CHICKEN= boot-chicken

When I read this, I thought "path-to-existing-chicken" meant there was
an existing chicken included, which is not the case. On re-reading, I
am not sure this is what was meant... but telling the user to point to
an existing chicken when they are trying to bootstrap is certainly
confusing.

> The second lie has been fixed in the chicken-core git repository.

That was fast! Thank you!

-- 
Nicolas

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Mario Domenech Goulart
On Thu, 10 Nov 2011 20:34:24 +0900 Nicolas Pelletier 
 wrote:

> On Thu, Nov 10, 2011 at 20:05, Mario Domenech Goulart 
>  wrote:
>>
>> On Thu, 10 Nov 2011 20:10:10 +0900 Nicolas Pelletier 
>>  wrote:
>>
>>> Note on the /bin/true part: README is lying ;-) There is no bootstrap
>>> compiler included in the stable releases (1st lie), and there is no
>>> pre-compiled bootstrap compiler to be downloaded from the Chicken site
>>> (2nd lie).
>>
>> I don't get the 1st lie.  What section mentions that?
>
> I am refering to the secion "6. Bootstrapping" in README:
>
> make PLATFORM= CHICKEN= boot-chicken
>
> When I read this, I thought "path-to-existing-chicken" meant there was
> an existing chicken included, which is not the case. On re-reading, I
> am not sure this is what was meant... but telling the user to point to
> an existing chicken when they are trying to bootstrap is certainly
> confusing.

Oh, I see.  That section has also been fixed in git.  Here's what it
is now:

 6. Bootstrapping

To build a bootstrapping compiler yourself, get the most
recent release tarball from http://code.call-cc.org, unpack
it, build and install it.  Then change to the directory
containing the git code and run:

  make PLATFORM= CHICKEN= \
boot-chicken

This will produce a statically linked binary with the name
"chicken-boot[.exe]" that can be given as the value of the
"CHICKEN" argument when invoking make(1). Note that the path
to an existing `chicken' binary must be given to use it for
compiling the Scheme code of the runtime-system and compiler.


I hope it is better now.  Please, let us know if you have improvement
suggestions.

Regarding READMEs in the release and stability tarballs, they indeed
have some mistakes that have been fixed in the git repo.

Thanks for the heads-up.

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] 64-bit SPARC build - Re: [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Toby Thain

On 09/11/11 6:48 AM, Nicolas Pelletier wrote:

Hello Chickeners,

today I tried to compile the latest stable Chicken, 4.7.0.3-st on
Solaris 10 (sparc), only to find out the the build fails: I used

 gmake PLATFORM=SunOS PREFIX=$HOME



As invited my mario-goulart, I tried this on a fairly old *64 bit* system.

   Solaris 10 6/06 s10s_u2wos_09a SPARC

1) As a side note, this promise doesn't seem to be kept:

Enter "make" without any options to see a list of supported
platforms.

-bash-3.00$ uname -a
SunOS e450 5.10 Generic_118833-17 sun4u sparc SUNW,Ultra-4
-bash-3.00$ gmake
GNUmakefile:42: *** No PLATFORM given..  Stop.

2) GNU make 3.82 is required. Version 3.80 did not work for me:

-bash-3.00$ gmake PLATFORM=solaris PREFIX=$HOME/chicken
gmake -f ./Makefile.solaris CONFIG= all
gmake[1]: Entering directory `/pool/home/toby/chicken/chicken-4.7.0.3-st'
rules.make:113: *** missing separator.  Stop.
gmake[1]: Leaving directory `/pool/home/toby/chicken/chicken-4.7.0.3-st'
gmake: *** [all] Error 2
-bash-3.00$ gmake --version
GNU Make 3.80

(I installed make-3.82 from Sun Freeware:
http://sunfreeware.com/indexsparc10.html )

3) It's really sad to see 25% CPU utilisation on this quad-CPU system 
throughout the long build. Is the parallel make patch coming? :)


4) However, in the end, the build failed:

gcc  -L. chicken.o batch-driver.o compiler.o optimizer.o 
compiler-syntax.o scrutinizer.o unboxing.o support.o c-platform.o 
c-backend.o -o chicken \

  -lchicken -Wl,-R"." -lsocket -lnsl -lm -ldl
Undefined   first referenced
 symbol in file
nanosleep   ./libchicken.so
ld: fatal: Symbol referencing errors. No output written to chicken
collect2: ld returned 1 exit status
make[1]: *** [chicken] Error 1
make[1]: Leaving directory `/pool/home/toby/chicken/chicken-4.7.0.3-st'
make: *** [all] Error 2

real34m18.395s

The fix is to add -lrt to this line in Makefile.solaris:
LIBRARIES = -lsocket -lnsl -lm -ldl -lrt

& after another five minutes building, we're done.

5) Odd problem in 'make check'

$ time make PLATFORM=solaris check
make -f ./Makefile.solaris CONFIG= check
make[1]: Entering directory `/pool/home/toby/chicken/chicken-4.7.0.3-st'
cd tests; sh runtests.sh
runtests.sh: 
DYLD_LIBRARY_PATH=/pool/home/toby/chicken/chicken-4.7.0.3-st/tests/..: 
is not an identifier

make[1]: *** [check] Error 1
make[1]: Leaving directory `/pool/home/toby/chicken/chicken-4.7.0.3-st'
make: *** [check] Error 2

However, we do appear to have a good build:

$ rlwrap ./csi

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0.3-st
solaris-unix-gnu-sparc [ dload ptables ]
compiled 2011-11-09 on e450 (SunOS)

#;1> (print (list->string (apply append (map string->list '("hello," 
"world!") ; just silliness

hello,world!


--Toby



and make signalled a circular dependency while looking for apply-hack.sparc.S.

As it turns out, there is a apply-hack.sparc64.S... but nothing for
the other. I am not familiar with the sparc architecture, so I am
looking for advice on what to do. Also please tell me if you need more
information.

Thank you in advance for your answers.




___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] 64-bit SPARC build - Re: [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Jim Ursetto
Toby,

On Nov 10, 2011, at 6:40 AM, Toby Thain wrote:
> 3) It's really sad to see 25% CPU utilisation on this quad-CPU system 
> throughout the long build. Is the parallel make patch coming? :)

The patch in ticket 526 
(http://bugs.call-cc.org/raw-attachment/ticket/526/parallel-build-2.diff.txt) 
still works fine with 4.7.0.3-st, although I've never tried it on solaris.  It 
is just not applied by default.

Jim
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] 64-bit SPARC build - Re: [4.7.0.3-st] Compiling on Solaris 10

2011-11-10 Thread Toby Thain

On 10/11/11 11:47 AM, Jim Ursetto wrote:

Toby,

On Nov 10, 2011, at 6:40 AM, Toby Thain wrote:

3) It's really sad to see 25% CPU utilisation on this quad-CPU system 
throughout the long build. Is the parallel make patch coming? :)


The patch in ticket 526 
(http://bugs.call-cc.org/raw-attachment/ticket/526/parallel-build-2.diff.txt) 
still works fine with 4.7.0.3-st, although I've never tried it on solaris.  It 
is just not applied by default.



This patch works beautifully on Solaris 10/SPARC64. Now builds in 10 
minutes:


real10m26.613s
user38m39.934s
sys 0m49.171s


--Toby


Jim



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users