* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems [not found] ` <20230906215327.18a45c89@gandalf.local.home> @ 2023-09-07 9:48 ` Dan Carpenter 2023-09-07 11:04 ` Segher Boessenkool 0 siblings, 1 reply; 8+ messages in thread From: Dan Carpenter @ 2023-09-07 9:48 UTC (permalink / raw) To: Steven Rostedt Cc: Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Wed, Sep 06, 2023 at 09:53:27PM -0400, Steven Rostedt wrote: > On Thu, 7 Sep 2023 08:54:38 +1000 > Dave Chinner <david@fromorbit.com> wrote: > > > And let's not forget: removing a filesystem from the kernel is not > > removing end user support for extracting data from old filesystems. > > We have VMs for that - we can run pretty much any kernel ever built > > inside a VM, so users that need to extract data from a really old > > filesystem we no longer support in a modern kernel can simply boot > > up an old distro that did support it and extract the data that way. > > Of course there's the case of trying to recreate a OS that can run on a > very old kernel. Just building an old kernel is difficult today because > today's compilers will refuse to build them (I've hit issues in bisections > because of that!) Yeah. I can't run Smatch on obsolete kernels because I can't build the tools/ directory etc. For example, it would be interesting to look at really ancient kernels to see how buggy they are. I started to hunt down all the Makefile which add a -Werror but there are a lot and eventually I got bored and gave up. Someone should patch GCC so there it checks an environment variable to ignore -Werror. Somethine like this? diff --git a/gcc/opts.cc b/gcc/opts.cc index ac81d4e42944..2de69300d4fe 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -2598,6 +2598,17 @@ print_help (struct gcc_options *opts, unsigned int lang_mask, lang_mask); } +static bool +ignore_w_error(void) +{ + char *str; + + str = getenv("IGNORE_WERROR"); + if (str && strcmp(str, "1") == 0) + return true; + return false; +} + /* Handle target- and language-independent options. Return zero to generate an "unknown option" message. Only options that need extra handling need to be listed here; if you simply want @@ -2773,11 +2784,15 @@ common_handle_option (struct gcc_options *opts, break; case OPT_Werror: + if (ignore_w_error()) + break; dc->warning_as_error_requested = value; break; case OPT_Werror_: - if (lang_mask == CL_DRIVER) + if (ignore_w_error()) + break; + if (lang_mask == CL_DRIVER) break; enable_warning_as_error (arg, value, lang_mask, handlers, ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 9:48 ` [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems Dan Carpenter @ 2023-09-07 11:04 ` Segher Boessenkool 2023-09-07 11:22 ` Steven Rostedt 2023-09-07 11:23 ` Dan Carpenter 0 siblings, 2 replies; 8+ messages in thread From: Segher Boessenkool @ 2023-09-07 11:04 UTC (permalink / raw) To: Dan Carpenter Cc: Steven Rostedt, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > I started to hunt > down all the Makefile which add a -Werror but there are a lot and > eventually I got bored and gave up. I have a patch stack for that, since 2014 or so. I build Linux with unreleased GCC versions all the time, so pretty much any new warning is fatal if you unwisely use -Werror. > Someone should patch GCC so there it checks an environment variable to > ignore -Werror. Somethine like this? No. You should patch your program, instead. One easy way is to add a -Wno-error at the end of your command lines. Or even just -w if you want or need a bigger hammer. Or nicer, put it all in Kconfig, like powerpc already has for example. There is a CONFIG_WERROR as well, so maybe use that in all places? > +static bool > +ignore_w_error(void) > +{ > + char *str; > + > + str = getenv("IGNORE_WERROR"); > + if (str && strcmp(str, "1") == 0) space before ( > case OPT_Werror: > + if (ignore_w_error()) > + break; > dc->warning_as_error_requested = value; > break; > > case OPT_Werror_: > - if (lang_mask == CL_DRIVER) > + if (ignore_w_error()) > + break; > + if (lang_mask == CL_DRIVER) > break; The new indentation is messed up. And please don't move the existing early-out to later, it make more sense earlier, the way it was. Segher ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 11:04 ` Segher Boessenkool @ 2023-09-07 11:22 ` Steven Rostedt 2023-09-07 12:24 ` Segher Boessenkool 2023-09-07 11:23 ` Dan Carpenter 1 sibling, 1 reply; 8+ messages in thread From: Steven Rostedt @ 2023-09-07 11:22 UTC (permalink / raw) To: Segher Boessenkool Cc: Dan Carpenter, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, 7 Sep 2023 06:04:09 -0500 Segher Boessenkool <segher@kernel.crashing.org> wrote: > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > I started to hunt > > down all the Makefile which add a -Werror but there are a lot and > > eventually I got bored and gave up. > > I have a patch stack for that, since 2014 or so. I build Linux with > unreleased GCC versions all the time, so pretty much any new warning is > fatal if you unwisely use -Werror. > > > Someone should patch GCC so there it checks an environment variable to > > ignore -Werror. Somethine like this? > > No. You should patch your program, instead. One easy way is to add a > -Wno-error at the end of your command lines. Or even just -w if you > want or need a bigger hammer. That's not really possible when bisecting a kernel bug into older kernels. The build system is highly complex and requires hundreds of changes to do what you suggested. As it is for a bisection that takes a minimum of 13 iterations, your approach just isn't feasible. -- Steve ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 11:22 ` Steven Rostedt @ 2023-09-07 12:24 ` Segher Boessenkool 0 siblings, 0 replies; 8+ messages in thread From: Segher Boessenkool @ 2023-09-07 12:24 UTC (permalink / raw) To: Steven Rostedt Cc: Dan Carpenter, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, Sep 07, 2023 at 07:22:45AM -0400, Steven Rostedt wrote: > On Thu, 7 Sep 2023 06:04:09 -0500 > Segher Boessenkool <segher@kernel.crashing.org> wrote: > > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > No. You should patch your program, instead. One easy way is to add a > > -Wno-error at the end of your command lines. Or even just -w if you > > want or need a bigger hammer. > > That's not really possible when bisecting a kernel bug into older kernels. > The build system is highly complex and requires hundreds of changes to do > what you suggested. As it is for a bisection that takes a minimum of 13 > iterations, your approach just isn't feasible. Isn't this exactly what KCFLAGS is for? But, I meant to edit the build system. It isn't so hard to bisect with patch stacks on top. Just a bit annoying. Segher ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 11:04 ` Segher Boessenkool 2023-09-07 11:22 ` Steven Rostedt @ 2023-09-07 11:23 ` Dan Carpenter 2023-09-07 12:30 ` Segher Boessenkool 1 sibling, 1 reply; 8+ messages in thread From: Dan Carpenter @ 2023-09-07 11:23 UTC (permalink / raw) To: Segher Boessenkool Cc: Steven Rostedt, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, Sep 07, 2023 at 06:04:09AM -0500, Segher Boessenkool wrote: > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > I started to hunt > > down all the Makefile which add a -Werror but there are a lot and > > eventually I got bored and gave up. > > I have a patch stack for that, since 2014 or so. I build Linux with > unreleased GCC versions all the time, so pretty much any new warning is > fatal if you unwisely use -Werror. > > > Someone should patch GCC so there it checks an environment variable to > > ignore -Werror. Somethine like this? > > No. You should patch your program, instead. There are 2930 Makefiles in the kernel source. > One easy way is to add a > -Wno-error at the end of your command lines. Or even just -w if you > want or need a bigger hammer. I tried that. Some of the Makefiles check an environemnt variable as well if you want to turn off -Werror. It's not a complete solution at all. I have no idea what a complete solution looks like because I gave up. > > Or nicer, put it all in Kconfig, like powerpc already has for example. > There is a CONFIG_WERROR as well, so maybe use that in all places? That's a good idea but I'm trying to compile old kernels and not the current kernel. regards, dan carpenter ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 11:23 ` Dan Carpenter @ 2023-09-07 12:30 ` Segher Boessenkool 2023-09-12 9:50 ` Richard Biener 0 siblings, 1 reply; 8+ messages in thread From: Segher Boessenkool @ 2023-09-07 12:30 UTC (permalink / raw) To: Dan Carpenter Cc: Steven Rostedt, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, Sep 07, 2023 at 02:23:00PM +0300, Dan Carpenter wrote: > On Thu, Sep 07, 2023 at 06:04:09AM -0500, Segher Boessenkool wrote: > > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > > I started to hunt > > > down all the Makefile which add a -Werror but there are a lot and > > > eventually I got bored and gave up. > > > > I have a patch stack for that, since 2014 or so. I build Linux with > > unreleased GCC versions all the time, so pretty much any new warning is > > fatal if you unwisely use -Werror. > > > > > Someone should patch GCC so there it checks an environment variable to > > > ignore -Werror. Somethine like this? > > > > No. You should patch your program, instead. > > There are 2930 Makefiles in the kernel source. Yes. And you need patches to about thirty. Or a bit more, if you want to do it more cleanly. This isn't a guess. > > One easy way is to add a > > -Wno-error at the end of your command lines. Or even just -w if you > > want or need a bigger hammer. > > I tried that. Some of the Makefiles check an environemnt variable as > well if you want to turn off -Werror. It's not a complete solution at > all. I have no idea what a complete solution looks like because I gave > up. A solution can not involve changing the compiler. That is just saying the kernel doesn't know how to fix its own problems, so let's give the compiler some more unnecessary problems. > > Or nicer, put it all in Kconfig, like powerpc already has for example. > > There is a CONFIG_WERROR as well, so maybe use that in all places? > > That's a good idea but I'm trying to compile old kernels and not the > current kernel. You can patch older kernels, too, you know :-) If you need to not make any changes to your source code for some crazy reason (political perhaps?), just use a shell script or shell function instead of invoking the compiler driver directly? Segher Segher ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-07 12:30 ` Segher Boessenkool @ 2023-09-12 9:50 ` Richard Biener 2023-10-23 5:19 ` Eric Gallager 0 siblings, 1 reply; 8+ messages in thread From: Richard Biener @ 2023-09-12 9:50 UTC (permalink / raw) To: Segher Boessenkool Cc: Dan Carpenter, Steven Rostedt, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Thu, Sep 7, 2023 at 2:32 PM Segher Boessenkool <segher@kernel.crashing.org> wrote: > > On Thu, Sep 07, 2023 at 02:23:00PM +0300, Dan Carpenter wrote: > > On Thu, Sep 07, 2023 at 06:04:09AM -0500, Segher Boessenkool wrote: > > > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > > > I started to hunt > > > > down all the Makefile which add a -Werror but there are a lot and > > > > eventually I got bored and gave up. > > > > > > I have a patch stack for that, since 2014 or so. I build Linux with > > > unreleased GCC versions all the time, so pretty much any new warning is > > > fatal if you unwisely use -Werror. > > > > > > > Someone should patch GCC so there it checks an environment variable to > > > > ignore -Werror. Somethine like this? > > > > > > No. You should patch your program, instead. > > > > There are 2930 Makefiles in the kernel source. > > Yes. And you need patches to about thirty. Or a bit more, if you want > to do it more cleanly. This isn't a guess. > > > > One easy way is to add a > > > -Wno-error at the end of your command lines. Or even just -w if you > > > want or need a bigger hammer. > > > > I tried that. Some of the Makefiles check an environemnt variable as > > well if you want to turn off -Werror. It's not a complete solution at > > all. I have no idea what a complete solution looks like because I gave > > up. > > A solution can not involve changing the compiler. That is just saying > the kernel doesn't know how to fix its own problems, so let's give the > compiler some more unnecessary problems. You can change the compiler by replacing it with a script that appends -Wno-error for example. > > > Or nicer, put it all in Kconfig, like powerpc already has for example. > > > There is a CONFIG_WERROR as well, so maybe use that in all places? > > > > That's a good idea but I'm trying to compile old kernels and not the > > current kernel. > > You can patch older kernels, too, you know :-) > > If you need to not make any changes to your source code for some crazy > reason (political perhaps?), just use a shell script or shell function > instead of invoking the compiler driver directly? > > > Segher > > Segher ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems 2023-09-12 9:50 ` Richard Biener @ 2023-10-23 5:19 ` Eric Gallager 0 siblings, 0 replies; 8+ messages in thread From: Eric Gallager @ 2023-10-23 5:19 UTC (permalink / raw) To: Richard Biener Cc: Segher Boessenkool, Dan Carpenter, Steven Rostedt, Dave Chinner, Guenter Roeck, Christoph Hellwig, ksummit, linux-fsdevel, gcc-patches On Tue, Sep 12, 2023 at 5:53 AM Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > On Thu, Sep 7, 2023 at 2:32 PM Segher Boessenkool > <segher@kernel.crashing.org> wrote: > > > > On Thu, Sep 07, 2023 at 02:23:00PM +0300, Dan Carpenter wrote: > > > On Thu, Sep 07, 2023 at 06:04:09AM -0500, Segher Boessenkool wrote: > > > > On Thu, Sep 07, 2023 at 12:48:25PM +0300, Dan Carpenter via Gcc-patches wrote: > > > > > I started to hunt > > > > > down all the Makefile which add a -Werror but there are a lot and > > > > > eventually I got bored and gave up. > > > > > > > > I have a patch stack for that, since 2014 or so. I build Linux with > > > > unreleased GCC versions all the time, so pretty much any new warning is > > > > fatal if you unwisely use -Werror. > > > > > > > > > Someone should patch GCC so there it checks an environment variable to > > > > > ignore -Werror. Somethine like this? > > > > > > > > No. You should patch your program, instead. > > > > > > There are 2930 Makefiles in the kernel source. > > > > Yes. And you need patches to about thirty. Or a bit more, if you want > > to do it more cleanly. This isn't a guess. > > > > > > One easy way is to add a > > > > -Wno-error at the end of your command lines. Or even just -w if you > > > > want or need a bigger hammer. > > > > > > I tried that. Some of the Makefiles check an environemnt variable as > > > well if you want to turn off -Werror. It's not a complete solution at > > > all. I have no idea what a complete solution looks like because I gave > > > up. > > > > A solution can not involve changing the compiler. That is just saying > > the kernel doesn't know how to fix its own problems, so let's give the > > compiler some more unnecessary problems. > > You can change the compiler by replacing it with a script that appends > -Wno-error > for example. I personally would find the original proposal of an IGNORE_WERROR environment variable much simpler than any of the alternative proposed solutions, especially for complicated build systems where I can't tell where the "-Werror" is getting inserted from. Often times I'm not actually the developer of the package I'm trying to compile, so saying "fix your code" in such a case doesn't make sense, since it's not actually my code to fix in the first place. It would be much easier for end-users in such a situation to just set an environment variable, rather than asking them to try to become developers themselves, which is what some of these alternative proposals (such as "write your own script!") seem to be asking. > > > > > Or nicer, put it all in Kconfig, like powerpc already has for example. > > > > There is a CONFIG_WERROR as well, so maybe use that in all places? > > > > > > That's a good idea but I'm trying to compile old kernels and not the > > > current kernel. > > > > You can patch older kernels, too, you know :-) > > > > If you need to not make any changes to your source code for some crazy > > reason (political perhaps?), just use a shell script or shell function > > instead of invoking the compiler driver directly? > > > > > > Segher > > > > Segher ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-10-23 5:19 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <ZO9NK0FchtYjOuIH@infradead.org> [not found] ` <8718a8a3-1e62-0e2b-09d0-7bce3155b045@roeck-us.net> [not found] ` <ZPkDLp0jyteubQhh@dread.disaster.area> [not found] ` <20230906215327.18a45c89@gandalf.local.home> 2023-09-07 9:48 ` [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems Dan Carpenter 2023-09-07 11:04 ` Segher Boessenkool 2023-09-07 11:22 ` Steven Rostedt 2023-09-07 12:24 ` Segher Boessenkool 2023-09-07 11:23 ` Dan Carpenter 2023-09-07 12:30 ` Segher Boessenkool 2023-09-12 9:50 ` Richard Biener 2023-10-23 5:19 ` Eric Gallager
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).