Advertisement
tthtlc

clang compilation of linux kernel

Nov 15th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.00 KB | None | 0 0
  1. make -f scripts/Makefile.build obj=scripts/basic
  2. clang-3.5 -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/basic/fixdep scripts/basic/fixdep.c
  3. rm -f .tmp_quiet_recordmcount
  4. mkdir -p include/linux include/config
  5. make -f scripts/Makefile.build obj=scripts/kconfig oldconfig
  6. clang-3.5 -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c
  7. clang-3.5 -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -Iscripts/kconfig -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c
  8. clang-3.5 -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/zconf.tab.o
  9. scripts/kconfig/conf --oldconfig Kconfig
  10. #
  11. # configuration written to .config
  12. #
  13.  
  14. =================
  15.  
  16.  
  17. make -f scripts/Makefile.build obj=arch/x86/tools relocs
  18. clang-3.5 -Wp,-MD,arch/x86/tools/.relocs_32.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I/sda1/home/tteikhua/Downloads/linux-3.15.7/tools/include -c -o arch/x86/tools/relocs_32.o arch/x86/tools/relocs_32.c
  19. clang-3.5 -Wp,-MD,arch/x86/tools/.relocs_64.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I/sda1/home/tteikhua/Downloads/linux-3.15.7/tools/include -c -o arch/x86/tools/relocs_64.o arch/x86/tools/relocs_64.c
  20. In file included from arch/x86/tools/relocs_64.c:17:
  21. arch/x86/tools/relocs.c:969:6: warning: variable 'do_reloc' is used
  22. uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
  23. if (!use_real_mode)
  24. ^~~~~~~~~~~~~~
  25. arch/x86/tools/relocs.c:981:14: note: uninitialized use occurs here
  26. walk_relocs(do_reloc);
  27. ^~~~~~~~
  28. arch/x86/tools/relocs.c:969:2: note: remove the 'if' if its condition is always
  29. true
  30. if (!use_real_mode)
  31. ^~~~~~~~~~~~~~~~~~~
  32. arch/x86/tools/relocs.c:966:24: note: initialize the variable 'do_reloc' to
  33. silence this warning
  34. const char *symname);
  35. ^
  36. = NULL
  37. 1 warning generated.
  38. clang-3.5 -Wp,-MD,arch/x86/tools/.relocs_common.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I/sda1/home/tteikhua/Downloads/linux-3.15.7/tools/include -c -o arch/x86/tools/relocs_common.o arch/x86/tools/relocs_common.c
  39. clang-3.5 -o arch/x86/tools/relocs arch/x86/tools/relocs_32.o arch/x86/tools/relocs_64.o arch/x86/tools/relocs_common.o
  40.  
  41.  
  42. ================================================
  43.  
  44. scripts/mod/file2alias.c:420:2: warning: format string is empty
  45. [-Wformat-zero-length]
  46. ADD(alias, "v", vendor != PCI_ANY_ID, vendor);
  47. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  49. sizeof(field) == 4 ? "%08X" : "", \
  50. ^~
  51. scripts/mod/file2alias.c:421:2: warning: format string is empty
  52. [-Wformat-zero-length]
  53. ADD(alias, "d", device != PCI_ANY_ID, device);
  54. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  56. sizeof(field) == 4 ? "%08X" : "", \
  57. ^~
  58. scripts/mod/file2alias.c:422:2: warning: format string is empty
  59. [-Wformat-zero-length]
  60. ADD(alias, "sv", subvendor != PCI_ANY_ID, subvendor);
  61. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  63. sizeof(field) == 4 ? "%08X" : "", \
  64. ^~
  65. scripts/mod/file2alias.c:423:2: warning: format string is empty
  66. [-Wformat-zero-length]
  67. ADD(alias, "sd", subdevice != PCI_ANY_ID, subdevice);
  68. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  70. sizeof(field) == 4 ? "%08X" : "", \
  71. ^~
  72. scripts/mod/file2alias.c:440:2: warning: format string is empty
  73. [-Wformat-zero-length]
  74. ADD(alias, "bc", baseclass_mask == 0xFF, baseclass);
  75. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  77. sizeof(field) == 4 ? "%08X" : "", \
  78. ^~
  79. scripts/mod/file2alias.c:441:2: warning: format string is empty
  80. [-Wformat-zero-length]
  81. ADD(alias, "sc", subclass_mask == 0xFF, subclass);
  82. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  84. sizeof(field) == 4 ? "%08X" : "", \
  85. ^~
  86. scripts/mod/file2alias.c:442:2: warning: format string is empty
  87. [-Wformat-zero-length]
  88. ADD(alias, "i", interface_mask == 0xFF, interface);
  89. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  91. sizeof(field) == 4 ? "%08X" : "", \
  92. ^~
  93. scripts/mod/file2alias.c:459:2: warning: format string is empty
  94. [-Wformat-zero-length]
  95. ADD(alias, "t", match_flags&CCW_DEVICE_ID_MATCH_CU_TYPE,
  96. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. scripts/mod/file2alias.c:119:55: note: expanded from macro 'ADD'
  98. sizeof(field) == 4 ? "%08X" : "", \
  99. ^~
  100. scripts/mod/file2alias.c:461:2: warning: format string is empty
  101.  
  102. ==============================
  103.  
  104. clang-3.5 -Wp,-MD,scripts/.sortextable.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I/sda1/home/tteikhua/Downloads/linux-3.15.7/tools/include -I/sda1/home/tteikhua/Downloads/linux-3.15.7/tools/include -o scripts/sortextable scripts/sortextable.c
  105. make -f scripts/Makefile.build obj=init
  106. d gcc -Wp,-MD,init/.main.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/sda1/home/tteikhua/Downloads/linux-3.15.7/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/sda1/home/tteikhua/Downloads/linux-3.15.7/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/sda1/home/tteikhua/Downloads/linux-3.15.7/include/uapi -Iinclude/generated/uapi -include /sda1/home/tteikhua/Downloads/linux-3.15.7/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m32 -msoft-float -mregparm=3 -freg-struct-return -mno-mmx -mno-sse -fno-pic -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -maccumulate-outgoing-args -Wa,-mtune=generic32 -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(main)" -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o init/.tmp_main.o init/main.c
  107. if [ "-pg" = "-pg" ]; then if [ init/main.o != "scripts/mod/empty.o" ]; then /sda1/home/tteikhua/Downloads/linux-3.15.7/scripts/recordmcount "init/main.o"; fi; fi;
  108. /bin/bash /sda1/home/tteikhua/Downloads/linux-3.15.7/scripts/mkcompile_h include/generated/compile.h \
  109. "i386" "y" "" "gcc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m32 -msoft-float -mregparm=3 -freg-struct-return -mno-mmx -mno-sse -fno-pic -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -maccumulate-outgoing-args -Wa,-mtune=generic32 -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO "
  110.  
  111. ==============================================================
  112.  
  113. As seen above, lots of gcc started being used, replacing it with clang-3.5:
  114.  
  115. + clang-3.5 -Wp,-MD,arch/x86/kernel/.bootflag.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/sda1/home/tteikhua/Downloads/linux-3.15.7/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/sda1/home/tteikhua/Downloads/linux-3.15.7/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/sda1/home/tteikhua/Downloads/linux-3.15.7/include/uapi -Iinclude/generated/uapi -include /sda1/home/tteikhua/Downloads/linux-3.15.7/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m32 -msoft-float -mregparm=3 -freg-struct-return -mno-mmx -mno-sse -fno-pic -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -maccumulate-outgoing-args -Wa,-mtune=generic32 -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bootflag) -DKBUILD_MODNAME=KBUILD_STR(bootflag) -c -o arch/x86/kernel/.tmp_bootflag.o arch/x86/kernel/bootflag.c
  116. clang: error: unknown argument: '-mpreferred-stack-boundary=2'
  117. clang: error: unknown argument: '-maccumulate-outgoing-args'
  118. clang: error: unknown argument: '-fconserve-stack'
  119. clang: error: unsupported argument '-mtune=generic32' to option 'Wa,'
  120. clang: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement