9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Vasudev Kamath <vasudev@copyninja.info>
To: Ryan Gonzalez <rymg19@gmail.com>
Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Compiling ken-cc on Linux
Date: Fri, 27 Nov 2015 22:46:02 +0530	[thread overview]
Message-ID: <8737vrbbxp.fsf@rudra.copyninja.info> (raw)
In-Reply-To: <C2246FAC-1EA4-40BA-9469-A9A7975BFD8A@gmail.com> (Ryan Gonzalez's message of "Fri, 27 Nov 2015 10:59:41 -0600")

Ryan Gonzalez <rymg19@gmail.com> 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/lib9.h:19:0,
                 from fdlibm/fdlibm.h:2,
                 from fdlibm/s_isnan.c:20:
fdlibm/s_isnan.c:22:6: error: expected identifier or ‘(’ before ‘sizeof’
  int isnan(double x)
      ^
mk: cc -c -m32 ...  : exit status=exit(1)
mk: for j in ...  : exit status=exit(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 ‘myctime’:
Posix.c:9:9: warning: implicit declaration of function ‘ctime’ [-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/libmach.a /home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libbio.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:1120: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libmach.a(obj.o):(.rodata+0x198): undefined reference to `_is9'
/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/lib/libmach.a(obj.o):(.rodata+0x19c): undefined reference to `_read9'
collect2: error: ld returned 1 exit status
mk: cc -m32  ...  : exit status=exit(1)
mk: for j in ...  : exit status=exit(1)
mk: for j in ...  : exit status=exit(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 
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 :-).

Cheers,



  reply	other threads:[~2015-11-27 17:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 17:10 Vasudev Kamath
2015-11-25 17:15 ` Ryan Gonzalez
2015-11-25 17:24   ` Vasudev Kamath
2015-11-26 12:08     ` Charles Forsyth
2015-11-27 16:50   ` Vasudev Kamath
2015-11-27 16:59     ` Ryan Gonzalez
2015-11-27 17:16       ` Vasudev Kamath [this message]
2015-11-27 18:24         ` Ryan Gonzalez
2015-11-29  9:41           ` Vasudev Kamath
2015-11-29 14:38             ` Ryan Gonzalez
2015-11-27 18:11   ` trebol
2015-11-26 12:10 ` Charles Forsyth
2015-11-26 12:18   ` David du Colombier
2015-11-26 18:15   ` Ryan Gonzalez
2015-11-26 21:31     ` Charles Forsyth
2015-11-26 21:49       ` Ryan Gonzalez
2015-11-26 21:51         ` Charles Forsyth
2015-11-26 21:56           ` Charles Forsyth
2015-11-26 22:02             ` Ryan Gonzalez
2015-11-26 22:08               ` Charles Forsyth
2015-11-26 22:30                 ` David du Colombier
2015-11-26 23:08                   ` Ryan Gonzalez
2015-11-26 23:21                     ` Charles Forsyth
2015-11-26 23:41                       ` Ryan Gonzalez
2015-11-27  0:02                       ` Brantley Coile
2015-11-27  8:13                       ` Giacomo Tesio
2015-11-27  8:56                         ` arnold
2015-11-27 13:33                           ` Steffen Nurpmeso
2015-11-28  0:55                             ` erik quanstrom
2015-11-30 15:46                               ` Steffen Nurpmeso
2015-11-27 12:42                         ` tlaronde
2015-11-27 14:07                           ` Giacomo Tesio
2015-11-27 14:34                             ` tlaronde
2015-11-28  1:01                             ` erik quanstrom
2015-11-27 12:05                       ` Steffen Nurpmeso
2015-11-27 12:32       ` lucio
2015-11-26 21:40     ` Andrew Simmons
2015-11-28  6:42 da Tyga
2015-11-28  7:40 ` Brantley Coile
2015-11-28 20:31   ` Anthony Sorace
2015-11-28 23:33     ` Brantley Coile
2015-11-29  6:12       ` lucio
2015-11-28 20:13 ` Ryan Gonzalez
2015-11-29  5:57   ` lucio
2015-11-29 16:17     ` tlaronde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737vrbbxp.fsf@rudra.copyninja.info \
    --to=vasudev@copyninja.info \
    --cc=9fans@9fans.net \
    --cc=rymg19@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).