Re: [C--] a skeleton file for qc-- to start?

Wonseok Chae <[email protected]> Wed, 14 Oct 2009 09:45:27 -0500
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
--===============1421821237==
Content-Type: multipart/alternative; boundary=001485f772a2b5251d0475e63603

--001485f772a2b5251d0475e63603
Content-Type: text/plain; charset=ISO-8859-1

Hi Xingzhi Pan,

You omitted compiler option "-globals":

$ qc--.opt -globals sp1.c--

However, your program has still a problem around line 16:

           sp1( 3, 3 );

which does not match the definition of function "sp1" :-)

By the way, I did experience the same problems with Cygwin and qc--
compilation process. You might find some tips in my memo (
http://ttic.uchicago.edu/~wchae/files/MLPolyRforC--.pdf ).

Cheers,
Wonseok

On Wed, Oct 14, 2009 at 9:26 AM, Xingzhi Pan <[email protected]> wrote:

> Hi list,
>
> I've built qc--20090627 on Debian and now I'm ready to try it out. However
> I
> couldn't find a proper "skeleton" c-- source file to start with. The
> closest I
> could get (modified from the document) is
>
>    target byteorder little;
>    section "text" {
>        /* Ordinary recursion */
>        export sp1;
>        sp1( bits32 n ) {
>          bits32 s, p;
>          if n == 1 {
>              return( 1, 1 );
>          } else {
>              s, p = sp1( n-1 );
>              return( s+n, p*n );
>          }
>        }
>        export main;
>        main() {
>            sp1( 3, 3 );
>            return( 0 );
>        }
>    }
>
> I used
>    qc--.opt sp1.c--
> and got
>    sp1.o: In function `Cmm.ref_to_global_area':
>    (.data+0x0): undefined reference to
> `Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY'
>    collect2: ld returned 1 exit status
>
> Can anyone point me to somewhere to start? Thanks in advance!
>
> Another question: does "section" actually correspond to the same concept
> when
> people talk about X86 assembly (.text, .data, .bss, etc.)?
>
> PS, it's somewhat troublesome to build qc-- from scratch - partly because I
> tried to do it on Cygwin first. After getting frustrated I turned to
> Debian.
> But even then I had to build Lua 4, Ocaml 3.08 (these guys are a little big
> old
> nowadays), install some Latex packages (not mentioned in the INSTALL file),
> and
> modify the configure script. It took me a few hours to figure out
> everything
> needed.
>
> Cheers.
>
> --
> Pan, Xingzhi
> http://www.panxingzhi.net
> http://code.google.com/p/pypl0
> http://code.google.com/p/dircompare/
> _______________________________________________
> Cminusminus mailing list
> [email protected]
> https://www.eecs.harvard.edu/mailman/listinfo/cminusminus
>

--001485f772a2b5251d0475e63603
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Xingzhi Pan,<br><br>You omitted compiler option &quot;-globals&quot;:<br=
><br>$ qc--.opt -globals sp1.c-- <br><br>However, your program has still a =
problem around line 16:<br><br>=A0 =A0 =A0 =A0 =A0=A0 sp1( 3, 3 );<br><br>w=
hich does not match the definition of function &quot;sp1&quot; :-)<br>
<br>By the way, I did experience the same problems with Cygwin and qc-- com=
pilation process. You might find some tips in my memo (<a href=3D"http://tt=
ic.uchicago.edu/~wchae/files/MLPolyRforC--.pdf">http://ttic.uchicago.edu/~w=
chae/files/MLPolyRforC--.pdf</a> ). <br>
<br>Cheers,<br>Wonseok<br><br><div class=3D"gmail_quote">On Wed, Oct 14, 20=
09 at 9:26 AM, Xingzhi Pan <span dir=3D"ltr">&lt;<a href=3D"mailto:pan.xing=
[email protected]">[email protected]</a>&gt;</span> wrote:<br><blockquote c=
lass=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); ma=
rgin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list,<br>
<br>
I&#39;ve built qc--20090627 on Debian and now I&#39;m ready to try it out. =
However I<br>
couldn&#39;t find a proper &quot;skeleton&quot; c-- source file to start wi=
th. The closest I<br>
could get (modified from the document) is<br>
<br>
 =A0 =A0target byteorder little;<br>
 =A0 =A0section &quot;text&quot; {<br>
 =A0 =A0 =A0 =A0/* Ordinary recursion */<br>
 =A0 =A0 =A0 =A0export sp1;<br>
 =A0 =A0 =A0 =A0sp1( bits32 n ) {<br>
 =A0 =A0 =A0 =A0 =A0bits32 s, p;<br>
 =A0 =A0 =A0 =A0 =A0if n =3D=3D 1 {<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0return( 1, 1 );<br>
 =A0 =A0 =A0 =A0 =A0} else {<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0s, p =3D sp1( n-1 );<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0return( s+n, p*n );<br>
 =A0 =A0 =A0 =A0 =A0}<br>
 =A0 =A0 =A0 =A0}<br>
 =A0 =A0 =A0 =A0export main;<br>
 =A0 =A0 =A0 =A0main() {<br>
 =A0 =A0 =A0 =A0 =A0 =A0sp1( 3, 3 );<br>
 =A0 =A0 =A0 =A0 =A0 =A0return( 0 );<br>
 =A0 =A0 =A0 =A0}<br>
 =A0 =A0}<br>
<br>
I used<br>
 =A0 =A0qc--.opt sp1.c--<br>
and got<br>
 =A0 =A0sp1.o: In function `Cmm.ref_to_global_area&#39;:<br>
 =A0 =A0(.data+0x0): undefined reference to<br>
`Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY&#39;<br>
 =A0 =A0collect2: ld returned 1 exit status<br>
<br>
Can anyone point me to somewhere to start? Thanks in advance!<br>
<br>
Another question: does &quot;section&quot; actually correspond to the same =
concept when<br>
people talk about X86 assembly (.text, .data, .bss, etc.)?<br>
<br>
PS, it&#39;s somewhat troublesome to build qc-- from scratch - partly becau=
se I<br>
tried to do it on Cygwin first. After getting frustrated I turned to Debian=
.<br>
But even then I had to build Lua 4, Ocaml 3.08 (these guys are a little big=
 old<br>
nowadays), install some Latex packages (not mentioned in the INSTALL file),=
 and<br>
modify the configure script. It took me a few hours to figure out everythin=
g<br>
needed.<br>
<br>
Cheers.<br>
<br>
--<br>
<font color=3D"#888888">Pan, Xingzhi<br>
<a href=3D"http://www.panxingzhi.net" target=3D"_blank">http://www.panxingz=
hi.net</a><br>
<a href=3D"http://code.google.com/p/pypl0" target=3D"_blank">http://code.go=
ogle.com/p/pypl0</a><br>
<a href=3D"http://code.google.com/p/dircompare/" target=3D"_blank">http://c=
ode.google.com/p/dircompare/</a><br>
_______________________________________________<br>
Cminusminus mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]=
u</a><br>
<a href=3D"https://www.eecs.harvard.edu/mailman/listinfo/cminusminus" targe=
t=3D"_blank">https://www.eecs.harvard.edu/mailman/listinfo/cminusminus</a><=
br>
</font></blockquote></div><br>

--001485f772a2b5251d0475e63603--

--===============1421821237==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cminusminus mailing list
[email protected]
https://www.eecs.harvard.edu/mailman/listinfo/cminusminus

--===============1421821237==--