From mboxrd@z Thu Jan 1 00:00:00 1970 References: <201503112030.t2BKU71p008530@skeeve.com> From: Quintile Content-Type: multipart/alternative; boundary=Apple-Mail-747D10B0-1190-46DC-ACDD-D4AA8E22C2A2 In-Reply-To: Message-Id: <7B7A4AC6-02F2-4A28-AE1F-7D43B0494706@quintile.net> Date: Wed, 11 Mar 2015 21:54:17 +0000 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Subject: Re: [9fans] ken cc for linux Topicbox-Message-UUID: 491e65f6-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail-747D10B0-1190-46DC-ACDD-D4AA8E22C2A2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable awl compiles under APE with a little work. someone, sorry I have forgotten w= ho, did Stirling work a few years ago and got many Linux tools ported - to s= upport 3rd party stuff. to my chagrin I never managed to get avn to work on t= op of this. the code was in Google code I think, his porting instructions should work fo= r the latest gawk too. if not put the code somewhere and I will have a go. -Steve > On 11 Mar 2015, at 21:04, Ryan Gonzalez wrote: >=20 > Warning: this will get messy *fast*. >=20 >> On Wed, Mar 11, 2015 at 3:30 PM, Aharon Robbins wrote= : >> Thanks for the link to the Google code repo. >>=20 >> I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several= >> files are missing for the Power 64 port. >=20 > Yup. Comment out the lines in the mkfiles. In src/cmd/mkfile, I commented o= ut lines 34-36. >=20 > I think you already need mk installed; you can grab it from here. > =20 >>=20 >> I did as best I could to build things. I suppose my expectations aren't >> what they should be. I was looking for the usual >>=20 >> configure && make && make install >>=20 >> experience, and it wasn't there. I like to compile gawk with multiple >> compilers and thought I'd try ken's, but it wasn't clear to me which >> o.out file to use, or how to install it such that it will get the >> system's include files and libraries. >>=20 >=20 > I doubt the Plan 9 compilers will even get *close* to building gawk. >=20 > See, the compilers implement a variant of ANSI C with some C99-ish extensi= ons. For once, the preprocessor does not work with #if's. You can only use #= ifdef's. >=20 > Because of this, 99% of the C standard library headers will NOT work with t= he compilers. >=20 > Another issue is that it seems that the linker does not read ELF files, so= linking with about anything is out of the question. >=20 > As for the compilers you need to invoke... >=20 > The directories in src/cmd are formatting like nc, na, and nl, where the *= c ones are the compiles, *a, the assemblers, and *l, the linkers. >=20 > The executable is at src/cmd//o.out. For Ubuntu 64-bit, you'll want s= rc/cmd/6c/o.out to compile and src/cmd/6l/o.out to link. Or, at least you wo= uld...if the files weren't missing. Since half of them are, you'll instead w= ant src/cmd/8c/o.out to compile and src/cmd/8l/o.out to link. Those are the 3= 2-bit compilers. >=20 > I set up symlinks in ken-cc/bin using bin/8c as an alias for src/cmd/8c/o.= out. Same thing for 8l. >=20 > The command lines look something like: >=20 > 8c tst.c # outputs tst.8 > 8l -o tst tst.8 # outputs tst >=20 > Bottom line: you may be out of luck if you want to use ken-cc as a general= -purpose C compiler. It isn't. At all. >=20 > It's fun to toy with, though. >=20 > Go had vastly better versions, but it seems they got ripped out recently. I= think Go 1.3 may have had them, in which case you'd do something like: >=20 > go tool 6c tst.c > go tool 6l -o tst tst.6 >=20 > As you can see, Go actually had a working 64-bit compiler. >=20 > I have yet to figure out why the hell symlinks to the compilers never get s= et up in the bin directory. > =20 >> If this is easy to do, I'd appreciate hearing how. If not, then I'm not >> going to worry about it. :-) >>=20 >> Much thanks, >>=20 >> Arnold >>=20 >=20 >=20 >=20 > --=20 > Ryan > [ERROR]: Your autotools build scripts are 200 lines longer than your progr= am. Something=E2=80=99s wrong. > http://kirbyfan64.github.io/=20 --Apple-Mail-747D10B0-1190-46DC-ACDD-D4AA8E22C2A2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

awl compiles under APE w= ith a little work. someone, sorry I have forgotten who, did Stirling work a f= ew years ago and got many Linux tools ported - to support 3rd party stuff. t= o my chagrin I never managed to get avn to work on top of this.
the code was in Google code I think, his porting instructions s= hould work for the latest gawk too.

if not put the c= ode somewhere and I will have a go.

-Steve





On 11 Mar 2015, at 21= :04, Ryan Gonzalez <rymg19@gmail.com<= /a>> wrote:

Warning: this will get messy *fast*.

On Wed, Mar 11, 2015 at 3:30 PM, Aharon R= obbins <arnold@skeeve.com> wrote:
Thanks for the link to the Google code repo.

I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several files are missing for the Power 64 port.

Yup. Comment out the lines in the mkfiles. In src/cmd/mkfile, I commented o= ut lines 34-36.

I think you already need mk install= ed; you can grab it from here.
 

I did as best I could to build things.  I suppose my expectations aren'= t
what they should be. I was looking for the usual

        configure && make && make instal= l

experience, and it wasn't there. I like to compile gawk with multiple
compilers and thought I'd try ken's, but it wasn't clear to me which
o.out file to use, or how to install it such that it will get the
system's include files and libraries.


I doubt the Plan 9 compilers will even g= et *close* to building gawk.

See, the compilers imp= lement a variant of ANSI C with some C99-ish extensions. For once, the prepr= ocessor does not work with #if's. You can only use #ifdef's.

<= /div>
Because of this, 99% of the C standard library headers will NOT wo= rk with the compilers.

Another issue is that it see= ms that the linker does not read ELF files, so linking with about anything i= s out of the question.

As for the compilers you nee= d to invoke...

The directories in src/cmd are forma= tting like nc, na, and nl, where the *c ones are the co= mpiles, *a, the assemblers, and *l, the linkers.

Th= e executable is at src/cmd/<dir>/o.out. For Ubuntu 64-bit, you'll want= src/cmd/6c/o.out to compile and src/cmd/6l/o.out to link. Or, at least you w= ould...if the files weren't missing. Since half of them are, you'll instead w= ant src/cmd/8c/o.out to compile and src/cmd/8l/o.out to link. Those are the 3= 2-bit compilers.

I set up symlinks in ken-cc/bin us= ing bin/8c as an alias for src/cmd/8c/o.out. Same thing for 8l.
The command lines look something like:

8c tst.c # outputs tst.8
8l -o tst tst.8 # outputs tst
=
Bottom line: you may be out of luck if you want to use ken-cc= as a general-purpose C compiler. It isn't. At all.

It's fun to toy with, though.

Go had vastly better= versions, but it seems they got ripped out recently. I think Go 1.3 may hav= e had them, in which case you'd do something like:

= go tool 6c tst.c
go tool 6l -o tst tst.6

= As you can see, Go actually had a working 64-bit compiler.

I have yet to figure out why the hell symlinks to the compilers neve= r get set up in the bin directory.
 
If this is easy to do, I'd appreciate hearing how. If not, then I'm not
going to worry about it. :-)

Much thanks,

Arnold




--
Ryan
[ERROR]: Your autotools build scri= pts are 200 lines longer than your program. Something=E2=80=99s wrong.
= --Apple-Mail-747D10B0-1190-46DC-ACDD-D4AA8E22C2A2--