[NTLUG:Discuss] Need some inputs on porting.
Kelledin
kelledin+NTLUG at skarpsey.dyndns.org
Tue Sep 30 08:09:10 CDT 2003
On Tuesday 30 September 2003 04:14 am, Vaidya, Harshal
(Cognizant) wrote:
> Its a complex application with a lot of GUI and business
> logic tuned towards banking.
> Its Deployed on Solaris 2.8.
> Its completely written in C++.
So far, so good. If it's ANSI-portable C++ (i.e. doesn't do
funny things with system-specific calls), you should be fine.
> It uses third party tools like Roguewave tools for XML
> processing and GUI.
Hmmm. Not sure if Roguewave is available for Linux. I've never
even heard of it.
> The application has roughly about one million lines of code.
A fair amount of work, but doable.
> The solution needs the following things to be mandatory.
>
> We need to make the entire code compatible to gcc 3.3.
>
> With this I have several questions in mind. Is there anything
> special with 3.3? According to me if the entire application is
> recompiled with gcc 3.3 over Linux and Solaris our work should
> be done. All we will need to do is see whether the compilation
> on both Solaris and Linux goes smoothly. Any comments?
From what you've told me, that's essentially correct. Note that
in some cases, though, gcc-3.3.x is much stricter than other gcc
releases (say, gcc-3.2.x). Maybe 1-2% of current gcc-tailored
apps need a touch of code reworking to compile with the most
recent versions of gcc.
Of course, since gcc is so cross-platform, you might possibly be
able to install 3.3.x on Solaris 2.8. You could ease your
migration a bit by doing that--worry about GCC compatibility
without having to simultaneously wrangle with possible Linux
compatibility issues. You could also have a rather better
compiler on the Solaris boxen than the default Solaris cc. ;-)
> Thirdly, we need to make the code 32 and 64 bit compatible!!
> The deployment platforms are Linux and Solaris both.
>
> Now, this is the killer one!!!
>
> How do you think the problem of 32 to 64 bit compatibility
> should be addressed?
Oooh! This could be a tough one.
A good starting point would be to compile your app with "gcc
-Wall -Wpedantic". A lot of the resulting warning messages
generated by GCC are invaluable here. Some of the ones you need
to look out for in particular (wording may be slightly
inaccurate):
"assignment from/to pointer to/from integer without a cast"
(obvious no-no)
"cast from/to pointer to/from integer of different size"
(again, obvious no-no)
"[xxx] format, [yyy] arg." (this relates to printf/scanf
statements)
"implicit declaration of function [zzz]." (gcc assumes that
any implicitly declared function returns an int. kind of
bad if it actually returns a pointer!)
I do a lot of porting like this (I run LinuxFromScratch on an
EV56 Alpha box). Interestingly enough, for most packages, it's
enough to simply watch out for relevant GCC warnings and tweak
the source code when they crop up.
Some exceedingly braindead packages (i.e. crafty) need more than
that, but not many.
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
More information about the Discuss
mailing list