Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
On 09/14/15 22:07, Sedat Dilek wrote: On Tue, Sep 15, 2015 at 5:40 AM, Behan Webster wrote: I haven't upstreamed this patch yet because we are still characterizing its effects on other architectures. Then embed this information into the changelog of *your* patch. It's in our tree/build system, as a work in progress. Which is why I haven't upstreamed it yet. So what is *your* solution in case of CONFIG_CC_OPTIMIZE_FOR_SIZE=y (OptLevel '-Os' is wrong, '-Oz' is correct)? I don't have one yet, which is precisely why I haven't upstreamed it yet. Sedat, why don't you try working with us instead of making demands and accusing people? Behan -- Behan Webster beh...@converseincode.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
On Tue, Sep 15, 2015 at 5:40 AM, Behan Webster wrote: > Other than you changing the commit comment, this *is* my patch. > You were mentioned in the commit-message as original author. > I haven't upstreamed this patch yet because we are still characterizing its > effects on other architectures. > Then embed this information into the changelog of *your* patch. > Clang certainly doesn't require -Oz to be used to be able to boot for arm > nor arm64. So the commit message isn't correct either. > Read my changelog carefully - I reported success on AMD64. So what is *your* solution in case of CONFIG_CC_OPTIMIZE_FOR_SIZE=y (OptLevel '-Os' is wrong, '-Oz' is correct)? Hack around with BROKEN Kconfig keyword :-)... [ init/Kconfig ] ... config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size" help Enabling this option will pass "-Os" instead of "-O2" to your compiler resulting in a smaller kernel. If unsure, say N. ... Or at least document it in the official upstream Linux-kernel as clang supported landed there. Document BROKEN kernel-options with llvmlinux (clang). Do you have a doc-file in Documentation-dir? - Sedat - > > On 09/14/15 21:19, Sedat Dilek wrote: >> >> Based on a patch of Behan Webster (see [1]). >> >> CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. >> >> A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y >> and boots on bare metal. >> This is a Ubuntu/precise AMD64 system. >> >> Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. >> >> [1] >> http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch >> >> CC: Behan Webster >> --- >> Makefile | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/Makefile b/Makefile >> index 4249441e535d..a57fb6b39ed7 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call >> cc-option,-fno-delete-null-pointer-checks,) >> endif >> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE >> -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) >> +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) >> +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) >> else >> KBUILD_CFLAGS += -O2 >> endif > > > > -- > Behan Webster > beh...@converseincode.com > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
Other than you changing the commit comment, this *is* my patch. I haven't upstreamed this patch yet because we are still characterizing its effects on other architectures. Clang certainly doesn't require -Oz to be used to be able to boot for arm nor arm64. So the commit message isn't correct either. NAK Behan On 09/14/15 21:19, Sedat Dilek wrote: Based on a patch of Behan Webster (see [1]). CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and boots on bare metal. This is a Ubuntu/precise AMD64 system. Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. [1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch CC: Behan Webster --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4249441e535d..a57fb6b39ed7 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif -- Behan Webster beh...@converseincode.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
Based on a patch of Behan Webster (see [1]). CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and boots on bare metal. This is a Ubuntu/precise AMD64 system. Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. [1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch CC: Behan Webster --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4249441e535d..a57fb6b39ed7 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif -- 2.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
On 09/14/15 22:07, Sedat Dilek wrote: On Tue, Sep 15, 2015 at 5:40 AM, Behan Websterwrote: I haven't upstreamed this patch yet because we are still characterizing its effects on other architectures. Then embed this information into the changelog of *your* patch. It's in our tree/build system, as a work in progress. Which is why I haven't upstreamed it yet. So what is *your* solution in case of CONFIG_CC_OPTIMIZE_FOR_SIZE=y (OptLevel '-Os' is wrong, '-Oz' is correct)? I don't have one yet, which is precisely why I haven't upstreamed it yet. Sedat, why don't you try working with us instead of making demands and accusing people? Behan -- Behan Webster beh...@converseincode.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
Based on a patch of Behan Webster (see [1]). CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and boots on bare metal. This is a Ubuntu/precise AMD64 system. Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. [1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch CC: Behan Webster--- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4249441e535d..a57fb6b39ed7 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif -- 2.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
Other than you changing the commit comment, this *is* my patch. I haven't upstreamed this patch yet because we are still characterizing its effects on other architectures. Clang certainly doesn't require -Oz to be used to be able to boot for arm nor arm64. So the commit message isn't correct either. NAK Behan On 09/14/15 21:19, Sedat Dilek wrote: Based on a patch of Behan Webster (see [1]). CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and boots on bare metal. This is a Ubuntu/precise AMD64 system. Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. [1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch CC: Behan Webster--- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4249441e535d..a57fb6b39ed7 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif -- Behan Webster beh...@converseincode.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
On Tue, Sep 15, 2015 at 5:40 AM, Behan Websterwrote: > Other than you changing the commit comment, this *is* my patch. > You were mentioned in the commit-message as original author. > I haven't upstreamed this patch yet because we are still characterizing its > effects on other architectures. > Then embed this information into the changelog of *your* patch. > Clang certainly doesn't require -Oz to be used to be able to boot for arm > nor arm64. So the commit message isn't correct either. > Read my changelog carefully - I reported success on AMD64. So what is *your* solution in case of CONFIG_CC_OPTIMIZE_FOR_SIZE=y (OptLevel '-Os' is wrong, '-Oz' is correct)? Hack around with BROKEN Kconfig keyword :-)... [ init/Kconfig ] ... config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size" help Enabling this option will pass "-Os" instead of "-O2" to your compiler resulting in a smaller kernel. If unsure, say N. ... Or at least document it in the official upstream Linux-kernel as clang supported landed there. Document BROKEN kernel-options with llvmlinux (clang). Do you have a doc-file in Documentation-dir? - Sedat - > > On 09/14/15 21:19, Sedat Dilek wrote: >> >> Based on a patch of Behan Webster (see [1]). >> >> CLANG (here: v3.7) requires '-Oz' as OptLevel to be set. >> >> A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y >> and boots on bare metal. >> This is a Ubuntu/precise AMD64 system. >> >> Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset. >> >> [1] >> http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch >> >> CC: Behan Webster >> --- >> Makefile | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/Makefile b/Makefile >> index 4249441e535d..a57fb6b39ed7 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -622,7 +622,8 @@ KBUILD_CFLAGS += $(call >> cc-option,-fno-delete-null-pointer-checks,) >> endif >> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE >> -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) >> +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) >> +KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) >> else >> KBUILD_CFLAGS += -O2 >> endif > > > > -- > Behan Webster > beh...@converseincode.com > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/