Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Aug 2018, 02:35
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GCC hiding standard C header files
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [35 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 833

PostPosted: Fri 18 May 2018, 15:07    Post subject:  

WIckedWitch wrote:
jafadmin wrote:
WIckedWitch wrote:
.. beats me why any gcc package should ship without its own stddef.c ..


stddefs.h belongs to the OS, not the compiler.


What do you mean by "belongs to the OS"? The stddef.h header is specified in the C language standards, C90, C99, etc. Certification-quality compiler testing must always be traceable to the language standard. If a compiler does not provide its own stddef.h, then that compiler cannot guarantee that it complies with the standard if it picks up a stddef.h from another source.


System dependent: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stddef.h.html
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 16:16    Post subject:  

Just out of curiosity: If your compiler install depends on things like libc6 and libc6-dev, how can you guarantee a 100% reproducible environment?
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 16:19    Post subject:  

jafadmin wrote:
WIckedWitch wrote:
jafadmin wrote:
WIckedWitch wrote:
.. beats me why any gcc package should ship without its own stddef.c ..


stddefs.h belongs to the OS, not the compiler.


What do you mean by "belongs to the OS"? The stddef.h header is specified in the C language standards, C90, C99, etc. Certification-quality compiler testing must always be traceable to the language standard. If a compiler does not provide its own stddef.h, then that compiler cannot guarantee that it complies with the standard if it picks up a stddef.h from another source.


System dependent: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stddef.h.html


Virtually all of the standard library headers that come with C cross-compilers for microcontrollers are system-dependent but their developers do not take that as a reason to exclude them from the compiler install package.

Honestly, some of the things gcc does are utterly insane from the point of view of an embedded systems developer working on critical systems.

Still, my suite of tests for implementation-defined and unspecified characteristics will at least be able to tell the user that he has a missing stddef.h and tell him where best to put one if he has to get one from elsewhere.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 16:25    Post subject:  

WIckedWitch wrote:
... but their developers do not take that as a reason to exclude them from the compiler install package.


Like I said before, stddef.h is NOT excluded from the install. It is in a subpackage that would be automatically installed by apt.

How is that different?

Even Debian tcc has extra header files in a separate package.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 16:33    Post subject:  

rcrsn51 wrote:
Just out of curiosity: If your compiler install depends on things like libc6 and libc6-dev, how can you guarantee a 100% reproducible environment?


You can do it but it's fiddly.

On Linux platforms the best way to go about setting up a repeatable test system is to figure out what you need to install in what order from which repositories to get what you want. Then you install the preferred Linux on a bare machine and then install, in the right order, what you have determined will give you a repeatable environment. And you should checksum the relevant directory trees to prove that the installation is repeatable.

Much the same goes for Windows - provided that you install from DVD release media and never connect to the Internet for updates. There you are most likely to be installing a commercially supported gcc + MinGW compiler. That will give you all the standard headers you need but once again, you need to prove that it's repeatable by directory checksumming.

Either way, if the C implementation passes validation tests, this can be certified only for the given platform/version and the given installed compiler configuration/version. Certification does not carry over to other installations just because it's all gcc underneath - though the great unwashed of the C world rarely accept this until you demonstrate to them what can go wrong if you don't take all the right technical precautions.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 16:38    Post subject:  

rcrsn51 wrote:
WIckedWitch wrote:
... but their developers do not take that as a reason to exclude them from the compiler install package.


Like I said before, stddef.h is NOT excluded from the install. It is in a subpackage that would be automatically installed by apt.

How is that different?

Even Debian tcc has extra header files in a separate package.


That's fine if, when you install gcc, it hauls in all the other packages it needs to ensure that you have a complete useable compiler after the install has finished. But with tahrpup you can install a gcc from ubuntu/main and be left without a stddef,h until you manually insert it into one of the include directories or else install devx.

The critical thing there is that the installed gcc is not complete and that to set up the repeatable environment, you have to decide the order of installation of gcc and devx and then prove repeatability by checksumming.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 16:48    Post subject:  

WIckedWitch wrote:
That's fine if, when you install gcc, it hauls in all the other packages it needs to ensure that you have a complete useable compiler after the install has finished.

That's exactly how a package management system like dpkg/apt works.

Quote:
But with tahrpup you can install a gcc from ubuntu/main and be left without a stddef,h until you manually insert it into one of the include directories or else install devx.

Exactly, as explained above.

So your thread title "GCC hiding standard C header files" is disingenuous. Your particular method of installing gcc was at fault.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 17:01    Post subject:  

rcrsn51 wrote:

So your thread title "GCC hiding standard C header files" is disingenuous. Your particular method of installing gcc was at fault.


But there was nothing that I saw that would have told me in advance that i needed both gcc and devx to end up with a functioning compiler. (Incidentally, it was only gcc-4.8 thst gave me the problem. gcc-4.6 installed with its own stddef.h and so didn't need devx.

Again, perhaps I should emphasise that I am talking about very high integrity testing. With all the commercial compilers I have used, the documentation explains clearly how to do the install so that you end up with a full working compiler when the install has finished. This is not the case with some versions of gcc. Installing gcc-4.6 from ubuntu/main *does* give me a complete working compiler. Installing gcc-4.8 from ubuntu/main does not.

How was I to know other than by trial and error?

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 17:03    Post subject:  

Just to be clear, a devx contains a complete C compiler.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 17:07    Post subject:  

rcrsn51 wrote:
Just to be clear, a devx contains a complete C compiler.


Yes - but which complete C compiler? How could I identify it unambiguously?

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 17:12    Post subject:  

Quote:
This is not the case with some versions of gcc. Installing gcc-4.6 from ubuntu/main *does* give me a complete working compiler. Installing gcc-4.8 from ubuntu/main does not.

That's true. The Ubuntu gcc-4.6 package contains stddef.h. In gcc-4.8, they split it off into a separate -dev sub-package, which would be auto-installed by the package manager.

That's why piece-meal software installation in Puppy is risky.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 17:25    Post subject:  

rcrsn51 wrote:
Quote:
This is not the case with some versions of gcc. Installing gcc-4.6 from ubuntu/main *does* give me a complete working compiler. Installing gcc-4.8 from ubuntu/main does not.

That's true. The Ubuntu gcc-4.6 package contains stddef.h. In gcc-4.8, they split it off into a separate -dev sub-package.

That's why piece-meal software installation in Puppy is risky.


When I installed gcc-4.8, no such separate -dev subpackage was installed by PPM.

From the point of view of a certification-level tester, I think the best maxim is never to install from a Linux respository but to get the required gcc install package direct from the relevant GNU site.

Paradoxically, though this kind of thing is nothing but obstructive when you are setting up a high-integrity test platform, it is actually very helpful when you are developing the kinds of tests that I am currently working on. It tells me, for example, what kinds of checks I need to perform to provide an assurance of the integrity of an installed compiler before I even get to running the tests proper.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12276
Location: Stratford, Ontario

PostPosted: Fri 18 May 2018, 17:30    Post subject:  

WIckedWitch wrote:
From the point of view of a certification-level tester, I think the best maxim is never to install from a Linux respository

Or do the installation on the specific platform for which the packages were built.

Tahrpup is NOT Ubuntu Trusty.

Quote:
When I installed gcc-4.8, no such separate -dev subpackage was installed by PPM.

Exactly.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Fri 18 May 2018, 17:38    Post subject:  

rcrsn51 wrote:
WIckedWitch wrote:
From the point of view of a certification-level tester, I think the best maxim is never to install from a Linux respository

Or do the installation on the specific platform for which the packages were built.

Tahrpup is NOT Ubuntu Trusty.


Fair comment. I certainly wouldn't use tahrpup as a platform for high-integrity testing (although it's great for exposing you to problems that you may have to guard against).

I'm not sure that installing on the platform for which the package is built would necessarily steer me clear of all the problems that a high-integrity test platform has to guard against. On the other hand, once I've developed configuration integrity checks for gcc on tahrpup, I could certainly then go on to installing on a real ubuntu platform and see what else can go wrong there.

Thanks, anyway, for your engagement with this thread Smile

*** MODS: Possibly better to retitle this thread "gcc 4.8 missing stddef.h header" ? ***

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 198
Location: West Wales bandit country

PostPosted: Sat 19 May 2018, 16:00    Post subject:  

rcrsn51 wrote:


Tahrpup is NOT Ubuntu Trusty.

Quote:
When I installed gcc-4.8, no such separate -dev subpackage was installed by PPM.

Exactly.


One last remark:

Quote:
System dependent: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stddef.h.html


Interesting that you refer to what is essentially part of the IEEE 1003-1 standard for a definition of stddef.h. That definition in turn refers to the ANSI/ISO C language standard, which, at least in matters relating to C implementations, takes precedence over IEEE 1003-1.

Tahrpup may not be Ubuntu Trusty but neither is C POSIX, especially not when it's implemented in a cross-compiler running in a Windows environment, which is currently the case for a substantial proportion of critical embedded C applications.

Perhaps my perspective on this may seem a little narrow but I have worked in international standards for programming and formal description languages on and off for over 25 years. For matters of language definition and implementation, I always and exclusively refer to the relevant International Standard for the language. Indeed, never since 1976 have I used anything but national and international standards as my programmer's reference manuals for any language that has such a standard.

... and one last question:

What do Synaptic or apt-get do that PPM does not when it is installing packages from a ubuntu repository?

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [35 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1268s ][ Queries: 11 (0.0075s) ][ GZIP on ]