Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] compilation order of project files

Dear list members,
 
First let me express how much I appreciate your hard work on the CDT. I am using it every day at my work, together with my colleagues, and we just love it. Thanks for the great tool!
 
 
Secondly I would ask for some assistance about how can I 'force' our custom toolchain, which is more or less a copy of the MinGW toolchain (cdt.managedbuild.toolchain.gnu.mingw.base), to compile source files in alphabetical order.
Currently, whenever I initiate a full build, the order of the source file compilation is random, seems to me not following any logic.
 
I think this is not only related to our custom toolchain. I have done some test with the built-in MinGW toolchain, and I see there this randomness also. For example, the outputs of 2 build all reads as:
09:07:29 **** Rebuild of configuration Debug for project Test ****
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\main.o" "..\\src\\main.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Test.o" "..\\src\\Test.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\b.o" "..\\src\\b.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\a.o" "..\\src\\a.c"
gcc -o Test.exe "src\\main.o" "src\\b.o" "src\\a.o" "src\\Test.o"
 
09:07:55 **** Rebuild of configuration Debug for project Test ****
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\main.o" "..\\src\\main.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\b.o" "..\\src\\b.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Test.o" "..\\src\\Test.c"
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\a.o" "..\\src\\a.c"
gcc -o Test.exe "src\\main.o" "src\\b.o" "src\\a.o" "src\\Test.o"
As visible from the outputs, the order is random. Nothing (no file content) was changed between the 2 builds. I just did a 'clean' after the first build.
 
 
Our toolchain contains a compiler and a linker. Couple of month ago it was desirable that the linker gets its input resources in alphabetical order, so I have played around with the commandLineGenerator attribute of the linker tool. I have sucessfully modified the generateCommandLineInfo() function, which has the inputResources parameter, so now the linker has a alphabetically sorted input list.
Basically I need the same thing for the compiler, but this is a bit more complicated, as the compiler is being called for every input resource one by one. So the order should be applied sooner, somewhere in the builder, I guess.
 
Is there a way the make the order alphabetical?
Which class is responsible for creating this order? Is that within the toolchain? Or is the Internal Builder decides the order of resources?
Is this a bug, or it was never meant to be building/compiling source files in 'order'?
 
 
Thanks in advance for any tips on this manner.
 
Kind regards,
Tamas Csabina

--
SERCOM Regeltechniek B.V.
Heereweg 9
2161 AB Lisse
Nederland
+31 (0)252 416530 (voice)
+31 (0)252 419481 (fax)

http://www.sercom.nl/

Op al onze offertes, op alle opdrachten aan ons en op alle met ons gesloten overeenkomsten zijn toepasselijk de METAALUNIEVOORWAARDEN, gedeponeerd ter Griffie van de Rechtbank te Rotterdam, zoals deze luiden volgens de laatstelijk aldaar neergelegde tekst. De leveringsvoorwaarden worden u op verzoek toegezonden.

De informatie/inhoud van dit e-mail bericht (en bijlagen) is uitsluitend bestemd voor de geadresseerden. SERCOM staat niet in voor juiste dan wel volledige overbrenging van de inhoud van dit e-mail bericht. SERCOM kan niet garanderen dat een verzonden e-mail bericht wordt overgebracht zonder inbreuk of tussenkomst van derden, noch de tijdige ontvangst ervan. Indien bovenstaand e-mail bericht niet aan u is gericht, verzoeken wij u vriendelijk doch dringend het e-mail bericht te retourneren aan de verzender en het origineel en eventuele kopieën te verwijderen en te vernietigen.


The information in this e-mail is intended only for use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Access to this e-mail by anyone else than the addressee is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken omitted to be taken in reliance of it, is prohibited and may be unlawful. If you are not the intended recipient please contact the sender by return e-mail and destroy all copies of the original message.
---

Back to the top