|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
|
| News | See also |
Books Reviews |
Open books | Recommended Links | Tutorials | Debugging | Make |
| Compilation problems | Shared Libraries for Solaris | TCL | mc | Classic Unix tools | History | Humor | Etc |
Sunfreeware.com has packages for gcc-3.4.2 and gcc-3.3.2 for Solaris 9 and package for gcc-3.3.2 for Solaris 10. Usually one needs only gcc_small package has ONLY the C and C++ compilers and is a much smaller download but sunfreeware.com does not provide that.
If you use gcc it's very convenient to use Midnight Commander on Solaris as a command line pseudo IDE.
Please note that Sun Studio 11 is free both for Solaris and Linux and might be a better option for compilation on UltraSparc then GCC (10% or more faster code).
|
|||||||
The software used to create gcc 3.4.2 (the steps are very similar for earlier versions of gcc) was all from packages on sunfreeware.com. These include the gcc-3.3.2, bison-1.875d, flex-2.5.31, texinfo-4.2, autoconf-2.59, make-3.80, and automake-1.9 packages. It may also be important to install the libiconv-1.8 package to use some of the languages in gcc 3.4.2. See also a comment below about the libgcc package.
There are differences between this version of gcc and previous 2.95.x versions on Solaris systems. For details, go to
- I downloaded the gcc-3.4.2.tar.gz source from the GNU site.
- I put the source in a directory with plenty of disk space.
- I then ran
gunzip gcc-3.4.2.tar.gz tar xvf gcc-3.4.2.tar (this creates a directory gcc-3.4.2) cd gcc-3.4.2 mkdir objdir cd objdir ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls (except in the case of Solaris 2.5 on SPARC where I used ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls --disable-libgcj --enable-languages=c,c++,objc and left out the other language options - like the gnat ada.) (I choose to use the as and ld that come with Solaris and are usually in the /usr/ccs/bin directory. These files are only there if the SUNW developer packages from the Solaris have been installed. I have noticed problems with the NLS support and so I disable that. The default installation directory is /usr/local.) make bootstrap make install (this puts a lot of files in /usr/local subdirectories) and the gcc and other executables in /usr/local/bin.
- I put /usr/local/bin and /usr/ccs/bin in my PATH environment.
In particular, gcc-3.4.2 offers support for the creation of 64-bit executables when the source code permits it. Programs like top, lsof, ipfilter, and others support, and may need, such compiles to work properly when running the 64-bit versions of Solaris 7, 8, and 9 on SPARC platforms. In some cases, simply using the -m64 flag for gcc during compiles (which may require either editing the Makefiles to add -m64 to CFLAGS or just doing gcc -m64 on command lines) works.
When you compile something with any of these compilers, the executable may end up depending on one or more of the libraries in /usr/local/lib such as libgcc_s.so. An end user may need these libraries, but not want the entire gcc file set. I have provided a package called libgcc (right now this is for gcc-3.3.x but a version for 3.4.x is being created) for each level of Solaris. This contains all the files from /usr/local/lib generated by a gcc package installation. An end user can install this or a subset. You can determine if one of these libraries is needed by running ldd on an executable to see the library dependencies.
I am happy to hear about better ways to create gcc or problems that may be specific to my packages. Detailed problems with gcc can be asked in the gnu.gcc.help newsgroup or related places.
#if defined (__SVR4) && defined (__sun)This should work on gcc, sun cc, and lots o other compilers, on both sparc and intel.
If for some reason, you want to know that Sun forte CC (c++) compiler is being used, something that seems to work is
#if defined(__SUNPRO_CC)Whereas for forte cc (regular C), you can use
#if defined(__SUNPRO_C)
Developing for Linux on Intel - For many Windows* developers, Linux* presents a learning challenge. Not only does Linux have a different programming model, but it also requires its own toolchain, as programmers must leave behind the Visual Studio* (VS) or Visual Studio* .NET (VS.NET) suites and third-party plug-in ecosystem. This article helps Windows developers understand the options available as they seek to replicate, on Linux or Solaris, the rich and efficient toolchain experience they've long enjoyed on Windows.
One persistent misfeature of open source development is thoughtless mimicry, copying the behaviors of other projects without considering if they work or if there are better options under the current circumstances. At best, these practices are conventional wisdom, things that everybody believes even if nobody really remembers why. At worst, they're lies we tell ourselves.
Perhaps "lies" is too strong a word. "Myths" is better; these ideas may not be true, but we don't intend to deceive ourselves. We may not even be dogmatic about them, either. Ask any experienced open source developer if his users really want to track the latest CVS sources. Chances are, he doesn't really believe that.
In practice, though, what we do is more important than what we say. Here's the problem. Many developers act as if these myths are true. Maybe it's time to reconsider our ideas about open source development. Are they true today? Were they ever true? Can we do better?
Some of these myths also apply to proprietary software development. Both proprietary and open models have much room to improve in reliability, accessibility of the codebase, and maturity of the development process. Other myths are specific to open source development, though most stem from treating code as the primary artifact of development (not binaries), not from any relative immaturity in its participants or practices.
Not every open source developer believes every one of these ideas, either. Many experienced coders already have good discipline and well-reasoned habits. The rest of us should learn from their example, understanding when and why certain practices work and don't work.
Publishing your Code Will Attract Many Skilled and Frequent Contributors
Myth: Publicly releasing open source code will attract flurries of patches and new contributors.
Reality: You'll be lucky to hear from people merely using your code, much less those interested in modifying it.
While user (and developer) feedback is an advantage of open source software, it's not required by most licenses, nor is it guaranteed by any social or technical means. When was the last time you reported a bug? When was the last time you tried to fix a bug? When was the last time you produced a patch? When was the last time you told a developer how her work solved your problem?
Related Reading
![]()
Dancing Barefoot
By Wil WheatonSome projects grow large and attract many developers. Many more projects have only a few developers. Most of the code in a given project comes from one or a few developers. That's not bad — most projects don't need to be huge to be successful — but it's worth keeping in mind.
The problem may be the definition of success. If your goal is to become famous, open source development probably isn't for you. If your goal is to become influential, open source development probably isn't for you. Those may both happen, but it's far more important to write and to share good software. Success is also hard to judge by other traditional means. It's difficult to count the number of people using your code, for example.
It's far more important to write and to share good software. Be content to produce a useful program of sufficiently high quality. Be happy to get a couple of patches now and then. Be proud if one or two developers join your project. There's your success.
This isn't a myth because it never happens. It's a myth because it doesn't happen as often as we'd like.
Feature Freezes Help Stability
Myth: Stopping new development for weeks or months to fix bugs is the best way to produce stable, polished software.
Reality: Stopping new development for awhile to find and fix unknown bugs is fine. That's only a part of writing good software.
The best way to write good software is not to write bugs in the first place. Several techniques can help, including test-driven development, code reviews, and working in small steps. All three ideas address the concept of managing technical debt: entropy increases, so take care of small problems before they grow large.
Think of your project as your home. If you put things back when you're done with them, take out the trash every few days, and generally keep things in order, it's easy to tidy up before having friends over. If you rush around in the hours before your party, you'll end up stuffing things in drawers and closets. That may work in the short term, but eventually you'll need something you stashed away. Good luck.
By avoiding bugs where possible, keeping the project clean and working as well as possible, and fixing things as you go, you'll make it easier for users to test your project. They'll probably find smaller bugs, as the big ones just won't be there. If you're lucky (the kind of luck attracted by clear-thinking and hard work), you'll pick up ideas for avoiding those bugs next time.
Another goal of feature freezes is to solicit feedback from a wider range of users, especially those who use the code in their own projects. This is a good practice. At best, only a portion of the intended users will participate. The only way to get feedback from your entire audience is to release your code so that it reaches as many of them as possible.
Many of the users you most want to test your code before an official release won't. The phrase "stable release" has special magic that "alpha," "beta," and "prelease" lack. The best way to get user feedback is to release your code in a stable form.
Make it easy to keep your software clean, stable, and releasable. Make it a priority to fix bugs as you find them. Seek feedback during development, but don't lose momentum for weeks on end as you try to convince everyone to switch gears from writing new code to finding and closing old bugs.
This isn't a myth because it's bad advice. It's only a myth because there's better advice.
The Best Way to Learn a Project is to Fix its Bugs and Read its Code
Myth: New developers interested in the project will best learn the project by fixing bugs and reading the source code.
Reality: Reading code is difficult. Fixing bugs is difficult and probably something you don't want to do anyway. While giving someone unglamorous work is a good way to test his dedication, it relies on unstructured learning by osmosis.
Learning a new project can be difficult. Given a huge archive of source code, where do you start? Do you just pick a corner and start reading? Do you fire up the debugger and step through? Do you search for strings seen in the user interface?
While there's no substitute for reading the code, using the code as your only guide to the project is like mapping the California coast one pebble at a time. Sure, you'll get a sense of all the details, but how will you tell one pebble from the next? It's possible to understand a project by working your way up from the details, but it's easier to understand how the individual pieces fit together if you've already seen them from ten thousand feet.
Writing any project over a few hundred lines of code means creating a vocabulary. Usually this is expressed through function and variable names. (Think of "interrupts," "pages," and "faults" in a kernel, for example.) Sometimes it takes the form of a larger metaphor. (Python's Twisted framework uses a sandwich metaphor.)
Your project needs an overview. This should describe your goals and offer enough of a roadmap so people know where development is headed. You may not be able to predict volunteer contributions (or even if you'll receive any), but you should have a rough idea of the features you've implemented, the features you want to implement, and the problems you've encountered along the way.
If you're writing automated tests as you go along (and you certainly should be), these tests can help make sense of the code. Customer tests, named appropriately, can provide conceptual links from working code to required features.
Keep your overview and your tests up-to-date, though. Outdated documentation can be better than no documentation, but misleading documentation is, at best, annoying and unpleasant.
This isn't a myth because reading the code and fixing bugs won't help people understand the project. It's a myth because the code is only an artifact of the project.
Packaging Doesn't Matter
Myth: Installation and configuration aren't as important as making the source available.
Reality: If it takes too much work just to get the software working, many people will silently quit.
Potential users become actual users through several steps. They hear about the project. Next, they find and download the software. Then they must brave the installation process. The easier it is to install your software, the sooner people can play with it. Conversely, the more difficult the installation, the more people will give up, often without giving you any feedback.
Granted, you may find people who struggle through the installation, report bugs, and even send in patches, but they're relatively few in number. (I once wrote an installation guide for a piece of open source software and then took a job working on the code several months later. Sometimes it's worth persisting.)
Difficulties often arise in two areas: managing dependencies and creating the initial configuration. For a good example of installation and customization, see Brian Ingerson's Kwiki. The amount of time he put into making installation easier has paid off by saving many users hours of customization. Those savings, in turn, have increased the number of people willing to continue using his code. It's so easy to use, why not set up a Kwiki for every good idea that comes along?
It's OK to expect that mostly programmers will use development tools and libraries. It's also OK to assume that people should skim the details in the
READMEandINSTALLfiles before trying to build the code. If you can't easily build, test, and install your code on another machine, though, you have no business releasing it to other people.It's not always possible, nor advisable, to avoid dependencies. Complex web applications likely require a database, a web server with special configurations (
mod_perl,mod_php,mod_python, or a Java stack). Meta-distributions can help. Apache Toolbox can take out much of the pain of Apache configuration. Perl bundles can make it easier to install several CPAN modules. OS packages (RPMs, debs, ebuilds, ports, and packages) can help.It takes time to make these bundles and you might not have the hardware, software, or time to write and test them on all possible combinations. That's understandable; source code is the real compatibility layer on the free Unix platforms anyway.
At a minimum, however, you should make your dependencies clear. Your configuration process should detect as many dependencies as possible without user input. It's OK to require more customization for more advanced features. However, users should be able to build and to install your software without having to dig through a manual or suck down the latest and greatest code from CVS for a dozen other projects.
This isn't a myth because people really believe software should be difficult to install. It's a myth because many projects don't make it easier to install.
It's Better to Start from Scratch
Myth: Bad or unappealing code or projects should be thrown away completely.
Reality: Solving the same simple problems again and again wastes time that could be applied to solving new, larger problems.
Writing maintainable code is important. Perhaps it's the most important practice of software development. It's secondary, though, to solving a problem. While you should strive for clean, well-tested, and well-designed code that's reasonably easy to modify as you add features, it's even more important that your code actually works.
Throwing away working code is usually a mistake. This applies to functions and libraries as well as entire programs. Sometimes it seems as if most of the effort in writing open source software goes to creating simple text editors, weblogs, and IRC clients that will never attract more than a handful of users.
Many codebases are hard to read. It's hard to justify throwing away the things the code does well, though. Software isn't physical — it's relatively easy to change, even at the design level. It's not a building, where deciding to build four stories instead of two means digging up the entire foundation and starting over. Chances are, you've already solved several problems that you'd need to rediscover, reconsider, re-code, and re-debug if you threw everything away.
Every new line of code you write has potential bugs. You will spend time debugging them. Though discipline (such as test-driven development, continual code review, and working in small steps) mitigates the effects, they don't compare in effectiveness to working on already-debugged, already-tested, and already-reviewed code.
Too much effort is spent rewriting the simple things and not enough effort is spent reusing existing code. That doesn't mean you have to put up with bad (or simply different) ideas in the existing code. Clean them up as you go along. It's usually faster to refine code into something great than to wait for it to spring fully formed and perfect from your mind.
This isn't a myth because rewriting bad code is wrong. It's a myth because it can be much easier to reuse and to refactor code than to replace it wholesale.
Programs Suck; Frameworks Rule!
Myth: It's better to provide a framework for lots of people to solve lots of problems than to solve only one problem well.
Reality: It's really hard to write a good framework unless you're already using it to solve at least one real problem.
Which is better, writing a library for one specific project or writing a library that lots of projects can use?
Software developers have long pursued abstraction and reuse. These twin goals have driven the adoption of structured programming, object orientation, and modern aspects and traits, though not exactly to roaring successes. Whether proprietary code, patent encumbrances, or not-invented-here stubbornness, there may be more people producing "reusable" code than actually reusing code.
Part of the problem is that it's more glamorous (in the delusive sense of the word) to solve a huge problem. Compare "Wouldn't it be nice if people had a fast, cross-platform engine that could handle any kind of 3D game, from shooter to multiplayer RPG to adventure?" to "Wouldn't it be nice to have a simple but fun open source shooter?"
Big ambitions, while laudable, have at least two drawbacks. First, big goals make for big projects — projects that need more resources than you may have. Can you draw in enough people to spend dozens of man-years on a project, especially as that project only makes it possible to spend more time making the actual game? Can you keep the whole project in your head?
Second, it's exceedingly difficult to know what is useful and good in a framework unless you're actually using it. Is one particular function call awkward? Does it take more setup work than you need? Have you optimized for the wrong ideas?
Curiously, some of the most portable and flexible open source projects today started out deliberately small. The Linux kernel originally ran only on x86 processors. It's now impressively portable, from embedded processors to mainframes and super-computer clusters. The architecture-dependent portions of the code tend to be small. Code reuse in the kernel grew out of refining the design over time.
Solve your real problem first. Generalize after you have working code. Repeat. This kind of reuse is opportunistic.
This isn't a myth because frameworks are bad. This is a myth because it's amazingly difficult to know what every project of a type will need until you have at least one working project of that type.
I'll Do it Right *This* Time
Myth: Even though your previous code was buggy, undocumented, hard to maintain, or slow, your next attempt will be perfect.
Reality: If you weren't disciplined then, why would you be disciplined now?
Widespread Internet connectivity and adoption of Free and Open programming languages and tools make it easy to distribute code. On one hand, this lowers the barriers for people to contribute to open source software. On the other hand, the ease of distribution makes finding errors less crucial. This article has been copyedited, but not to the same degree as a print book; it's very easy to make corrections on the Web.
It's very easy to put out code that works, though it's buggy, undocumented, slow, or hard to maintain. Of course, imperfect code that solves a problem is much better than perfect code that doesn't exist. It's OK (and even commendable) to release code with limitations, as long as you're honest about its limitations — though you should remove the ones that don't make sense.
The problem is putting out bad code knowingly, expecting that you'll fix it later. You probably won't. Don't keep bad code around. Fix it or throw it away.
This may seem to contradict the idea of not rewriting code from scratch. In conjunction, though, both ideas summarize to the rule of "Know what's worth keeping." It's OK to write quick and dirty code to figure out a problem. Just don't distribute it. Clean it up first.
Develop good coding habits. Training yourself to write clean, sensible, and well-tested code takes time. Practice on all code you write. Getting out of the habit is, unfortunately, very easy.
If you find yourself needing to rewrite code before you publish it, take notes on what you improve. If a maintainer rejects a patch over cleanliness issues, ask the project for suggestions to improve your next attempt. (If you're the maintainer, set some guidelines and spend some time coaching people along as an investment. If it doesn't immediately pay off to your project, it may help along other projects.) The opportunity for code review is a prime benefit of participating in open source development. Take advantage of it.
This isn't a myth because it's impossible to improve your coding habits. This is a myth because too few developers actually have concrete, sensible plans to improve.
Warnings Are OK
Myth: Warnings are just warnings. They're not errors and no one really cares about them.
Reality: Warnings can hide real problems, especially if you get used to them.
It's difficult to design a truly generic language, compiler, or library partially because it's impossible to imagine all of its potential uses. The same rule applies to reporting warnings. While you can detect some dangerous or nonsensical conditions, it's possible that users who really know what they are doing should be able to bypass those warnings. In effect, it's sometimes very useful to be able to say, "I realize this is a nasty hack, but I'm willing to put up with the consequences in this one situation."
Other times, what you consider a warnable or exceptional condition may not be worth mentioning in another context. Of course, the developer using the tool could just ignore the warnings, especially if they're nonfatal and are easily shunted off elsewhere (even if it is
/dev/null). This is a problem.When the "low oil pressure" or "low battery" light comes on in a car, the proper response is to make sure that everything is running well. It's possible that the light or a sensor is malfunctioning, but ignoring the real problem — whether bad light or oil leak — may exacerbate further problems. If you assume that the light has malfunctioned but never replace it, how will you know if you're really out of oil?
Similarly, an error log filled with trivial, fixable warnings may hide serious problems. Any well-designed tool generates warnings for a good reason: you're doing something suspicious.
When possible, purge all warnings from your code. If you expect a warning to occur — and if you have a good reason for it — disable it in the narrowest possible scope. If it's generated by something the user does and if the user is privy to the warning, make it clear how to avoid that condition.
Running a program that spews crazy font configuration questions and null widget access messages to the console is noisy and incredibly useless to anyone who'd rather run your software than fix your mess. Besides that, it's much easier to dig through error logs that only track real bugs and failures. Anything that makes it easier to find and fix bugs is nice.
This isn't a myth because people really ignore warnings. It's a myth because too few people take the effort to clean them up.
End Users Love Tracking CVS
Myth: Users don't mind upgrading to the latest version from CVS for a bugfix or a long-awaited feature.
Reality: If it's difficult for you to provide important bugfixes for previous releases, your CVS tree probably isn't very stable.
It's tricky to stay abreast of a project's latest development sources. Not only do you have to keep track of the latest check-ins, you may have to guess when things are likely to spend more time working than crashing and build binaries right then. You can waste a lot of time watching compiles fail. That's not much fun for a developer. It's even less exciting for someone who just wants to use the software.
Building software from CVS also likely means bypassing your distribution's usual package manager. That can get tangled very quickly. Try to keep required libraries up-to-date for only two applications you compiled on your own for awhile. You'll gain a new appreciation for people who make and test packages.
There are two main solutions to this trouble.
First, keep your main development sources stable and releasable. It should be possible for a dedicated user (or, at least, a package maintainer for a distribution) to check out the current development sources and build a working program with reasonable effort. This is also in your best interests as a developer: the easier the build and the fewer compile, build, and installation errors you allow to persist, the easier it is for existing developers to continue their work and for new developers to start their work.
Second, release your code regularly. Backport fixes if you have to fix really important bugs between releases; that's why tags and branches exist in CVS. This is much easier if you keep your code stable and releasable. Though there's no guarantee users will update every release, working on a couple of features per release tends to be easier anyway.
This isn't a myth because developers believe that development moves too fast for snapshots. It's a myth because developers aren't putting out smaller, more stable, more frequent releases.
Common Sense Conclusions
Again, these aren't myths because they're never true. There are good reasons to have a feature freeze. There are good reasons to invite new developers to get to know a project by looking through small or simple bug reports. Sometimes, it does make sense to write a framework. They're just not always true.
It's always worth examining why you do what you do. What prevents you from releasing a new stable version every month or two? Can you solve that problem? Solve it. Would building up a good test suite help you cut your bug rates? Build it. Can you refactor a scary piece of code into something saner in a series of small steps? Refactor it.
Making your source code available to the world doesn't make all of the problems of software development go away. You still need discipline, intelligence, and sometimes, creative solutions to weird problems. Fortunately, open source developers have more options. Not only can we work with smart people from all over the world, we have the opportunity to watch other projects solve problems well (and, occasionally, poorly).
Learn from their examples, not just their code.
chromatic is the technical editor of the O'Reilly Network and the co-author of Perl Testing: A Developer's Notebook.
Here at the U of C, we have a big grid of Sun Blade 1000 workstations, with gcc and g++ for compilers. There are some subtle differences between GCC/Solaris and GCC/x86-Linux, and this is a list of what I've come accross so far.
This file describes differences between GNU compilers on x86 machines and Solaris machines. These are all from experience, so who knows how accurate they are.
Note that I'm assuming the code is being developed on a Linux box, and then later being ported.
Textbooks are full of good advices:
Use other aids as well. Explaining your code to someone else (even a teddy bear) is wonderfully effective. Use a debugger to get a stak trace. Use some of the commercial tools that check for memory leaks, array bounds violations, suspect code and the like. Step through your program when it has become clear that you have the wrong picture of how the code works.
— Brian W. Kernighan, Rob Pike, The practice of programming, 1999 (Chapter 5: Debugging)Enable every optional warning; view the warnings as a risk-free, high-return investment in your program. Don't ask, "Should I enable this warning?" Instead ask, "Why shouldn't I enable it?" Turn on every warning unless you have an excellent reason not to.
— Steve Macguire, Writing solid code, 1993Sounds familiar? But with which option? This page tries to answer that kind of question.
Constructive feedback is welcome.
Hi
gcc 2.95.1
Solaris 2.7
c++ -Wall -g -W -Wpointer-arith -Wbad-function-cast -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -c -o glx/i_figureeight.o -DHAVE_CONFIG_H -DDEF_FILESEARCHPATH=\"/usr/remote/lib/app-defaults/%N%C%S:/usr/remote/lib/app-defaults/%N%S\" -I. -I.. -I../../xlock/ -I../.. -I/usr/openwin/include -I/usr/remote/include/X11 -I/usr/remote/include -I/usr/dt/include -g -O2 ../../modes/glx/i_figureeight.cc
In file included from ../../xlock/xlock.h:144,
from ../../modes/glx/i_twojet.h:7,
from ../../modes/glx/i_threejet.h:3,
from ../../modes/glx/i_threejetvec.h:3,
from ../../modes/glx/i_figureeight.h:3,
from ../../modes/glx/i_figureeight.cc:1:
/usr/openwin/include/X11/Xlib.h:2063: ANSI C++ forbids declaration `XSetTransientForHint' with no type
I maintain xlock and older versions no longer compile out of the box.
I am not in control of the include files that Sun distributes from
/usr/openwin. A warning I can live with easier.
The only way I see around this was to require -fpermissive if using g++
on Solaris. My worry is that -fpermissive may not be supported by all
versions of g++ and may cause another error.
--
Cheers,
/X\ David A. Bagley
(( X bagleyd@tux.org http://www.tux.org/~bagleyd/
\X/ xlockmore and more ftp://ftp.tux.org/pub/tux/bagleyd
Signed releases
(Posted Apr 22, 2005 5:14 UTC (Fri) by guest yem) (Post reply) Still no strong signature for the tarballs. What is with these guys?
PS: congrats!
Signed releases
(Posted Apr 22, 2005 6:43 UTC (Fri) by subscriber nix) (Post reply) Er, the tarballs all have OpenPGP signatures.
(You can't upload anything to ftp.gnu.org and mirrors anymore without that.)
Apologies
(Posted Apr 22, 2005 8:12 UTC (Fri) by guest yem) (Post reply) Ah so they do. Sorry. ftp.gnu.org was down and the mirror I checked isn't carrying the signatures.
All is well :-)
gcc 4.0 available
(Posted Apr 22, 2005 5:21 UTC (Fri) by guest xoddam) (Post reply) Congratulations and thanks to the gcc maintainers. This will be a big
step forward as it stabilised and becomes a preferred compiler. Though
I'm sure some people will go on using gcc 2.95 forever :-)
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 6:27 UTC (Fri) by subscriber dank) (Post reply) Hey, don't knock gcc-2.95.3.
It was a very good release in many ways,
and on some benchmarks, beats every
later version of gcc so far, up to
and including gcc-3.4.
(I haven't tested gcc-4.0.0 yet, but
I gather it won't change that. I'm hoping gcc-4.1.0 finally
knocks gcc-2.95.3 off its last perch, myself.)
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 6:45 UTC (Fri) by subscriber nix) (Post reply) It's when the RTL optimizations start getting disabled that you'll see real speedups. Right now most of them are enabled but not doing as much as they used to, which is why GCC hasn't slowed down significantly in 4.x despite having literally dozens of new optimization passes over 3.x.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 11:29 UTC (Fri) by guest steven97) (Post reply) You are making two assumptions that are wrong:
1) rtl optimizers will be disabled. It appears this won't happen any
time soon.
2) rtl optimizers do less, so they consume less time. I wish that were
true. There is usually no relation between the number of transformations
and the running time of a pass. Most of the time is in visiting
instructions and doing the data flow analysis. That takes time even if
there isn't a single opportunity for a pass to do something useful.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 12:39 UTC (Fri) by subscriber nix) (Post reply) 1) rtl optimizers will be disabled. It appears this won't happen any time soon.
I'm aware that you're involved in an ongoing flamewar, er, I mean animated discussion in this area, and I'm staying well out of it :)
If the damned things weren't so intertwined they'd be easier to ditch: and indeed it's their intertwined and hard-to-maintain nature that makes it all the more important to try to ditch them (or at least simplify them to an absolute minimum).
Obviously some optimizations (peepholes and such) actually benefit from being performed at such a low level, but does anyone really think that loop analysis, for instance, should be performed on RTL? It is, but its benefits at that level are... limited compared to its time cost.
2) rtl optimizers do less, so they consume less time. I wish that were true. There is usually no relation between the number of transformations and the running time of a pass. Most of the time is in visiting instructions and doing the data flow analysis. That takes time even if there isn't a single opportunity for a pass to do something useful.
Er, but the compiler's not slowed down significantly even with optimization on. Are the tree-ssa passes really so fast that they add nearly no time to the compiler's runtime? My -ftime-report dumps don't suggest so.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 18:02 UTC (Fri) by guest steven97) (Post reply) Most tree optimizers _are_ fast, but not so fast that they consume no
time at all. But they optimize so much away that the amount of RTL
produced is less. If that is what you had in mind when you said "RTL
optimizers do less", then yes, there is just less RTL to look at, so
while most RTL passes still look at the whole function, they look at a
smaller function most of the time. That is one reason.
The other reason why GCC4 is not slower (not much ;-) than GCC3 is that
many rather annoying quadratic algorithms in the compiler have been
removed. With a little effort, some of the patches for that could be
backported to e.g. GCC 3.4, and you'd probably get a significantly faster
GCC3. Other patches were only possible because there is an optimization
path now before RTL is generated.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 21:02 UTC (Fri) by subscriber nix) (Post reply) That's what I meant, yes, and it's so intuitively obvious that it amazed me to see you disagreeing. Obviously less code -> less work -> less time!
I didn't mean the RTL optimizers had become intrinsically faster (except inasmuch as code's been ripped out of them).
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 16:03 UTC (Fri) by subscriber Ross) (Post reply) I'm not sure he was talking about the speed of the compiler. I read it as
talking about the quality of the generated code. I could easily be wrong
though.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 17:06 UTC (Fri) by guest mmarq) (Post reply) " I'm not sure he was talking about the speed of the compiler. I read it as talking about the quality of the generated code. "
And that is what should matter the most; *The end user*. Because if people complain about the speed of the compilation process they should change to a better computer, perhaps a NForce 4/5 based for Atlhon64 or Pentium4 or the latest VIA chipsets with support for SLI and those Dual Core CPUs coming out soon!...
... he, right!, support for those beasts aren't good enough for Linux right now! But that isn't much different from what was in, say 2001!...
I've no intention to add to any flamewar, but my point is as exposed above that the community trend to discuss heavily on less important issues. The Linux commercial party are battling for scratchs while the majority of end users not only don't know, but they don't want to know, because Linux like Unix is viewed as something for geeks or bearded gurus,..., and worst of all standarts go at the speed of a snail, because the philosophy is add features and avoid standards.
There are hundreds of distros but i havent seen one that adds a report of tested hardware configurations (if anyone know one please link it), or care about those, or care about being *religious* about standards, because that is the only way to expose the masses of low tech end users to the same 'methods' and 'ways', for a much larger period of time, adding the change for distros to get very good at the 'interface for low tech users',and in consequence gain a larger adoption percentage.
Open Source community is closing itself inside it's own technical space! And when, if, that happens completly, then it's another Unix story almost like a carbon copy.
Hardware databases
(Posted Apr 22, 2005 21:16 UTC (Fri) by subscriber sdalley) (Post reply) Novell/Suse makes a reasonable attempt, see the links on http://cdb.novell.com/?LANG=en_UK .
Hardware databases
(Posted Apr 24, 2005 17:09 UTC (Sun) by guest mmarq) (Post reply) " Novell/Suse makes a reasonable attempt,... "
I've done a search on that site, on 'Certified Hardware' for hardware/software, for the companys ASUSTEK, ECS, EPOX, DFI, GIGABYTE and INTEL with the the keywords "motherbord", and without any keyword which means every piece of hardware.Since those are manufactores that also do Graphic Boards besides Mobos, they would represent perhaps more than 70% of a common desktop system, and representing perhaps more than 70% of the market, very ahead of the integrators HP/Compaq, IBM, gateway and DELL all put togheter. And Since some of those manufactors also do server 'iron', Mobos or systems, i belive that is represented, perhaps not far from 90% of *all* (server+desktop) deployed base.
The only result i've got was for ASUSTEK showing old Network Servers, and INTEL showing LAN driver(net adpaters), RAID adapters and Network Servers, some aging a lot??!!!
Understanding what line of business Novell is in, still i consider this very far from reasonable... not reasonable even to them if they want to survive in a medium to long term!.
gcc-2.95.3 was a good vintage...
(Posted Apr 22, 2005 21:36 UTC (Fri) by subscriber nix) (Post reply) The standards-compliance changes in GCC at least (and there have been many) weren't a matter of making GCC reject noncompliant code so much as they were one of making it accept compliant code it'd been wrongly rejecting. I mean, nobody waded into the compiler thinking `Shiver me lexers, what widely-used extension shall I remove today? Arrr!' --- it's more that, say, the entire C++ parser was rewritten (thank you, Mark!), and in the process a bunch of extensions got dropped because they were rarely-used and didn't seem worth reimplementing, and a bunch of noncompliant nonsense that G++ had incorrectly accepted was now correctly rejected, *simply because accepting the nonsense had always been a bug*, just one that had previously been too hard to fix.
(Oh, also, GCC is very much more than `the Linux compiler'. All the free BSDs use it, many commercial Unix shops use it, Cygwin uses it, Apple relies on it for MacOSX, and it's very widely used in the embedded and (I believe) avionics worlds. Even if, with the wave of a magic wand, the Hurd was perfected and Linux dissolved into mist tomorrow, GCC would still be here.)
gcc2.95.3 was a good vintage...
(Posted Apr 22, 2005 21:22 UTC (Fri) by subscriber nix) (Post reply) Well in that case he's likely wrong :) Even though the focus of much of the 3.x series was standards-compliance, not optimization, and 3.x didn't have tree-ssa, there have been some notable improvements in that time, like the new i386 backend.
Alas, major performance gains on register-poor arches like IA32 may be hard to realize without rewriting the register allocator --- and the part of GCC that does register allocation (badly) also does so much else, and is so old and crufty, that rewriting it is a heroic task that has so far defeated all comers...
gcc-2.95.3 was a good vintage...
(Posted Apr 25, 2005 6:38 UTC (Mon) by guest HalfMoon) (Post reply)
Alas, major performance gains on register-poor arches like IA32 may be hard to realize without rewriting the register allocator ...
Then there's Opteron, or at least AMD64 ... odd how by the time GCC starts to get serious support for x86, the hardware finally started to grow up (no thanks to Intel of course).
gcc-2.95.3 was a good vintage...
(Posted Apr 24, 2005 20:35 UTC (Sun) by subscriber dank) (Post reply) Yes, I meant the quality of the generated code.(I care about the speed of compilation, too, but gcc-4.0 is doing fine in that area, I think.)
I'd love to switch to the new compiler, because I value its improved standards compliance, but it's hard for me to argue for a switch when it *slows down* important applications.
I don't need *better* code before I switch, but I do need to verify there are no performance regressions. And sadly, there are still some of those in apps compiled with gcc-3.4.1 compared to gcc-2.95.3. As I said in my original post, I don't expect later versions to definitively beat 2.95.3 until gcc-4.1.
The whole point of gcc-4.0 is to shake out the bugs in the new tree optimization stuff. I am starting to build and test all my apps with gcc-4.0 and plan to help resolve any problems I find, because I want to be ready for gcc-4.1.
Strings are now unavoidably constants
(Posted Apr 22, 2005 11:35 UTC (Fri) by subscriber gdt) (Post reply) The removal of the -fwritable-strings option will flush out any code yet to be moved to ANSI C. It will be interesting to see how much there is.
Our user group had an experience this week of a program SEGVing from writing to a string constant. The beginner programmer had typed in example code from a C textbook which was popular five years ago, and was obviously confused and concerned that it didn't work. So not all pre-ANSI code will be old.
Strings are now unavoidably constants
(Posted Apr 22, 2005 21:39 UTC (Fri) by subscriber nix) (Post reply) The removal of the -fwritable-strings option will flush out any code yet to be moved to ANSI C.
I think the removal of -traditional is more likely to do that --- and that happened in 3.3.x ;)
Strings are now unavoidably constants
(Posted Apr 22, 2005 22:38 UTC (Fri) by subscriber gdt) (Post reply) Sorry, I expressed myself poorly. There's a lot of code out there that is K&R with ANSI function definitions. I'm interested to see how many of these break from this semantic change.
I've no idea if it is a little or a lot. It will be interesting to see.
Strings are now unavoidably constants
(Posted Apr 23, 2005 21:30 UTC (Sat) by subscriber nix) (Post reply) Well, Apple's preserved the option in their tree (used for MacOS X) because they have some stuff they know breaks...
Major decisions about GCC are made by the steering committee, guided by the mission statement.
We encourage everyone to contribute changes and help testing GCC, and we provide access to our development sources with anonymous CVS and weekly snapshots.
We strive to provide regular, high quality releases, which we want to work well on a variety of native (including GNU/Linux) and cross targets. To that end, we use an extensive test suite and automated regression testers as well as various benchmark suites and automated testers to maintain and improve quality.
The Pentium Compiler Group was founded in late '95 to enhance and support pentium optimization in GCC (the GNU C Compiler). GCC does a very good job when optimizing, but the Pentium Chip's architecture demanded different optimization strategies.
Other implementations
Linux.DaveCentral.com Programming - C-C++, Page 1
GCC Development Toolchain for x86-win32 targets
The Minimalist GNU Win32 Package is not a compiler or a compiler suite.
The Minimalist GNU Win32 Package (or Mingw) is simply a set of header files and initialization code which allows a GNU compiler to link programs with one of the C run-time libraries provided by Microsoft. By default it uses CRTDLL, which is built into all Win32 operating systems. This means that your programs are small, stand-alone, and reasonably quick. I personally believe it is a good option for programmers who want to do native Win32 programming, either of new code or when creating a native port of an application. For example, the latest versions of gcc itself, along with many of the supporting utilities, can be compiled using the Mingw headers and libraries.
Visit the Mingw mailing list on the Web at http://www.egroups.com/group/mingw32/. Also see the Mingw32 FAQ at http://www.mingw.org/mingwfaq.shtml.
Mingw was mentioned (in passing, down near the bottom... but that's enough for me) in an interview at O'Reilly. Aside from another mention in a Japanese magazine called "C Magazine" (as a sidebar in an article about Cygwin) this is only the second time I know of that Mingw was mentioned by any 'serious' media. Neat huh?
Both of these compiler suites, based on gcc, were built with Mingw32 and include Mingw32.
These are old and only of historical interest. Real developers interested in the source code should get the much newer Mingw runtime from Mumit Khan's ftp site.
The Cygwin Project by Cygnus Solutions is an attempt to provide a UNIX programming environment on Win32 operating systems. As part of this effort the suite of GNU software development tools (including gcc, the GNU C/C++ compiler) has been ported to Win32. The Cygwin project lead directly to the first versions of gcc that could produce Win32 software and allowed me to set up the first version of Mingw32.
For more information on Cygwin, including where to download it and how to subscribe to the Cygwin mailing list, visit the Cygwin Project Page.
Also try this page for more information about GNU programming tools on Win32, and how to install and use them.
I would like to list a bunch of them but... this is all I could find.
Under Construction...
A tutorial on how use GNU tools and other free tools to write Win32 programs.
I also have some pointers and downloads of extras, useful tools and alternatives for GNU-Win32 or Minimalist GNU-Win32.
Re:Misplaced blame (Score:4, Funny)
by Screaming Lunatic (526975) on Friday April 22, @04:55AM (#12311278)
(http://parveenkaler.com/)Blame the standards committee, not the GCC maintainers. Insightful? Jesus eff-ing Christ. Now the slashbots don't like standards. I bet you wouldn't be presenting the same argument if this discussion was about the transition from MSVC 6.0 to 7.0/7.1.
Funny? Jesus eff-ing Christ. When did pointing out the hypocricy of slashdot group think become funny? I don't get which part of my original statement is funny.
Re:Misplaced blame (Score:5, Funny)
by Mancat (831487) on Thursday April 21, @11:40PM (#12310121)Mechanic: Sir, your car is ready.
Customer: Thanks for fixing it so quickly!
Mechanic: We didn't fix it. We just brought it up to standards. Oh, by the way, your air conditioning no longer works, and your rear brakes are now disabled.
Customer: Uhh.. What?
Mechanic: That's right. The standard refrigerant is now R-134A, so we removed your old R-14 air conditioning system. Also, disc brakes are now standard in the autmotive world, so we removed your drum brakes. Don't drive too fast.
Customer: What the fuck?
Mechanic: Oh, I almost forgot. Your car doesn't have airbags. We're going to have to remove your car's body and replace it with a giant tube frame lined with air mattresses.
Build-Install OpenSolaris at OpenSolaris.org by Rich Teer
This is the first of two articles in which we describe how to acquire and build the source code for OpenSolaris. The first article provides all the necessary background information (terminology, where to get the tools, and so on) and describes a basic compilation and installation, and the second article will describe a more complicated compilation and installation.
These articles describe how to build and install OpenSolaris; they are not intended to be an "OpenSolaris developers' guide", so information beyond that which is required for building and installing OpenSolaris is not included. This should not be seen as a problem, however, because (as with most other large-scale open source projects) the number of active OpenSolaris developers who will need this knowledge is likely to be small compared to the number of people who will want to build it for their own edification.
These articles assume at least a passing familiarity with building major software projects and some C programming. It is unlikely that someone who is struggling to compile "Hello World" would be trying to compile OpenSolaris! However, we will otherwise assume no knowledge of building Solaris, and describe all the necessary steps.
Developing for Linux on Intel - For many Windows* developers, Linux* presents a learning challenge. Not only does Linux have a different programming model, but it also requires its own toolchain, as programmers must leave behind the Visual Studio* (VS) or Visual Studio* .NET (VS.NET) suites and third-party plug-in ecosystem. This article helps Windows developers understand the options available as they seek to replicate, on Linux, the rich and efficient toolchain experience they've long enjoyed on Windows.
Ah things no longer compiling
In the long term, I think it was a very good thing: coding C (and C++, but didn't
have that much experience on that) got much more strict and in my experience, removes
a lot of possible problems later on.
If someone had a lot of problems porting 2.95 to 3.2, his code needed to be reviewed
anyway. It kind of removes the "boy" from "cowboys" in coders (experience is drawn
from not-so-embedded systems).
Based on the remarks obtained from the compiler for embedded code (they made a lot
of sense) during the switch and gcc becoming more strict, we now even compile everything
with -Werror.
In our deeply embedded networking code, we got a speed improvement of 20% just switching
to 3.4 (from 3.3)
Go GCC!
|
Re:i'm having horrible flashbacks... (Score:4,
Funny) by MarsDude (74832) on Friday April 22, @02:07AM (#12310773) (http://www.marsdude.com/) |
| ... kind of removes the "boy" from "cowboys" Which results in..... cows |
Copyright © 1996-2008 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: November 08, 2008