From mboxrd@z Thu Jan 1 00:00:00 1970 User-Agent: K-9 Mail for Android In-Reply-To: <8737vrbbxp.fsf@rudra.copyninja.info> References: <877fl6ronj.fsf@rudra.copyninja.info> <877fl3bd4j.fsf@rudra.copyninja.info> <8737vrbbxp.fsf@rudra.copyninja.info> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Ryan Gonzalez Date: Fri, 27 Nov 2015 12:24:26 -0600 To: Vasudev Kamath Message-ID: <9F888B46-B9A9-4DEA-AD47-631DC3D6B9C5@gmail.com> Content-Transfer-Encoding: quoted-printable Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Compiling ken-cc on Linux Topicbox-Message-UUID: 78fe5196-ead9-11e9-9d60-3106f5b1d025 On November 27, 2015 11:16:02 AM CST, Vasudev Kamath wrote: >Ryan Gonzalez writes: > >> Try going to the top of mathi.h and putting: >> >> #undef isnan >> #undef isinf >> >> Stupid macros that don't look like macros. > >That worked. Even I didn't realize those as macros. But now I land in >new error. > >/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and >_SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] ># warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use >_DEFAULT_SOURCE" > ^ >In file included from >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/include/l= ib9.h:19:0, > from fdlibm/fdlibm.h:2, > from fdlibm/s_isnan.c:20: >fdlibm/s_isnan.c:22:6: error: expected identifier or =E2=80=98(=E2=80=99= before >=E2=80=98sizeof=E2=80=99 > int isnan(double x) > ^ >mk: cc -c -m32 ... : exit status=3Dexit(1) >mk: for j in ... : exit status=3Dexit(1) > >So I went and put #undef isnan again before #include "fdlibm.h" in >s_isnan.c and now I stop at a new error, again not mentioned in your >reported issue. > >Posix.c: In function =E2=80=98myctime=E2=80=99: >Posix.c:9:9: warning: implicit declaration of function =E2=80=98ctime=E2= =80=99 >[-Wimplicit-function-declaration] > return ctime(&t); > ^ >Posix.c:9:9: warning: return makes pointer from integer without a cast >[-Wint-conversion] >cc -m32 -o o.out ar.o Posix.o >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libma= ch.a >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libbi= o.a >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/lib9.= a > >ar.o: In function `page': >/home/vasudev/Documents/C_programming/compilers/9-cc/src/cmd/iar/ar.c:11= 20: >warning: the use of `mktemp' is dangerous, better use `mkstemp' or >`mkdtemp' >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libma= ch.a(obj.o):(.rodata+0x198): >undefined reference to `_is9' >/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libma= ch.a(obj.o):(.rodata+0x19c): >undefined reference to `_read9' >collect2: error: ld returned 1 exit status >mk: cc -m32 ... : exit status=3Dexit(1) >mk: for j in ... : exit status=3Dexit(1) >mk: for j in ... : exit status=3Dexit(1) > >I guess this is because of commenting out 9obj.c from compilation. So I >modified 9obj.c, below is the patch > >vasudev@rudra:~/Documents/C_programming/compilers/9-cc$ hg diff >src/libmach/obj.c=20 >diff -r 65fb8bb56c59 src/libmach/obj.c >--- a/src/libmach/obj.c Thu Apr 23 11:11:38 2015 +0100 >+++ b/src/libmach/obj.c Fri Nov 27 22:44:29 2015 +0530 >@@ -24,14 +24,14 @@ > int _is5(char*), > _is6(char*), > _is8(char*), >- _is9(char*), >+ /* _is9(char*), */ > _isk(char*), > _isq(char*), > _isv(char*), > _read5(Biobuf*, Prog*), > _read6(Biobuf*, Prog*), > _read8(Biobuf*, Prog*), >- _read9(Biobuf*, Prog*), >+ /* _read9(Biobuf*, Prog*), */ > _readk(Biobuf*, Prog*), > _readq(Biobuf*, Prog*), > _readv(Biobuf*, Prog*); >@@ -63,7 +63,7 @@ > /*[ObjSparc64]*/ {0, 0,}, > /*[ObjAmd64]*/ "amd64 .6", _is6, _read6, > /*[ObjSpim]*/ {0, 0,}, >- /*[ObjPower64]*/ "power64 .9", _is9, _read9, >+ /*[ObjPower64]*/ /* "power64 .9", _is9, _read9, >*/ > /*[Maxobjtype]*/ 0, 0 > }; > >That took compilation further but now it breaks at point 4 in your >issue. I hope I won't encounter more new issues :-). > Ah, yes, I completely forgot about that part. :/ Good luck with the rest = of the compilation! You'll need it! >Cheers, --=20 Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.