Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1602930 > unrolled thread
| Started by | Michael Davidson <md@google.com> |
|---|---|
| First post | 2017-03-17 01:30 +0100 |
| Last post | 2017-03-17 22:50 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags Michael Davidson <md@google.com> - 2017-03-17 01:30 +0100
Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags "H. Peter Anvin" <hpa@zytor.com> - 2017-03-17 22:40 +0100
Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags "H. Peter Anvin" <hpa@zytor.com> - 2017-03-17 22:50 +0100
| From | Michael Davidson <md@google.com> |
|---|---|
| Date | 2017-03-17 01:30 +0100 |
| Subject | [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags |
| Message-ID | <tlNWh-6eK-11@gated-at.bofh.it> |
Unfortunately, while clang generates a warning about these flags
being unsupported it still exits with a status of 0 so we have
to explicitly disable them instead of just using a cc-option check.
Signed-off-by: Michael Davidson <md@google.com>
---
Makefile | 2 ++
arch/x86/Makefile | 2 ++
2 files changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index b21fd0ca2946..5e97e5fc1eea 100644
--- a/Makefile
+++ b/Makefile
@@ -629,7 +629,9 @@ ARCH_AFLAGS :=
ARCH_CFLAGS :=
include arch/$(SRCARCH)/Makefile
+ifneq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
+endif
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 2d449337a360..894a8d18bf97 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -87,11 +87,13 @@ else
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
+ifneq ($(cc-name),clang)
# Align jump targets to 1 byte, not the default 16 bytes:
KBUILD_CFLAGS += -falign-jumps=1
# Pack loops tightly as well:
KBUILD_CFLAGS += -falign-loops=1
+endif
# Don't autogenerate traditional x87 instructions
KBUILD_CFLAGS += $(call cc-option,-mno-80387)
--
2.12.0.367.g23dc2f6d3c-goog
[toc] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Date | 2017-03-17 22:40 +0100 |
| Subject | Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags |
| Message-ID | <tm7Lj-4jK-1@gated-at.bofh.it> |
| In reply to | #1602930 |
On 03/17/17 14:32, H. Peter Anvin wrote:
>
> NAK. Fix your compiler, or use a wrapper script or something. It is
> absolutely *not* acceptable to disable this since future versions of
> clang *should* support that.
>
> That being said, it might make sense to look for a key pattern like
> "(un|not )supported" on stderr the try-run macro. Is there really no
> -Wno- or -Werror= option to turn off this craziness?
>
Well, guess what... I found it myself.
-W{no-,error=}ignored-optimization-argument
Either variant will make this sane.
-hpa
[toc] | [prev] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Date | 2017-03-17 22:50 +0100 |
| Subject | Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags |
| Message-ID | <tm7Lj-4jK-3@gated-at.bofh.it> |
| In reply to | #1602930 |
On 03/16/17 17:15, Michael Davidson wrote: > Unfortunately, while clang generates a warning about these flags > being unsupported it still exits with a status of 0 so we have > to explicitly disable them instead of just using a cc-option check. > > Signed-off-by: Michael Davidson <md@google.com> > --- > Makefile | 2 ++ > arch/x86/Makefile | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/Makefile b/Makefile > index b21fd0ca2946..5e97e5fc1eea 100644 > --- a/Makefile > +++ b/Makefile > @@ -629,7 +629,9 @@ ARCH_AFLAGS := > ARCH_CFLAGS := > include arch/$(SRCARCH)/Makefile > > +ifneq ($(cc-name),clang) > KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) > +endif > KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) > > ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index 2d449337a360..894a8d18bf97 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -87,11 +87,13 @@ else > KBUILD_AFLAGS += -m64 > KBUILD_CFLAGS += -m64 > > +ifneq ($(cc-name),clang) > # Align jump targets to 1 byte, not the default 16 bytes: > KBUILD_CFLAGS += -falign-jumps=1 > > # Pack loops tightly as well: > KBUILD_CFLAGS += -falign-loops=1 > +endif > > # Don't autogenerate traditional x87 instructions > KBUILD_CFLAGS += $(call cc-option,-mno-80387) > NAK. Fix your compiler, or use a wrapper script or something. It is absolutely *not* acceptable to disable this since future versions of clang *should* support that. That being said, it might make sense to look for a key pattern like "(un|not )supported" on stderr the try-run macro. Is there really no -Wno- or -Werror= option to turn off this craziness? -hpa
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web