473,772 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A Portable C Compiler

http://slashdot.org/

"The leaner, lighter, faster, and most importantly, BSD Licensed,
Compiler PCC has been imported into OpenBSD's CVS and NetBSD's pkgsrc.
The compiler is based on the original Portable C Compiler by S. C.
Johnson, written in the late 70's. Even though much of the compiler has
been rewritten, some of the basics still remain. It is currently not
bug-free, but it compiles on x86 platform, and work is being done on it
to take on GCC's job."

The PCC was the first C compiler I used and studied, back then, when
Unix and C started appearing here in France. We had a source license,
and browsing there I found the PCC code.

The discussion is here.

http://undeadly.org/cgi?action=artic...mode=expanded/

It is interesting to see the level of frustration of the BSD people
with GCC. They just want a compiler that is simple, small, and...
supports all architectures that Open BSD supports.

Will they succeed?

Of course it is easy to have a compiler that supports 3 back ends, say.
But supporting 10?

With a mixture of weird CPUs etc?

In any case PCC should be up to the task. I remember it run in the
Honeywell-Bull computers of that time (beginning of the 80s), so
it should run in many others... Running with those was really a
challenge.
Sep 17 '07
42 3453
jacob navia wrote, On 18/09/07 23:34:
Flash Gordon wrote:
>jacob navia wrote, On 18/09/07 21:33:
>>Look.
Did you know that /usr/lib/libc.so is not a binary shared library?
NO!

It is an ASCII LINKER SCRIPT for GNU's "ld"...

So? That is not part of gcc and the actual C library is available as a
shared object, check /lib/libc.so.6. That is two reasons why your
argument here is rubbish.

OK. You find normal that the system library uses an ASCII script for a
specific linker.
They also provide the ACTUAL C library if you want to use it. They also
provide a linker you can use. You can also see how the damn thing works
so you can write your linker to use it if you want.
If Microsoft would have done that, nobody could
link under windows without using their linker...
You have to either use the Microsoft linker or write your own compatible
with it or provide your own C library. The ONLY difference with Linux is
that the linker is actually provided free and installed already on most
systems.
>>Ahhh you do not use "ld"?

What has that got to do with whether you are using gcc? ld is a
seperate product which gcc happens to use.

A developer uses the whole chain:
compiler --assembler-->linker-->debugger.
Well, not everyone uses an assembler. However, if we ignore that you are
forgetting how things work there is still the point that gcc is is NOT a
linker nor is it a debugger. So what are you complaining about, just gcc
which is all you initially mentioned, gcc and GNU ld, or the debugger as
well, or what?
>>Then you are doomed stupid!

Most of the headers and system headers under linux are full of
__attribute __ etc etc etc!

I have ported lcc-win to linux and I can tell you that I had to write
my own headers,

So? When gcc is built it goes through a lot of hoops to create
suitable headers based on whatever the system provides.

Yes. They are no better than Microsoft or IBM. Just the same.
I think you will find that the headers for all C libraries use
implementation specific tricks. For a start, offsetof cannot be
implemented *without* using implementation specific tricks. So EVERY
provider of implementations including *you* is guilty. So what on earth
are you complaining about?
>>exactly like under windows

Yes
So why raise it as a problem with gcc?
>So why complain it is a gcc problem?

I do not complain. I say that they have the monopoly. I do not complain
about Microsoft. I just say that they have a windows monopoly.
You are wrong. See all the stuff you have just read including the posts
you have replied to pointing out there are complete distributions built
*without* gcc.
>>with the BIG difference that
with Microsoft it is still possible to use the windows SDK headers.

What you mean is you support the extensions MS use in their headers
but you don't support the extensions used in the headers shipped with
glibc.

I only support stdcall. No other MS extension is supported unless it is
generally useful like dllexport/import.
>glibc is another seperate product by the way, and not part of gcc.

Yes, sure.
So why raise things about glibc as complaints about gcc?
>>Under linux if you do not support __attribute__ you are doomed.

By the same argument under Windows you are doomed if you don't support
__cdecl or whatever it is that MS use in all their headers.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^
>
I do not support __cdecl.
Since I EXPLICITLY cover that I might not have remembered what MS use
why not address the obvious and real point, namely that you DO support
whatever extension it is that MS use.
--
Flash Gordon
Sep 19 '07 #31
Flash Gordon <sp**@flash-gordon.me.ukwri tes:
Personally I've hit very few bugs in gcc. They do exist but I don't hit
them often enough to worry about.
I've been hit by about the same number of bugs in gcc than in other
compilers we use. Very few. I've been far more often explained to someone
that, no it wasn't a bug in the compiler, it is a bug in the program.
Since they have the monopoly under linux, there is nothing anyone can
do about that.

No gcc does not have a monopoly under Linux. There is tcc, although that
is still flagged as experimental on Ubuntu, Tendra and of course Intel's
icc.
There is also
- lcc
- the compiler of SunStudio (which claims C99 compliance -- I've not
checked and don't remember if it comes with a compliant library or use glibc)
- the C compiler of Comeau (which use gcc as back end, and also claims
C99 compliance but use glibc).
- IBM xlC is also available for Linux according to the web pages, I don't
know if they support x86
- Open64

I'm probably missing some. And I'm pretty sure that if pcc does bring
something, somebody will port it to Linux.

But it is true that most people and even compagnies use gcc.

--
Jean-Marc
Sep 19 '07 #32
Rui Maciel <ru********@gma il.comwrites:
Once again, GCC is perfectly irrelevant to this subject. Why you keep on
whining about GCC is beyond me. Moreover, no one ever claimed that GCC was
the best compiler around or even the fastest. The claim that was made was
that the "people building on old machines" claim is perfectly irrelevant,
knowing that any system sold in the past 3 or 4 years is more than capable
of doing a decent build job.
In the case of OpenBSD and NetBSD distributions, they target things which
where already outdated 10 years ago (vaxes were still sold 10 years ago but
I'd have problem to say they were current at that time).

Yours,

--
Jean-Marc
Sep 19 '07 #33
jacob navia <ja***@jacob.re mcomp.frwrites:
Yes, Intel has the resources to throw into something like that. It has
developed a "gcc clone" mode, where it even copies the command line
options of gcc.
That's the think everybody does when there is a big player in a market: be
as compatible -- sometimes even bug compatible -- with it. That's not the
same as having a monopoly.

Yours,

--
Jean-Marc
Sep 19 '07 #34
Richard Heathfield wrote:
Since I killfiled Mr Navia, people have stopped complaining at me for
arguing with him all the time. I am not ungrateful for this. I have
noticed, however, a marked increase in the rate with which *other people*
are arguing with him.
Sniff, sniff....

Sep 19 '07 #35
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
46************* **@yahoo.com...
jacob navia wrote:
>>
... snip ...
>>
Each time you make a change in C you have to rebuild. for many
projects, a change can affect a lot of files. Global changes that
need a full recompilation are done not VERY often, but they are
done...

This means that a compiler that slows down the development process
by just 30-60 seconds per build, it is taking between 15-30
minutes per day to each developer...

To me, the requirement for such a long routine compile indicates
mis-organization. Normally you would only be modifying one source
file, and the rebuild should be limited to recompiling that and
relinking. Sometimes the associated .h file may need revision, and
then (rarely) the work can become considerably larger. So in
general the compilation should not be a problem, however the
linking may be.
I suspect the project Jacob is talking about is actually mostly C++.

Changing a class header file or a template causes a lot of recompilation,
and g++ is notoriously slow.

--
Chqrlie.
Sep 19 '07 #36
Charlie Gordon wrote:
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
46************* **@yahoo.com...
>jacob navia wrote:
... snip ...
>>Each time you make a change in C you have to rebuild. for many
projects, a change can affect a lot of files. Global changes that
need a full recompilation are done not VERY often, but they are
done...

This means that a compiler that slows down the development process
by just 30-60 seconds per build, it is taking between 15-30
minutes per day to each developer...
To me, the requirement for such a long routine compile indicates
mis-organization. Normally you would only be modifying one source
file, and the rebuild should be limited to recompiling that and
relinking. Sometimes the associated .h file may need revision, and
then (rarely) the work can become considerably larger. So in
general the compilation should not be a problem, however the
linking may be.

I suspect the project Jacob is talking about is actually mostly C++.
Yes, as I said the company uses C++
Changing a class header file or a template causes a lot of recompilation,
and g++ is notoriously slow.
The linker is VERY slow, and that hits you even when doing
a trivial change.
Sep 19 '07 #37
On Sep 19, 6:54 am, jacob navia <ja...@jacob.re mcomp.frwrote:
Charlie Gordon wrote:
"CBFalconer " <cbfalco...@yah oo.coma écrit dans le message de news:
46F04BF7.212AE. ..@yahoo.com...
jacob navia wrote:
... snip ...
Each time you make a change in C you have to rebuild. for many
projects, a change can affect a lot of files. Global changes that
need a full recompilation are done not VERY often, but they are
done...
>This means that a compiler that slows down the development process
by just 30-60 seconds per build, it is taking between 15-30
minutes per day to each developer...
To me, the requirement for such a long routine compile indicates
mis-organization. Normally you would only be modifying one source
file, and the rebuild should be limited to recompiling that and
relinking. Sometimes the associated .h file may need revision, and
then (rarely) the work can become considerably larger. So in
general the compilation should not be a problem, however the
linking may be.
I suspect the project Jacob is talking about is actually mostly C++.

Yes, as I said the company uses C++
Changing a class header file or a template causes a lot of recompilation,
and g++ is notoriously slow.

The linker is VERY slow, and that hits you even when doing
a trivial change.
GCC is totally irrelevant as far as linking is concerned. The speed
of linking for PCC or any other compiler will not be any different at
all, since both PCC and GCC are going to perform exactly the same link
step using exactly the same linker. The link step is performed by the
operating system's linker, and so the speed of the link won't change
at all unless a compiler vendor supplies its own linker. Microsoft
does that, but then again, they also wrote the operating system for
their compiler so no great surprise there.

I believe that this has all been explained to you before. I think
that you are deliberately being thick here.

Sep 19 '07 #38
user923005 said:
On Sep 19, 6:54 am, jacob navia <ja...@jacob.re mcomp.frwrote:
<snip>
>The linker is VERY slow, and that hits you even when doing
a trivial change.

GCC is totally irrelevant as far as linking is concerned. [...]

I believe that this has all been explained to you before. I think
that you are deliberately being thick here.
Hanlon's Razor applies.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 19 '07 #39
A N Other <sp******@inval id.comwrites:
On 18 Sep 2007 at 22:32, Rui Maciel wrote:
>jacob navia wrote:
>>Yeah, if it compiles C it is of no much use, I know.

But maybe it *could* be that *some* people *like* C you see?

Sarcasm aside, no one has ever stated that no one liked C. As this very
thread is taking place in a newsgroup dedicated to the C programming
language, that insinuation is rather amusing. Were you trying to fan the
flames?

Gee, do you reckon? Jacob's whole modus operandi in this group is to be
completely unreasonable, get people really riled up, and then when they
react he plays the victim - "everyone's picking on me!"
That is not what I have seen.
>
Look at this thread. It serves absolutely no purpose except for Jacob to
spread a load of FUD about gcc.

Jacob obviously thinks the world owes him a living because he took
someone else's compiler, knocked up a pretty GUI IDE to go with it, and
repackaged it as a commercial product. It's clear from his postings to
this group over several years that he doesn't have the first beginnings
of a clue about C - he's not just a social pariah, he's technically
inept to go with it.
Hmm. I see a certain pattern emerging in your style.
>
This group would be a better place if Jacob would stop posting to it and
leave us all in peace.
Who is "us"?
Sep 19 '07 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2629
by: John Smith | last post by:
Hi I'm looking for a header-file only STL implementation. I know the vendors provide one with compilers but often they are either buggy or has some other problems. My problem is that under Windows the different versions of the Microsoft compiler are not compatible with each other. This means you can't compile file with version X and link with version Y because you end up with linker errors.
5
4813
by: Mark Shelor | last post by:
Problem: find a portable way to determine whether a compiler supports the "long long" type of C99. I thought I had this one solved with the following code: #include <limits.h> #ifdef ULONG_LONG_MAX
5
2392
by: Kobu | last post by:
In embedded systems (programmed in C), often times structure declarations are used to group together several status/control/data registers of external hardware (or even internal registers). The example below (from GBD's THE C BOOK) uses this. Is this a portable method? . /*
8
7076
by: suresh_C# | last post by:
Dear All, What is difference between Portable Executable (PE) file and a Assembly? Thanks, Mahesh
131
6226
by: pemo | last post by:
Is C really portable? And, apologies, but this is possibly a little OT? In c.l.c we often see 'not portable' comments, but I wonder just how portable C apps really are. I don't write portable C code - *not only* because, in a 'C sense', I
5
7629
by: Richard Giuly | last post by:
Hello, I would like to write "portable" C++ code that could theoretically run on linux, windows, and other platforms, and I'd like to use VS as the editor/compiler/linker. The simplest thing that seems to complie in VS is this: //VS example #include "stdafx.h"
20
21772
by: rkk | last post by:
Hi, Is there an equivalent typeof macro/method to determine the type of a variable in runtime & most importantly that works well with most known C compilers? gcc compiler supports typeof() macro, but the same code is not getting compiled in solaris forte compiler and in microsoft VS 2003 compiler. I tried something like below:
32
2044
by: r.z. | last post by:
class vector3 { public: union { float data; struct { float x, y, z; };
23
3351
by: asit | last post by:
what is the difference between portable C, posix C and windows C ???
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.