-
Notifications
You must be signed in to change notification settings - Fork 13.5k
RFE: Support "-Wp,-MD" option (req. for Linux kernel build) #4434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using -Wp is a hack for doing this. Is there any reason the kernel can't use -MD directly? I don't want the driver to need to get in the business of ripping apart the -Wp, argument and reinterpreting it, unless there is a very compelling reason. |
If the driver doesn't process it, what will? Eventually, we're going to eliminate clang-cc, no? |
That is an excellent point Eli. At that point we will need to reparse Wp anyway, so I guess we might as well go ahead and do it. |
The build system for elinks (a text-mode web-browser) also uses this option. |
Likewise do btrfs-progs, syslinux and certainly others. |
The build system for Firefox also depends on this option. |
Fixed here: Note that this fix is exactly for the case of -Wp,-MD,FOO. I can generalize it, but am only going to do so on an as needed basis. |
mentioned in issue llvm/llvm-bugzilla-archive#4068 |
mentioned in issue llvm/llvm-bugzilla-archive#5511 |
Extended Description
The Linux kernel uses "-Wp,-MD..." for dependencies. Example command line, when attempting to use clang to build kernel:
clang -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem include -Iinclude -I/spare/repo/linux-2.6/arch/x86/include -include include/linux/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -m64 -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -fno-dwarf2-cfi-asm -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bounds)" -D"KBUILD_MODNAME=KBUILD_STR(bounds)" -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c
clang: warning: the clang compiler does not yet support '-pg'
clang: warning: argument unused during compilation: '-march=core2'
clang: warning: argument unused during compilation: '-mcmodel=kernel'
clang: warning: argument unused during compilation: '-funit-at-a-time'
clang: warning: argument unused during compilation: '-maccumulate-outgoing-args'
clang: warning: argument unused during compilation: '-fno-asynchronous-unwind-tables'
clang: warning: argument unused during compilation: '-fno-omit-frame-pointer'
clang: warning: argument unused during compilation: '-fno-optimize-sibling-calls'
clang: warning: argument unused during compilation: '-fwrapv'
clang: warning: argument unused during compilation: '-fno-dwarf2-cfi-asm'
clang-cc: Unknown command line argument '-MD'. Try: '/usr/local/bin/../libexec/clang-cc --help'
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
The text was updated successfully, but these errors were encountered: