9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <sdaoden@yandex.com>
To: 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 14:33:12 +0100	[thread overview]
Message-ID: <20151127133312.4nVVd3cC7%sdaoden@yandex.com> (raw)
In-Reply-To: <201511270856.tAR8uBol016809@freefriends.org>

arnold@skeeve.com wrote:
 |> Alternative compilers, like tcc, only build C on very few architectures /
 |> os with almost no optimization: they are much smaller, but still not
 |> standard compliant.

 |TCC compiles really fast, and it's (finally) good enough that I can use
 |it for my personal development / testing, but I would not use it to
 |build a production binary, the code quality is much poorer. On Linux
 |you can't use it for debugging either - it doesn't generate the
 |debug info you need. :-(  For that, GCC and clang are the way to go.

I just started to use tcc(1) for faster recompilations during my
chaotic way of walking, and it was an a-ha just as was the
detection of jikes(1) compared to the Java-shipped compiler in,
say, 1999.  (And in fact that was the reason to start learning
C++, later C, and not continue with only Perl and Java.)

  ?2[sdaoden@wales ]$ time make CC=clang devel >/dev/null 2>&1
      0m55.37s real     0m29.44s user     0m27.24s system
  ?0[sdaoden@wales ]$ time make CC=gcc devel >/dev/null 2>&1
      0m50.04s real     0m26.13s user     0m24.92s system
  ?2[sdaoden@wales ]$ time make CC=tcc devel >/dev/null 2>&1
      0m17.90s real     0m7.29s user     0m12.07s system

But without reconfiguration in normal development it feels more
drastic than these lines suggest.  Of course, ship-out user code.
Plan9 users don't have those problems in their native
self-contained environment, also the UnixWare and native Sun cc's
are ok, but on *BSD and Linux you really don't have any more
options.  E.g., i just tried pcc(1), which could be one, on
a Linux box:

  Using C compiler $CC="pcc"
  /usr/include/stdc-predef.h:59: warning: __STDC_ISO_10646__ redefined (previously defined at "./___tmp12443.c" line -9)
  ld: cannot find crtbegin.o: No such file or directory
well we could but..
  ld: cannot find -lpcc
there is none!
  error: ld terminated with status 1
  ERROR: i cannot compile a "Hello world" via
     pcc -I/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include/ -I/home/sdaoden/usr/include -I/usr/local/include -I/usr/include      -L/home/sdaoden/usr/lib -L/lib -L/usr/local/lib -L/usr/lib

That after some work already.  VoidLinux has a package, though,
i should try that.

 |I agree with the general sentiments - GLIBC and GCC are both bloated.
 |But for the day-to-day work that *I* do, they're livable.

Due to the large community and the commercial interest (remember
the billion dollar campaign of IBM over a decade ago) you have the
newest technologies in a usable state.  I.e., i've found a drastic
memory bug in Jörg Schilling's Bourne shell (likely developed only
on Solaris rooted) simply by compiling and starting it under
FreeBSD.  And i have found stack read violations simply by running
them under Linux?  I always had my own memory allocation stuff
with tracing and logging and canaries, but read violations are
hard to detect without real red zones.  And it's easy to simply
look into /proc/PID/ and see a lot of things at a glance via ls(1)
/ cat(1) that otherwise require special programs or things which
are real horror for me, like dtrace (no!).  Acid has it at least
in its name.  Never liked debug robots anyway.

But otherwise i always like going back to BSD, i guess just Plan9
people like to come back into the grown rather self-contained
environment.  You install the ISO and are ready to go, with
network and development.  I.e., i install a new FreeBSD and the
configuration files from 2002 still work.  That is valuable.
I think there is pcc for NetBSD, also.

--steffen



  reply	other threads:[~2015-11-27 13:33 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
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 [this message]
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=20151127133312.4nVVd3cC7%sdaoden@yandex.com \
    --to=sdaoden@yandex.com \
    --cc=9fans@9fans.net \
    /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).