比较从两个构建系统生成的目标文件 - Gradle和GNUMake

时间:2016-11-10 09:53:42

标签: c gradle gnu-make

我正在尝试比较两个构建系统 - GNUMake和Gradle,并试图找出最适合我的软件开发。对于相同的Git提交,如果我尝试使用相同版本的GCC编译器和链接器在两个构建系统上编译我的C源代码,生成的目标文件是否看起来相似?

我生成了两组对象,并运行了这样的命令:

diff GNUMake_file.o Gradle_file.o

我的输出为:

  

二进制文件GNUMake_file.o和Gradle_file.o不同

我也为这两套做了cmp -l,我得到了与此类似的大量行:

  

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

我认为这显然意味着两个目标文件在许多地方都不同。我的比较是否正确?有没有办法找出它们是否不同,为什么会这样?我尽了最大的努力使编译器标志和命令在两个系统上看起来都很相似。那些之前已经做过这一点的人的评论或对这一切都有一个公平的想法将是受欢迎的。

还附加了目录中的任意C源文件的编译器命令:

使用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 = 内联 -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

使用Gradle

  

命令:/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

0 个答案:

没有答案