I am trying to compare two build systems - GNUMake and Gradle and trying to find out which best fits my software development. For the same Git commit, if I try to compile my C sources on the two build systems using the same version of GCC compiler and linker, will the generated object files look alike?
I generated the two sets of objects and I ran a command like this:
diff GNUMake_file.o Gradle_file.o
And i got the output as:
Binary files GNUMake_file.o and Gradle_file.o differ
I also did a cmp -l
for the two sets and I get huge number of lines similar to this:
13699 11 21
13700 4 363
13704 346 302
13707 15 12
13711 0 22
13712 0 13
13715 0 7
13716 6 317
13719 6 14
I think this means obviously the two object files are different at many places. Is my comparison correct? Is there a way in finding out if they are different and if so why? I have tried to the best of my abilities to make the compiler flags and command look alike on both the systems. Comments from those who have done this before or have a fair idea on what this is all about will be welcome.
Also attached are the compiler commands for an arbitary C source file from the directory:
With GNUMake
sparc-rtems-gcc -MD -MF 'dep/my_source.dep' -MP -MT 'obj/my_source.o dep/my_source.dep' -W -Wall -Waggregate-return -Wcast-align -Wchar-subscripts -Wbad-function-cast -Wcomment -Wformat -Wimplicit -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wparentheses -Wpointer-arith -Wshadow -Wswitch -Wuninitialized -Wunused -Wwrite-strings -Wno-conversion -Wreturn-type -I/all/include/file/locations -I/all/include/file/locations -I/all/include/file/locations -I/all/include/file/locations -I/all/include/file/locations -DCPU=SCOC3 -DCPU_SCOC3 -DINLINE=inline -fno-common -fno-strict-aliasing -fno-builtin-sqrt -fno-builtin-sqrtf -fno-builtin-acos -fno-builtin-acosf -fno-builtin-asin -fno-builtin-asinf -fno-builtin-atan -fno-builtin-atanf -fno-builtin-atan2 -fno-builtin-atan2f -fno-builtin-cos -fno-builtin-cosf -fno-builtin-sin -fno-builtin-sinf -fno-builtin-tan -fno-builtin-tanf -fno-builtin-scalbn -fno-builtin-scalbnf -fno-builtin-floor -fno-builtin-floorf -fno-builtin-fabs -fno-builtin-fabsf -fno-builtin-copysign -fno-builtin-copysignf -fno-builtin-exp -fno-builtin-expf -fno-builtin-log -fno-builtin-logf -fno-builtin-exp2 -fno-builtin-exp2f -fno-builtin-log2 -fno-builtin-log2f -fno-builtin-exp10 -fno-builtin-exp10f -fno-builtin-log10 -fno-builtin-log10f -fno-builtin-pow -fno-builtin-powf -fno-builtin-pow10 -fno-builtin-pow10f -D__OBJECTS_inl -DRTEMS_QUALIF -mv8 -mgrfpu -mgrcache -O2 -gdwarf-2 -c my_source.c -o obj/my_source.o
With Gradle
Command: /opt/rtems/4.6_20130612/bin/sparc-rtems-gcc -x c -c -W -Wall -Waggregate-return -Wcast-align -Wchar-subscripts -Wbad-function-cast -Wcomment -Wformat -Wimplicit -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wparentheses -Wpointer-arith -Wshadow -Wswitch -Wuninitialized -Wunused -Wwrite-strings -Wno-conversion -Wreturn-type -DCPU=SCOC3 -DCPU_SCOC3 -DINLINE=inline -fno-common -fno-strict-aliasing -fno-builtin-sqrt -fno-builtin-sqrtf -fno-builtin-acos -fno-builtin-acosf -fno-builtin-asin -fno-builtin-asinf -fno-builtin-atan -fno-builtin-atanf -fno-builtin-atan2 -fno-builtin-atan2f -fno-builtin-cos -fno-builtin-cosf -fno-builtin-sin -fno-builtin-sinf -fno-builtin-tan -fno-builtin-tanf -fno-builtin-scalbn -fno-builtin-scalbnf -fno-builtin-floor -fno-builtin-floorf -fno-builtin-fabs -fno-builtin-fabsf -fno-builtin-copysign -fno-builtin-copysignf -fno-builtin-exp -fno-builtin-expf -fno-builtin-log -fno-builtin-logf -fno-builtin-exp2 -fno-builtin-exp2f -fno-builtin-log2 -fno-builtin-log2f -fno-builtin-exp10 -fno-builtin-exp10f -fno-builtin-log10 -fno-builtin-pow -fno-builtin-powf -fno-builtin-pow10 -fno-builtin-pow10f -D__OBJECTS_inl -DRTEMS_QUALIF -mv8 -mgrfpu -mgrcache -O2 -gdwarf-2 -I all/include/file/locations -I all/include/file/locations all/include/file/locations my_source.c -o my_source.o