Building time for Chrome V8 and Chromium - v8

I am interested in changing some codes in Chrome V8 and Chromium, but it seems that compilation is too long (like 4 hours for Chromium)
I hope to know is there any incremental build supported, and what is your building time for: Chrome V8 (https://developers.google.com/v8/build) and Chromium (https://www.chromium.org/Home)?
I am using Windows, but I can switch to another OS if it is building faster

Oh yes, it takes quite a while to compile v8 and Chromium.
The first thing you should do is run the build in parallel: -j8 for a quad core machine for example. It can also build on multiple machines - see the documentation for more flags.
Also, of course subsequent builds will be much faster and compilation artifacts will be reused. Subsequent compiles can be under a minute.

Related

How to build or get a original latest version of GCC for Windows?

I want a latest version of GCC for Windows.
Now the latest version is 9.2 but for Windows via MinGW it is just 8.1...
I have tried to build from source for Windows 10 include WSL, but have not found how to do it exactly, I do not want use via CygWin or other emulater, just real on Windows as clang and MSVC.
Note: I have Windows 10 latest version with WSL.
The latest version of GCC (9.2.0) compiler combined with the latest MinGW-w64 (7.0.0) headers and libraries can be found in the standalone build at http://winlibs.com/
Oh the pain, getting a working GCC for Windows.
build your own?
Building is a fun experience, or a no-fun experience, depending on how you look at it.
I've spent literally weeks of time building GCC successfully and unsuccessfully (native and cross). Follow the instructions to the letter, and it works. And then, another day, it doesn't work (with the slightest different sub-sub-release or revision, or the tiniest little change that is entirely "harmless", or to the best of your knowledge no change at all, and you never get it to build again).
Save everything you've done (copy console), keep the build tree, and repeat the build (paste text) 6 months later after first doing a svn update. Compiles fine for 15-20 minutes, then fails. Start from scratch, and spend a day or two until it works, and you cannot tell why it works now.
Use a build script by someone who offers binary builds (so the assumption is that it must work, otherwise where do the binaries come from). The build script more or less does exactly what you've done by hand anyway, and it works, or maybe doesn't work. If you are only interested in actually having a compiler that works for compiling under Windows, and not in spending your life fiddling around, that's not a lot of fun.
use a pre-built binary?
There exists serval binary distros from a variety of sources.
Although downloading binaries is of course always a tidbid risky (even when scanning everything before you run it, malware scanners are nowhere near perfect, or even good or halfway reliable), compilers are particularly high-risk. That's because compilers are a very interesting target for malware distributors as they get free redistribution with everything you build.
I've actually seen GCC builds with malware built-in on apparently harmless sites (forgot the name, but one such example was a site offering GCC builds for several architectures, which looked very nice).
Now... there exists a distro which supports GCC 9.2 since some time built by someone under the pseudonym "nuwen".
It turns out, that "nuwen" is actually Stephan T. Lavavej, so... chances are that this is a distro that you actually want to use (I'm using it anyway). It's unlikely that you will be able build one yourself that's substantially better (also that one has a lot of useful support libs already coming with it), and it's unlikely that it is harmful.
https://nuwen.net/mingw.html
Note that MSYS2 will also allow you to install a very recent GCC (9.1 or 9.2, not sure) via pacman, very fast and very trouble-free. MSYS2 is nice insofar as you get a 95% working Unix-like working environment with 95% of the tools.
And 95% of the time, it works fine in every practical respect. Until then, one day, it doesn't, usually related to some configure script messing up pathnames, or something with environment variables. Or something else very subtle. For example, it is very much possible to successfully build GCC with MSYS2 (I've done it), and it works "perfectly fine" until some weeks later you discover that something doesn't work in your custom build, so some old project of yours now suddenly doesn't build any more when it did with the old stock compiler.
That's probably issues that one could fix, if determined (I'm however too lazy, for me a compiler is something that simply must work).
There are two well known distributions of the GCC bundle for Windows. The first one is by equation.com
http://www.equation.com/servlet/equation.cmd?fa=fortran
and the second one is by winlibs.com
http://winlibs.com/

Test app performance by making it lag

Is there a way or an application to test performance by making the app execute slower? I want to be sure that my app will perform well on older hardware.
Just adding stalls in SW won't necessarily imitate any older HW, it would just show you how the stalled code behaves on the new HW (and if the stalls aren't properly serializing - they may actually get avoided altogether).
If you just want to see how the code behaves without some specific ISA features you can disable them on compilation, or even compile to an older architecture. That won't make your CPU run any slower of course, but it won't be able to use for example AVX/SSE vectors (in x86 for e.g.), or other dedicated instructions.
If you want on old system+OS configuration you can use emulation - for e.g. DosBox
If you want an even higher level of realism, you can find a HW simulator that models that HW, and run on that (assuming you can cross-compile your code to run on it).
And of course, if you want an even more realistic experiment, and willing to go the extra mile, just get a specimen of that old HW, wipe the dust off, and build and run on it :)

Why making/building C apps takes very long time?

Why does making a C/C++ app take very long compared to other apps (Java for example).
I am trying to build Ubuntu Unity, and it takes about 4 minutes on my local machine.
I think the process of Generating object files is the one that take most time.
Any advice?
If you want to speed up code generation you can use ccache. Also you can take a look at gcc version as older versions are known to lag behind. Clang also supersede them a lot.
I'm not touching compilation speed bacause this is a HUGE topic. Starting from that C/C++ is a fully compilable languages, while in Java you never compile to the machine codes, you just generate a bytecode leaving everything else to the VM.

Building full gcc-3.3 on Wheezy

In Wheezy there is a source package for gcc-3.3 which only builds libstdc++5. Close examination shows that building of debian/control (from control.m4) can be modified so that the full package is built, which is my goal (legacy project, needs to be built with libstdc++5-dev:i386 and so on, but I want to build it on Wheezy64).
The question: how do I (find what to) tell dpkg-buildpackage to enable building the rest of the package? Should I just download the source package from archival Lenny?
Impossible at all?
Thanks in advance for any directions.
yes, well.
the preferred way would be to port your legacy project to build with a current g++ (4.8).
this would allow your project to run on any wheezy system (and hopefully on futgure systems like jessie/...)
if this is not an option, you should first try to download the source package from your target release (wheezy), modify debian/control to build all the packages you need, and build them.
chances are high, that gcc-3.3 and friends are disabled only to guarantee that nobody uses obsolete software anymore (so debian people don't have to worry about maintaining gcc-0.1 through 6.66).
as a last ressort you could try to get the source package from lenny and build that.
chances are high that this will be quite complilcated, and bug-ridden.
if youplan using your legacy project in two years from now, you might be better of stating to port it to recent ilbraries now.
I recently had to do something like this. What I did was install an old (32-bit) distro as a VM guest (which included gcc-3.4) just to make sure that it built and worked in "the past" before making changes for current build tools.
I did this mainly because you can be pretty sure that the build tools and environment worked back then, because everyone needed them. Not as many people are going to be using old tools now, so it's less clear that things will work. But it could work alright.
It's not exactly clear from your question whether you want a 64 bit or 32 bit version of this legacy software. If you want a 64 bit version, there might be fewer issues to port first to a modern 32 bit environment, then a modern 64 bit environment. At least you'll be able to identify where the bugs are.

How do I move from the MSVC compiler to GCC on Windows?

The reasons I want to move are:
Compile speed. About a minute with gcc, 15 minutes with MSVC. Admittedly, the code I'm compiling is a ball of spaghetti, but it is the code I have to work with on a daily basis. Sure, I don't expect gcc would magically take my compile times down to a minute, but I do expect it to compile files a lot faster.
Slow debugging: Its been close to a year now, using VS2010 trying to debug on Windows is a nightmare - it is so slow, it is unusable. Yes, I've tried deleting my .suo, closing the autos window, unplugging myself from the network and dancing around a fire three times under the full moon, to no avail.
So my question is: How do I get my code, which makes heavy use of the Windows APIs and MFCs to build on GCC? Rather, what would be the simplest route?

Resources