Skip to content

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

Closed
llvmbot opened this issue Apr 25, 2009 · 9 comments
Closed

RFE: Support "-Wp,-MD" option (req. for Linux kernel build) #4434

llvmbot opened this issue Apr 25, 2009 · 9 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2009

Bugzilla Link 4062
Resolution FIXED
Resolved on Jun 14, 2010 16:37
Version unspecified
OS Linux
Blocks llvm/llvm-bugzilla-archive#4068 llvm/llvm-bugzilla-archive#5511
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

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

@llvmbot
Copy link
Member Author

llvmbot commented Apr 26, 2009

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.

@efriedma-quic
Copy link
Collaborator

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?

@llvmbot
Copy link
Member Author

llvmbot commented Apr 26, 2009

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.

@efriedma-quic
Copy link
Collaborator

The build system for elinks (a text-mode web-browser) also uses this option.

@llvmbot
Copy link
Member Author

llvmbot commented Feb 19, 2010

Likewise do btrfs-progs, syslinux and certainly others.

@llvmbot
Copy link
Member Author

llvmbot commented May 22, 2010

The build system for Firefox also depends on this option.

@llvmbot
Copy link
Member Author

llvmbot commented Jun 14, 2010

Fixed here:
http://llvm.org/viewvc/llvm-project?view=rev&revision=105966

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.

@edwintorok
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#4068

@efriedma-quic
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#5511

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

3 participants