Re: [PATCH] Makefile: fix GDB warning with CONFIG_RELR

2021-03-23 Thread Nathan Chancellor
On Thu, Mar 18, 2021 at 05:07:06PM -0700, Nick Desaulniers wrote:
> GDB produces the following warning when debugging kernels built with
> CONFIG_RELR:
> 
> BFD: /android0/linux-next/vmlinux: unknown type [0x13] section `.relr.dyn'
> 
> when loading a kernel built with CONFIG_RELR into GDB. It can also
> prevent debugging symbols using such relocations.
> 
> Peter sugguests:
>   [That flag] means that lld will use dynamic tags and section type
>   numbers in the OS-specific range rather than the generic range. The
>   kernel itself doesn't care about these numbers; it determines the
>   location of the RELR section using symbols defined by a linker script.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1057
> Suggested-by: Peter Collingbourne 
> Signed-off-by: Nick Desaulniers 

Reviewed-by: Nathan Chancellor 

> ---
>  Makefile  | 2 +-
>  scripts/tools-support-relr.sh | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 5160ff8903c1..47741cb60995 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1088,7 +1088,7 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
>  endif
>  
>  ifeq ($(CONFIG_RELR),y)
> -LDFLAGS_vmlinux  += --pack-dyn-relocs=relr
> +LDFLAGS_vmlinux  += --pack-dyn-relocs=relr --use-android-relr-tags
>  endif
>  
>  # We never want expected sections to be placed heuristically by the
> diff --git a/scripts/tools-support-relr.sh b/scripts/tools-support-relr.sh
> index 45e8aa360b45..cb55878bd5b8 100755
> --- a/scripts/tools-support-relr.sh
> +++ b/scripts/tools-support-relr.sh
> @@ -7,7 +7,8 @@ trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT
>  cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1
>  void *p = &p;
>  END
> -$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file
> +$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \
> +  --use-android-relr-tags -o $tmp_file
>  
>  # Despite printing an error message, GNU nm still exits with exit code 0 if 
> it
>  # sees a relr section. So we need to check that nothing is printed to stderr.
> -- 
> 2.31.0.rc2.261.g7f71774620-goog
> 


[PATCH] Makefile: fix GDB warning with CONFIG_RELR

2021-03-18 Thread Nick Desaulniers
GDB produces the following warning when debugging kernels built with
CONFIG_RELR:

BFD: /android0/linux-next/vmlinux: unknown type [0x13] section `.relr.dyn'

when loading a kernel built with CONFIG_RELR into GDB. It can also
prevent debugging symbols using such relocations.

Peter sugguests:
  [That flag] means that lld will use dynamic tags and section type
  numbers in the OS-specific range rather than the generic range. The
  kernel itself doesn't care about these numbers; it determines the
  location of the RELR section using symbols defined by a linker script.

Link: https://github.com/ClangBuiltLinux/linux/issues/1057
Suggested-by: Peter Collingbourne 
Signed-off-by: Nick Desaulniers 
---
 Makefile  | 2 +-
 scripts/tools-support-relr.sh | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 5160ff8903c1..47741cb60995 100644
--- a/Makefile
+++ b/Makefile
@@ -1088,7 +1088,7 @@ LDFLAGS_vmlinux   += $(call ld-option, -X,)
 endif
 
 ifeq ($(CONFIG_RELR),y)
-LDFLAGS_vmlinux+= --pack-dyn-relocs=relr
+LDFLAGS_vmlinux+= --pack-dyn-relocs=relr --use-android-relr-tags
 endif
 
 # We never want expected sections to be placed heuristically by the
diff --git a/scripts/tools-support-relr.sh b/scripts/tools-support-relr.sh
index 45e8aa360b45..cb55878bd5b8 100755
--- a/scripts/tools-support-relr.sh
+++ b/scripts/tools-support-relr.sh
@@ -7,7 +7,8 @@ trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT
 cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1
 void *p = &p;
 END
-$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file
+$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \
+  --use-android-relr-tags -o $tmp_file
 
 # Despite printing an error message, GNU nm still exits with exit code 0 if it
 # sees a relr section. So we need to check that nothing is printed to stderr.
-- 
2.31.0.rc2.261.g7f71774620-goog



Re: [PATCH] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation

2020-07-20 Thread Fangrui Song

On 2020-07-20, Nick Desaulniers wrote:

On Mon, Jul 20, 2020 at 11:16 AM Nathan Chancellor
 wrote:


On Mon, Jul 20, 2020 at 11:12:22AM -0700, Fangrui Song wrote:
> When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if
> $(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-,
> GCC_TOOLCHAIN_DIR will be set to /usr/bin/.  --prefix= will be set to
> /usr/bin/ and Clang as of 11 will search for both
> $(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle.
>
> GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle,
> $(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice,
> $(prefix)aarch64-linux-gnu/$needle rarely contains executables.
>
> To better model how GCC's -B/--prefix takes in effect in practice, newer
> Clang only searches for $(prefix)$needle and for example it will find


"newer Clang" requires the reader to recall that "Clang as of 11" was
the previous frame of reference. I think it would be clearer to:
1. call of clang-12 as having a difference in behavior.
2. explicitly link to the commit, ie:
Link: 
https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90


> /usr/bin/as instead of /usr/bin/aarch64-linux-gnu-as.


That's a common source of pain (for example, when cross compiling
without having the proper cross binutils installed, it's common to get
spooky errors about unsupported configs or host binutils not
recognizing flags specific to cross building).

/usr/bin/as: unrecognized option '-EL'

being the most common.  So in that case, I'm actually very happy with
the llvm change if it solves that particularly common pain point.


>
> Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
> (/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the
> appropriate cross compiling GNU as (when -no-integrated-as is in
> effect).
>
> Signed-off-by: Nathan Chancellor 
> Signed-off-by: Fangrui Song 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1099

Sorry that I did not pay attention before but this needs

Cc: sta...@vger.kernel.org


Agreed.  This change to llvm will blow up all of our CI jobs that
cross compile if not backported to stable.


Thanks. I did not know this.



in the body so that it gets automatically backported into all of our
stable branches. I am not sure if Masahiro is okay with adding that
after the fact or if he will want a v2.

I am fine with having my signed-off-by on the patch but I did not really
do much :) I am fine with having that downgraded to


Not a big deal, but there's only really two cases I can think of where
it's appropriate to attach someone else's "SOB" to a patch:
1. It's their patch that you're resending on their behalf, possibly as
part of a larger series.
2. You're a maintainer, and...well I guess that's also case 1 above.

Reported-by is more appropriate, and you can include the tags
collected from this thread.  Please ping me internally for help
sending a v2, if needed.


Nathan's draft patch on
https://github.com/ClangBuiltLinux/linux/issues/1099 actually works.
I removed the slash. The words are my own. Since Nathan explicitly
requested a downgrade of his tag, I'll do that for V2.

I'll do that anyway because I need to fix a typo in the description:

$(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-
$(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-elfedit



Reviewed-by: Nathan Chancellor 
Tested-by: Nathan Chancellor 


I tested with this llvm pre- and post-
https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90.
I also tested downstream Android kernel builds with
3452a0d8c17f7166f479706b293caf6ac76ffd90. Builds that don't make use
of CROSS_COMPILE (native host targets) are obviously unaffected.  We
might see this issue pop up a few more times internally if the patch
isn't picked up by stable, or if those downstream kernel trees don't
rebase on stable kernel trees as often as they refresh their
toolchain.

Tested-by: Nick Desaulniers 


Thanks for offerring proofreading service! I'm working on the
description...



if people find it odd.

Thanks for sending this along!

Cheers,
Nathan

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 0b5f8538bde5..3ac83e375b61 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -567,7 +567,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep 
clang),)
>  ifneq ($(CROSS_COMPILE),)
>  CLANG_FLAGS  += --target=$(notdir $(CROSS_COMPILE:%-=%))
>  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> -CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)
> +CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
>  GCC_TOOLCHAIN:= $(realpath $(GCC_TOOLCHAIN_DIR)/..)
>  endif
>  ifneq ($(GCC_TOOLCHAIN),)
> --
> 2.28.0.rc0.105.gf9edc3c819-goog
>

--


--
Thanks,
~Nick Desaulniers


Re: [PATCH] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation

2020-07-20 Thread Nick Desaulniers
On Mon, Jul 20, 2020 at 11:16 AM Nathan Chancellor
 wrote:
>
> On Mon, Jul 20, 2020 at 11:12:22AM -0700, Fangrui Song wrote:
> > When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if
> > $(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-,
> > GCC_TOOLCHAIN_DIR will be set to /usr/bin/.  --prefix= will be set to
> > /usr/bin/ and Clang as of 11 will search for both
> > $(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle.
> >
> > GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle,
> > $(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice,
> > $(prefix)aarch64-linux-gnu/$needle rarely contains executables.
> >
> > To better model how GCC's -B/--prefix takes in effect in practice, newer
> > Clang only searches for $(prefix)$needle and for example it will find

"newer Clang" requires the reader to recall that "Clang as of 11" was
the previous frame of reference. I think it would be clearer to:
1. call of clang-12 as having a difference in behavior.
2. explicitly link to the commit, ie:
Link: 
https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90

> > /usr/bin/as instead of /usr/bin/aarch64-linux-gnu-as.

That's a common source of pain (for example, when cross compiling
without having the proper cross binutils installed, it's common to get
spooky errors about unsupported configs or host binutils not
recognizing flags specific to cross building).

/usr/bin/as: unrecognized option '-EL'

being the most common.  So in that case, I'm actually very happy with
the llvm change if it solves that particularly common pain point.

> >
> > Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
> > (/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the
> > appropriate cross compiling GNU as (when -no-integrated-as is in
> > effect).
> >
> > Signed-off-by: Nathan Chancellor 
> > Signed-off-by: Fangrui Song 
> > Link: https://github.com/ClangBuiltLinux/linux/issues/1099
>
> Sorry that I did not pay attention before but this needs
>
> Cc: sta...@vger.kernel.org

Agreed.  This change to llvm will blow up all of our CI jobs that
cross compile if not backported to stable.

>
> in the body so that it gets automatically backported into all of our
> stable branches. I am not sure if Masahiro is okay with adding that
> after the fact or if he will want a v2.
>
> I am fine with having my signed-off-by on the patch but I did not really
> do much :) I am fine with having that downgraded to

Not a big deal, but there's only really two cases I can think of where
it's appropriate to attach someone else's "SOB" to a patch:
1. It's their patch that you're resending on their behalf, possibly as
part of a larger series.
2. You're a maintainer, and...well I guess that's also case 1 above.

Reported-by is more appropriate, and you can include the tags
collected from this thread.  Please ping me internally for help
sending a v2, if needed.

>
> Reviewed-by: Nathan Chancellor 
> Tested-by: Nathan Chancellor 

I tested with this llvm pre- and post-
https://github.com/llvm/llvm-project/commit/3452a0d8c17f7166f479706b293caf6ac76ffd90.
I also tested downstream Android kernel builds with
3452a0d8c17f7166f479706b293caf6ac76ffd90. Builds that don't make use
of CROSS_COMPILE (native host targets) are obviously unaffected.  We
might see this issue pop up a few more times internally if the patch
isn't picked up by stable, or if those downstream kernel trees don't
rebase on stable kernel trees as often as they refresh their
toolchain.

Tested-by: Nick Desaulniers 

>
> if people find it odd.
>
> Thanks for sending this along!
>
> Cheers,
> Nathan
>
> > ---
> >  Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 0b5f8538bde5..3ac83e375b61 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -567,7 +567,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep 
> > clang),)
> >  ifneq ($(CROSS_COMPILE),)
> >  CLANG_FLAGS  += --target=$(notdir $(CROSS_COMPILE:%-=%))
> >  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> > -CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)
> > +CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
> >  GCC_TOOLCHAIN:= $(realpath $(GCC_TOOLCHAIN_DIR)/..)
> >  endif
> >  ifneq ($(GCC_TOOLCHAIN),)
> > --
> > 2.28.0.rc0.105.gf9edc3c819-goog
> >
>
> --

-- 
Thanks,
~Nick Desaulniers


Re: [PATCH] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation

2020-07-20 Thread Nathan Chancellor
On Mon, Jul 20, 2020 at 11:12:22AM -0700, Fangrui Song wrote:
> When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if
> $(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-,
> GCC_TOOLCHAIN_DIR will be set to /usr/bin/.  --prefix= will be set to
> /usr/bin/ and Clang as of 11 will search for both
> $(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle.
> 
> GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle,
> $(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice,
> $(prefix)aarch64-linux-gnu/$needle rarely contains executables.
> 
> To better model how GCC's -B/--prefix takes in effect in practice, newer
> Clang only searches for $(prefix)$needle and for example it will find
> /usr/bin/as instead of /usr/bin/aarch64-linux-gnu-as.
> 
> Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
> (/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the
> appropriate cross compiling GNU as (when -no-integrated-as is in
> effect).
> 
> Signed-off-by: Nathan Chancellor 
> Signed-off-by: Fangrui Song 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1099

Sorry that I did not pay attention before but this needs

Cc: sta...@vger.kernel.org

in the body so that it gets automatically backported into all of our
stable branches. I am not sure if Masahiro is okay with adding that
after the fact or if he will want a v2.

I am fine with having my signed-off-by on the patch but I did not really
do much :) I am fine with having that downgraded to

Reviewed-by: Nathan Chancellor 
Tested-by: Nathan Chancellor 

if people find it odd.

Thanks for sending this along!

Cheers,
Nathan

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 0b5f8538bde5..3ac83e375b61 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -567,7 +567,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep 
> clang),)
>  ifneq ($(CROSS_COMPILE),)
>  CLANG_FLAGS  += --target=$(notdir $(CROSS_COMPILE:%-=%))
>  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> -CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)
> +CLANG_FLAGS  += --prefix=$(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
>  GCC_TOOLCHAIN:= $(realpath $(GCC_TOOLCHAIN_DIR)/..)
>  endif
>  ifneq ($(GCC_TOOLCHAIN),)
> -- 
> 2.28.0.rc0.105.gf9edc3c819-goog
> 


[PATCH] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation

2020-07-20 Thread Fangrui Song
When CROSS_COMPILE is set (e.g. aarch64-linux-gnu-), if
$(CROSS_COMPILE)elfedit is found at /usr/bin/aarch64-linux-gnu-,
GCC_TOOLCHAIN_DIR will be set to /usr/bin/.  --prefix= will be set to
/usr/bin/ and Clang as of 11 will search for both
$(prefix)aarch64-linux-gnu-$needle and $(prefix)$needle.

GCC searchs for $(prefix)aarch64-linux-gnu/$version/$needle,
$(prefix)aarch64-linux-gnu/$needle and $(prefix)$needle. In practice,
$(prefix)aarch64-linux-gnu/$needle rarely contains executables.

To better model how GCC's -B/--prefix takes in effect in practice, newer
Clang only searches for $(prefix)$needle and for example it will find
/usr/bin/as instead of /usr/bin/aarch64-linux-gnu-as.

Set --prefix= to $(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
(/usr/bin/aarch64-linux-gnu-) so that newer Clang can find the
appropriate cross compiling GNU as (when -no-integrated-as is in
effect).

Signed-off-by: Nathan Chancellor 
Signed-off-by: Fangrui Song 
Link: https://github.com/ClangBuiltLinux/linux/issues/1099
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0b5f8538bde5..3ac83e375b61 100644
--- a/Makefile
+++ b/Makefile
@@ -567,7 +567,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep 
clang),)
 ifneq ($(CROSS_COMPILE),)
 CLANG_FLAGS+= --target=$(notdir $(CROSS_COMPILE:%-=%))
 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
-CLANG_FLAGS+= --prefix=$(GCC_TOOLCHAIN_DIR)
+CLANG_FLAGS+= --prefix=$(GCC_TOOLCHAIN_DIR)$(CROSS_COMPILE)
 GCC_TOOLCHAIN  := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
 endif
 ifneq ($(GCC_TOOLCHAIN),)
-- 
2.28.0.rc0.105.gf9edc3c819-goog



Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-06-03 Thread George G. Davis
Hello Masahiro,

On Sat, Jun 01, 2019 at 11:09:15AM +0900, Masahiro Yamada wrote:
> On Sat, Jun 1, 2019 at 2:45 AM George G. Davis  
> wrote:
> > > Following this pattern, does this work for you?
> > >
> > > diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> > > index 122aef5e4e14..371bd17a4983 100755
> > > --- a/scripts/checkstack.pl
> > > +++ b/scripts/checkstack.pl
> > > @@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
> > > $x  = "[0-9a-f]";   # hex character
> > > $xs = "[0-9a-f ]";  # hex character or space
> > > $funcre = qr/^$x* <(.*)>:$/;
> > > -   if ($arch eq 'aarch64') {
> > > +   if ($arch =~ '^(aarch|arm)64$') {
> >
> > Yes, that works, thanks!
> >
> > Will you submit a fix or would you like me to resubmit with the above 
> > suggested
> > fix?
> 
> Please send v2.

Done:

https://patchwork.kernel.org/patch/10972965/

Thanks!

> 
> Thanks.
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Regards,
George


Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread Masahiro Yamada
On Sat, Jun 1, 2019 at 2:45 AM George G. Davis  wrote:
> > Following this pattern, does this work for you?
> >
> > diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> > index 122aef5e4e14..371bd17a4983 100755
> > --- a/scripts/checkstack.pl
> > +++ b/scripts/checkstack.pl
> > @@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
> > $x  = "[0-9a-f]";   # hex character
> > $xs = "[0-9a-f ]";  # hex character or space
> > $funcre = qr/^$x* <(.*)>:$/;
> > -   if ($arch eq 'aarch64') {
> > +   if ($arch =~ '^(aarch|arm)64$') {
>
> Yes, that works, thanks!
>
> Will you submit a fix or would you like me to resubmit with the above 
> suggested
> fix?

Please send v2.

Thanks.

-- 
Best Regards
Masahiro Yamada


Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread George G. Davis
Hello Masahiro,

On Sat, Jun 01, 2019 at 02:22:36AM +0900, Masahiro Yamada wrote:

// CUT

> As far as I understood, checkstack.pl is supposed to
> understand both ARCH= and 'uname -m'.
> 
> 
> For example, the following commit supports x86, x86_64, i386,
> by using regular expression.
> 
> commit fda9f9903be6c3b590472c175c514b0834bb3c83
> Author: Konstantin Khlebnikov 
> Date:   Fri Aug 8 14:23:35 2014 -0700
> 
> scripts/checkstack.pl: automatically handle 32-bit and 64-bit mode
> for ARCH=x86
> 
> This patch adds support for ARCH=x86 into checkstack.
> 
> 
> 
> Following this pattern, does this work for you?
> 
> diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> index 122aef5e4e14..371bd17a4983 100755
> --- a/scripts/checkstack.pl
> +++ b/scripts/checkstack.pl
> @@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
> $x  = "[0-9a-f]";   # hex character
> $xs = "[0-9a-f ]";  # hex character or space
> $funcre = qr/^$x* <(.*)>:$/;
> -   if ($arch eq 'aarch64') {
> +   if ($arch =~ '^(aarch|arm)64$') {

Yes, that works, thanks!

Will you submit a fix or would you like me to resubmit with the above suggested
fix?


Thanks again!

> #ffc0006325cc:   a9bb7bfdstp x29,
> x30, [sp, #-80]!
> #a110:   d11643ffsub sp, sp, #0x590
> $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Regards,
George


Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread Masahiro Yamada
On Sat, Jun 1, 2019 at 1:39 AM George G. Davis  wrote:
>
> Hello Masahiro,
>
> On Sat, Jun 01, 2019 at 01:02:37AM +0900, Masahiro Yamada wrote:
> > On Sat, Jun 1, 2019 at 12:27 AM George G. Davis  
> > wrote:
> > >
> > > The following error occurs for the `make ARCH=arm64 checkstack` case:
> > >
> > > aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \
> > > perl ./scripts/checkstack.pl arm64
> > > wrong or unknown architecture "arm64"
> > >
> > > Fix the above error by setting `CHECKSTACK_ARCH := aarch64` for the
> > > ARCH=arm64 case.
> > >
> > > Signed-off-by: George G. Davis 
> >
> >
> > Why don't you fix scripts/checkstack.pl ?
>
> Like so?:
>

As far as I understood, checkstack.pl is supposed to
understand both ARCH= and 'uname -m'.


For example, the following commit supports x86, x86_64, i386,
by using regular expression.

commit fda9f9903be6c3b590472c175c514b0834bb3c83
Author: Konstantin Khlebnikov 
Date:   Fri Aug 8 14:23:35 2014 -0700

scripts/checkstack.pl: automatically handle 32-bit and 64-bit mode
for ARCH=x86

This patch adds support for ARCH=x86 into checkstack.



Following this pattern, does this work for you?

diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 122aef5e4e14..371bd17a4983 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
$x  = "[0-9a-f]";   # hex character
$xs = "[0-9a-f ]";  # hex character or space
$funcre = qr/^$x* <(.*)>:$/;
-   if ($arch eq 'aarch64') {
+   if ($arch =~ '^(aarch|arm)64$') {
#ffc0006325cc:   a9bb7bfdstp x29,
x30, [sp, #-80]!
#a110:   d11643ffsub sp, sp, #0x590
$re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;



-- 
Best Regards
Masahiro Yamada


Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread George G. Davis
Hello Masahiro,

On Sat, Jun 01, 2019 at 01:02:37AM +0900, Masahiro Yamada wrote:
> On Sat, Jun 1, 2019 at 12:27 AM George G. Davis  
> wrote:
> >
> > The following error occurs for the `make ARCH=arm64 checkstack` case:
> >
> > aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \
> > perl ./scripts/checkstack.pl arm64
> > wrong or unknown architecture "arm64"
> >
> > Fix the above error by setting `CHECKSTACK_ARCH := aarch64` for the
> > ARCH=arm64 case.
> >
> > Signed-off-by: George G. Davis 
> 
> 
> Why don't you fix scripts/checkstack.pl ?

Like so?:


diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 122aef5e4e14..8502de57e2ef 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -41,6 +41,8 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
if ($arch eq "") {
$arch = `uname -m`;
chomp($arch);
+   } elsif ($arch eq 'arm64') {
+   $arch = "aarch64";
}
 
$x  = "[0-9a-f]";   # hex character


Thanks!

> > diff --git a/Makefile b/Makefile
> > index 11358153d8f2..3e615e8553c0 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1695,7 +1695,11 @@ PHONY += checkstack kernelrelease kernelversion 
> > image_name
> >  ifeq ($(ARCH), um)
> >  CHECKSTACK_ARCH := $(SUBARCH)
> >  else
> > -CHECKSTACK_ARCH := $(ARCH)
> > +   ifeq ($(ARCH), arm64)
> > +   CHECKSTACK_ARCH := aarch64
> > +   else
> > +   CHECKSTACK_ARCH := $(ARCH)
> > +   endif
> >  endif
> >  checkstack:
> > $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
> > --
> > 2.7.4
> >
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Regards,
George


Re: [RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread Masahiro Yamada
On Sat, Jun 1, 2019 at 12:27 AM George G. Davis  wrote:
>
> The following error occurs for the `make ARCH=arm64 checkstack` case:
>
> aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \
> perl ./scripts/checkstack.pl arm64
> wrong or unknown architecture "arm64"
>
> Fix the above error by setting `CHECKSTACK_ARCH := aarch64` for the
> ARCH=arm64 case.
>
> Signed-off-by: George G. Davis 


Why don't you fix scripts/checkstack.pl ?



> ---
>  Makefile | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 11358153d8f2..3e615e8553c0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1695,7 +1695,11 @@ PHONY += checkstack kernelrelease kernelversion 
> image_name
>  ifeq ($(ARCH), um)
>  CHECKSTACK_ARCH := $(SUBARCH)
>  else
> -CHECKSTACK_ARCH := $(ARCH)
> +   ifeq ($(ARCH), arm64)
> +   CHECKSTACK_ARCH := aarch64
> +   else
> +   CHECKSTACK_ARCH := $(ARCH)
> +   endif
>  endif
>  checkstack:
> $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada


[RFC][PATCH] Makefile: Fix checkstack.pl arm64 wrong or unknown architecture

2019-05-31 Thread George G. Davis
The following error occurs for the `make ARCH=arm64 checkstack` case:

aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \
perl ./scripts/checkstack.pl arm64
wrong or unknown architecture "arm64"

Fix the above error by setting `CHECKSTACK_ARCH := aarch64` for the
ARCH=arm64 case.

Signed-off-by: George G. Davis 
---
 Makefile | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 11358153d8f2..3e615e8553c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1695,7 +1695,11 @@ PHONY += checkstack kernelrelease kernelversion 
image_name
 ifeq ($(ARCH), um)
 CHECKSTACK_ARCH := $(SUBARCH)
 else
-CHECKSTACK_ARCH := $(ARCH)
+   ifeq ($(ARCH), arm64)
+   CHECKSTACK_ARCH := aarch64
+   else
+   CHECKSTACK_ARCH := $(ARCH)
+   endif
 endif
 checkstack:
$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
-- 
2.7.4



Re: [PATCH] Makefile: Fix typo s/HOST_LOADLIBES/HOST_LOADLIBS

2018-04-24 Thread Masahiro Yamada
2018-04-25 0:59 GMT+09:00 Sedat Dilek :
>> Masahiro Yamada  hat am 24. April 2018 um 
>> 17:51 geschrieben:
>>
>>
>> 2018-04-24 17:44 GMT+09:00 Sedat Dilek :
>> > Signed-off-by: Sedat Dilek 
>> > ---
>> >  Makefile | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/Makefile b/Makefile
>> > index 83b6c541565a..e1869dc08288 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -366,7 +366,7 @@ HOSTCFLAGS   := -Wall -Wmissing-prototypes 
>> > -Wstrict-prototypes -O2 \
>> > -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
>> >  HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
>> >  HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
>> > -HOST_LOADLIBES := $(HOST_LFS_LIBS)
>> > +HOST_LOADLIBS := $(HOST_LFS_LIBS)
>> >
>> >  # Make variables (CC, etc...)
>> >  AS = $(CROSS_COMPILE)as
>> > @@ -433,7 +433,7 @@ LDFLAGS :=
>> >  GCC_PLUGINS_CFLAGS :=
>> >
>> >  export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
>> > -export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
>> > +export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBS
>> >  export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 
>> > PYTHON3 UTS_MACHINE
>> >  export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
>> >
>>
>> Why is this a typo?
>>
>>
>> Our Makefiles use HOST_LOADLIBES consistently.
>>
>
> OK. Do you happen to know why it is LOADLIB*E*S?


I do not know.  Historical convention.

LOADLIBES and/or LDLIBS is conventionally used.

You will see them by running 'make --print-data-base'





> - Sedat -
>
>>
>> $ git grep HOST_LOADLIB
>> Makefile:HOST_LOADLIBES := $(HOST_LFS_LIBS)
>> Makefile:export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
>> scripts/Makefile.host:  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
>> scripts/Makefile.host:$(HOST_LOADLIBES)
>> $(HOSTLOADLIBES_$(@F))
>> scripts/Makefile.host:$(HOST_LOADLIBES)
>> $(HOSTLOADLIBES_$(@F))
>> scripts/Makefile.host:$(HOST_LOADLIBES)
>> $(HOSTLOADLIBES_$(@F))
>> scripts/Makefile.host:$(HOST_LOADLIBES)
>> $(HOSTLOADLIBES_$(@F))
>>
>>
>>
>>
>> --
>> Best Regards
>> Masahiro Yamada
>
> --
> Mit freundlichen Grüssen,
> Sedat Dilek
>
> Telefon: +49 2166 9901-153
> E-Mail: sedat.di...@credativ.de
> Internet: https://www.credativ.de/
>
> GPG-Fingerprint: EA6D E17D D269 AC7E 101D C910 476F 2B3B 0AF7 F86B
>
> credativ GmbH, Trompeterallee 108, 41189 Mönchengladbach
> Handelsregister: Amtsgericht Mönchengladbach, HR-Nummer: HRB 12080, 
> UID-Nummer: DE204566209
> Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
>
> **
> Jetzt neu:
> Elephant Shed - PostgreSQL Appliance
> PostgreSQL und alles was dazugehört
>
> Von Backup über Monitoring bis Reporting:
> https://elephant-shed.io/
> **
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada


Re: [PATCH] Makefile: Fix typo s/HOST_LOADLIBES/HOST_LOADLIBS

2018-04-24 Thread Sedat Dilek
> Masahiro Yamada  hat am 24. April 2018 um 
> 17:51 geschrieben:
> 
> 
> 2018-04-24 17:44 GMT+09:00 Sedat Dilek :
> > Signed-off-by: Sedat Dilek 
> > ---
> >  Makefile | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 83b6c541565a..e1869dc08288 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -366,7 +366,7 @@ HOSTCFLAGS   := -Wall -Wmissing-prototypes 
> > -Wstrict-prototypes -O2 \
> > -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
> >  HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
> >  HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
> > -HOST_LOADLIBES := $(HOST_LFS_LIBS)
> > +HOST_LOADLIBS := $(HOST_LFS_LIBS)
> >
> >  # Make variables (CC, etc...)
> >  AS = $(CROSS_COMPILE)as
> > @@ -433,7 +433,7 @@ LDFLAGS :=
> >  GCC_PLUGINS_CFLAGS :=
> >
> >  export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
> > -export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
> > +export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBS
> >  export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 
> > PYTHON3 UTS_MACHINE
> >  export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
> >
> 
> Why is this a typo?
> 
> 
> Our Makefiles use HOST_LOADLIBES consistently.
> 

OK. Do you happen to know why it is LOADLIB*E*S?

- Sedat -

> 
> $ git grep HOST_LOADLIB
> Makefile:HOST_LOADLIBES := $(HOST_LFS_LIBS)
> Makefile:export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
> scripts/Makefile.host:  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
> scripts/Makefile.host:$(HOST_LOADLIBES)
> $(HOSTLOADLIBES_$(@F))
> scripts/Makefile.host:$(HOST_LOADLIBES)
> $(HOSTLOADLIBES_$(@F))
> scripts/Makefile.host:$(HOST_LOADLIBES)
> $(HOSTLOADLIBES_$(@F))
> scripts/Makefile.host:$(HOST_LOADLIBES)
> $(HOSTLOADLIBES_$(@F))
> 
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Mit freundlichen Grüssen, 
Sedat Dilek 

Telefon: +49 2166 9901-153 
E-Mail: sedat.di...@credativ.de 
Internet: https://www.credativ.de/ 

GPG-Fingerprint: EA6D E17D D269 AC7E 101D C910 476F 2B3B 0AF7 F86B

credativ GmbH, Trompeterallee 108, 41189 Mönchengladbach
Handelsregister: Amtsgericht Mönchengladbach, HR-Nummer: HRB 12080, UID-Nummer: 
DE204566209
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

**
Jetzt neu:
Elephant Shed - PostgreSQL Appliance
PostgreSQL und alles was dazugehört

Von Backup über Monitoring bis Reporting:
https://elephant-shed.io/
**


Re: [PATCH] Makefile: Fix typo s/HOST_LOADLIBES/HOST_LOADLIBS

2018-04-24 Thread Masahiro Yamada
2018-04-24 17:44 GMT+09:00 Sedat Dilek :
> Signed-off-by: Sedat Dilek 
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 83b6c541565a..e1869dc08288 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -366,7 +366,7 @@ HOSTCFLAGS   := -Wall -Wmissing-prototypes 
> -Wstrict-prototypes -O2 \
> -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
>  HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
>  HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
> -HOST_LOADLIBES := $(HOST_LFS_LIBS)
> +HOST_LOADLIBS := $(HOST_LFS_LIBS)
>
>  # Make variables (CC, etc...)
>  AS = $(CROSS_COMPILE)as
> @@ -433,7 +433,7 @@ LDFLAGS :=
>  GCC_PLUGINS_CFLAGS :=
>
>  export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
> -export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
> +export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBS
>  export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 
> UTS_MACHINE
>  export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
>

Why is this a typo?


Our Makefiles use HOST_LOADLIBES consistently.


$ git grep HOST_LOADLIB
Makefile:HOST_LOADLIBES := $(HOST_LFS_LIBS)
Makefile:export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
scripts/Makefile.host:  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
scripts/Makefile.host:$(HOST_LOADLIBES)
$(HOSTLOADLIBES_$(@F))
scripts/Makefile.host:$(HOST_LOADLIBES)
$(HOSTLOADLIBES_$(@F))
scripts/Makefile.host:$(HOST_LOADLIBES)
$(HOSTLOADLIBES_$(@F))
scripts/Makefile.host:$(HOST_LOADLIBES)
$(HOSTLOADLIBES_$(@F))




-- 
Best Regards
Masahiro Yamada


[PATCH] Makefile: Fix typo s/HOST_LOADLIBES/HOST_LOADLIBS

2018-04-24 Thread Sedat Dilek
Signed-off-by: Sedat Dilek 
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 83b6c541565a..e1869dc08288 100644
--- a/Makefile
+++ b/Makefile
@@ -366,7 +366,7 @@ HOSTCFLAGS   := -Wall -Wmissing-prototypes 
-Wstrict-prototypes -O2 \
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
 HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
 HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
-HOST_LOADLIBES := $(HOST_LFS_LIBS)
+HOST_LOADLIBS := $(HOST_LFS_LIBS)
 
 # Make variables (CC, etc...)
 AS = $(CROSS_COMPILE)as
@@ -433,7 +433,7 @@ LDFLAGS :=
 GCC_PLUGINS_CFLAGS :=
 
 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
-export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
+export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBS
 export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 
UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
-- 
2.17.0



[PATCH] Makefile: Fix lying comment re. silentoldconfig

2018-02-12 Thread Ulf Magnusson
The comment above the silentoldconfig invocation is outdated.
'make oldconfig' updates just .config and doesn't touch the
include/config/ tree.

This came up in https://lkml.org/lkml/2018/2/12/415.

While fixing the comment, make it more informative by explaining the
purpose of the unfortunately named silentoldconfig.

I can't make sense of the comment re. auto.conf.cmd and a cleaned tree.
include/config/auto.conf and include/config/auto.conf.cmd are both
created simultaneously by silentoldconfig (in
scripts/kconfig/confdata.c, by conf_write_autoconf()), and nothing seems
to remove auto.conf.cmd that wouldn't remove auto.conf. Remove that part
of the comment rather than blindly copying it. It might be a leftover
from an older way of doing things.

The include/config/auto.conf.cmd prerequisite might be there to ensure
that silentoldconfig gets rerun if conf_write_autoconf() fails between
writing out auto.conf.cmd and auto.conf (a comment in the function
indicates that auto.conf is deliberately written out last to mark
completion of the operation). It seems the Makefile dependency between
.config and include/config/auto.conf would already take care of that
though, since .config would still be out of date re.
include/config/auto.conf if the operation fails.

Cop out and leave the prerequisite in for now though.

Signed-off-by: Ulf Magnusson 
---
 Makefile | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 79ad2bfa24b6..61ed99ad4b1b 100644
--- a/Makefile
+++ b/Makefile
@@ -579,10 +579,13 @@ ifeq ($(KBUILD_EXTMOD),)
 # To avoid any implicit rule to kick in, define an empty command
 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 
-# If .config is newer than include/config/auto.conf, someone tinkered
-# with it and forgot to run make oldconfig.
-# if auto.conf.cmd is missing then we are probably in a cleaned tree so
-# we execute the config step to be sure to catch updated Kconfig files
+# The actual configuration files used during the build are stored in
+# include/generated/ and include/config/. Update them if .config is newer than
+# include/config/auto.conf (which mirrors .config).
+#
+# The include/config/ tree manages dependencies between source files and
+# Kconfig symbols and lets us avoid doing a full rebuild whenever the
+# configuration is changed. See scripts/basic/fixdep.c
 include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
-- 
2.14.1



[PATCH] Makefile: Fix empty flag results for stackprotector _AUTO mode

2017-10-15 Thread Kees Cook
If the compiler didn't support any stackprotector mode, the second
empty test would still trip. This moves it to an "else" test for the
non-AUTO modes.

Reported-and-tested-by: Robert Jarzmik 
Signed-off-by: Kees Cook 
---
This is a separate fix from the issue with gcc 4.4.4. Yay compilers.
(Also, this is technically a v2 with just the commit message changed.)
---
 Makefile | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 20fafb48fdf9..74d5f037df69 100644
--- a/Makefile
+++ b/Makefile
@@ -1093,16 +1093,17 @@ PHONY += prepare-compiler-check
 prepare-compiler-check: FORCE
 # Make sure compiler supports requested stack protector flag.
 ifdef stackp-name
-  # Warn about CONFIG_CC_STACKPROTECTOR_AUTO having found no option.
   ifeq ($(stackp-flag),)
+   # Warn about CONFIG_CC_STACKPROTECTOR_AUTO having found no option.
@echo CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
  Compiler does not support any known stack-protector >&2
-  endif
-  # Fail if specifically requested stack protector is missing.
+  else
   ifeq ($(call cc-option, $(stackp-flag)),)
+   # Fail if specifically requested stack protector is missing.
@echo Cannot use CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
  $(stackp-flag) not supported by compiler >&2 && exit 1
   endif
+  endif
 endif
 # Make sure compiler does not have buggy stack-protector support.
 ifdef stackp-check
-- 
2.7.4


-- 
Kees Cook
Pixel Security


[PATCH] Makefile: Fix CONFIG_CC_STACKPROTECTOR_AUTO to not enable SSP

2017-10-03 Thread Kees Cook
There was a think-o in the logic for CONFIG_CC_STACKPROTECTOR_AUTO, which
would leave CONFIG_CC_STACKPROTECTOR defined when a compiler didn't support
stack-protector. This usually won't cause a problem with a build, but it's
not correct, and shouldn't happen.

Reported-by: Mark Rutland 
Cc: Masahiro Yamada 
Cc: linux-kbu...@vger.kernel.org
Signed-off-by: Kees Cook 
---
Andrew, if possible, can you squash this as a fix for the mmots patch
"makefile-introduce-config_cc_stackprotector_auto.patch"? If not, that's fine.
---
 Makefile | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9bd334b35003..2f8ff79fa9a5 100644
--- a/Makefile
+++ b/Makefile
@@ -693,14 +693,18 @@ else
 endif
 endif
 endif
+# If stack-protection was requested (and available, in the case of _AUTO),
+# then prepare the build for it being enabled.
 ifdef stackp-name
-  # If the stack protector has been selected, inform the rest of the build.
+ifneq ($(stackp-flag),)
+  # If the stack protector is active, enable code that depends on it.
   KBUILD_CFLAGS += -DCONFIG_CC_STACKPROTECTOR
   KBUILD_AFLAGS += -DCONFIG_CC_STACKPROTECTOR
   # Find arch-specific stack protector compiler sanity-checking script.
   stackp-path := 
$(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
   stackp-check := $(wildcard $(stackp-path))
 endif
+endif
 KBUILD_CFLAGS += $(stackp-flag)
 
 ifeq ($(cc-name),clang)
-- 
2.7.4


-- 
Kees Cook
Pixel Security


[PATCH] Makefile: fix reference to sparse documentation

2016-10-15 Thread Andreas Platschek
Documenation/sparse.txt was moved to Documentation/dev-tools/sparse.rst,
this fixes the reference.

Signed-off-by: Andreas Platschek 
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d8c784d..d7157a1 100644
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,7 @@ MAKEFLAGS += --no-print-directory
 # Use 'make C=2' to enable checking of *all* source files, regardless
 # of whether they are re-compiled or not.
 #
-# See the file "Documentation/sparse.txt" for more details, including
+# See the file "Documentation/dev-tools/sparse.rst" for more details, including
 # where to get the "sparse" utility.
 
 ifeq ("$(origin C)", "command line")
-- 
2.9.3



Re: [PATCH] Makefile: Fix detection of clang when cross-compiling

2015-04-11 Thread Michal Marek
On Thu, Apr 09, 2015 at 04:34:54PM +0200, Paul Cercueil wrote:
> When the host's C compiler is clang, and when attempting to
> cross-compile Linux e.g. to MIPS with mipsel-linux-gcc, the Makefile
> would incorrectly detect the use of clang, which resulted in
> clang-specific flags being passed to mipsel-linux-gcc.
> 
> This can be verified under Debian by installing the "clang" package,
> and then using it as the default compiler with:
> sudo update-alternatives --config cc
> 
> This patch moves the detection of clang after the $(CC) variable is
> initialized to the name of the cross-compiler, so that the check applies
> to the cross-compiler and not the host's C compiler.
> 
> Signed-off-by: Paul Cercueil 
> ---
>  Makefile | 16 +++-
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 54430f9..5fff1b2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -335,15 +335,6 @@ endif
>  export KBUILD_MODULES KBUILD_BUILTIN
>  export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
>  
> -ifneq ($(CC),)
> -ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
> -COMPILER := clang
> -else
> -COMPILER := gcc
> -endif
> -export COMPILER
> -endif
> -
>  # Look for make include files relative to root of kernel src
>  MAKEFLAGS += --include-dir=$(srctree)
>  
> @@ -369,6 +360,13 @@ PERL = perl
>  PYTHON   = python
>  CHECK= sparse
>  
> +ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
> +COMPILER := clang
> +else
> +COMPILER := gcc
> +endif
> +export COMPILER

It should be moved even deeper, after the inclusion of arch/*/Makefile.
There are architectures which set $(CROSS_COMPILE) by default, as a
convenience.

Michal
--
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] Makefile: Fix detection of clang when cross-compiling

2015-04-09 Thread Paul Cercueil
When the host's C compiler is clang, and when attempting to
cross-compile Linux e.g. to MIPS with mipsel-linux-gcc, the Makefile
would incorrectly detect the use of clang, which resulted in
clang-specific flags being passed to mipsel-linux-gcc.

This can be verified under Debian by installing the "clang" package,
and then using it as the default compiler with:
sudo update-alternatives --config cc

This patch moves the detection of clang after the $(CC) variable is
initialized to the name of the cross-compiler, so that the check applies
to the cross-compiler and not the host's C compiler.

Signed-off-by: Paul Cercueil 
---
 Makefile | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 54430f9..5fff1b2 100644
--- a/Makefile
+++ b/Makefile
@@ -335,15 +335,6 @@ endif
 export KBUILD_MODULES KBUILD_BUILTIN
 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
 
-ifneq ($(CC),)
-ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
-COMPILER := clang
-else
-COMPILER := gcc
-endif
-export COMPILER
-endif
-
 # Look for make include files relative to root of kernel src
 MAKEFLAGS += --include-dir=$(srctree)
 
@@ -369,6 +360,13 @@ PERL   = perl
 PYTHON = python
 CHECK  = sparse
 
+ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
+COMPILER := clang
+else
+COMPILER := gcc
+endif
+export COMPILER
+
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void $(CF)
 CFLAGS_MODULE   =
-- 
2.1.4

--
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] Makefile: Fix unrecognized cross-compiler command line options

2014-06-09 Thread Michal Marek
Dne 27.5.2014 09:54, Geert Uytterhoeven napsal(a):
> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
> (arc, blackfin, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
> cc-option and cc-disable-warning may check against the wrong compiler,
> causing errors like
> 
> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
> 
> if the host gcc supports a compiler option, while the cross compiler
> doesn't support that option.
> 
> Move all logic using cc-option or cc-disable-warning below the inclusion
> of the arch's Makefile to fix this.
> 
> Introduced by
>   - commit e74fc973b6e531fef1fce8b10105ecfb774c ("Turn off
> -Wmaybe-uninitialized when building with -Os"),
>   - commit 61163efae02040f66a95c8ed17f4407951ba58fa ("kbuild: LLVMLinux:
> Add Kbuild support for building kernel with Clang").
> 
> As -Wno-maybe-uninitialized requires a quite recent gcc (gcc 4.6.3 on
> Ubuntu 12.04 LTS doesn't support it), this only showed up recently (gcc
> 4.8.2 on Ubuntu 14.04 LTS does support it).
> 
> Signed-off-by: Geert Uytterhoeven 

Applied to kbuild.git#kbuild, thanks.

Michal

--
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] Makefile: Fix unrecognized cross-compiler command line options

2014-05-27 Thread Geert Uytterhoeven
On architectures that setup CROSS_COMPILE in their arch/*/Makefile
(arc, blackfin, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
cc-option and cc-disable-warning may check against the wrong compiler,
causing errors like

cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"

if the host gcc supports a compiler option, while the cross compiler
doesn't support that option.

Move all logic using cc-option or cc-disable-warning below the inclusion
of the arch's Makefile to fix this.

Introduced by
  - commit e74fc973b6e531fef1fce8b10105ecfb774c ("Turn off
-Wmaybe-uninitialized when building with -Os"),
  - commit 61163efae02040f66a95c8ed17f4407951ba58fa ("kbuild: LLVMLinux:
Add Kbuild support for building kernel with Clang").

As -Wno-maybe-uninitialized requires a quite recent gcc (gcc 4.6.3 on
Ubuntu 12.04 LTS doesn't support it), this only showed up recently (gcc
4.8.2 on Ubuntu 14.04 LTS does support it).

Signed-off-by: Geert Uytterhoeven 
---
Perhaps all KBUILD_* definitions can be moved below the inclusion of the
arch's Makefile, to make it less likely to happen again?
But that's definitely post-3.15 material.

 Makefile | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index cf3412d78ff1..da910e09fc9a 100644
--- a/Makefile
+++ b/Makefile
@@ -395,8 +395,8 @@ KBUILD_CPPFLAGS := -D__KERNEL__
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
   -fno-strict-aliasing -fno-common \
   -Werror-implicit-function-declaration \
-  -Wno-format-security \
-  $(call cc-option,-fno-delete-null-pointer-checks,)
+  -Wno-format-security
+
 KBUILD_AFLAGS_KERNEL :=
 KBUILD_CFLAGS_KERNEL :=
 KBUILD_AFLAGS   := -D__ASSEMBLY__
@@ -594,14 +594,16 @@ endif # $(dot-config)
 # Defaults to vmlinux, but the arch makefile usually adds further targets
 all: vmlinux
 
+include $(srctree)/arch/$(SRCARCH)/Makefile
+
+KBUILD_CFLAGS  += $(call cc-option,-fno-delete-null-pointer-checks,)
+
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
 else
 KBUILD_CFLAGS  += -O2
 endif
 
-include $(srctree)/arch/$(SRCARCH)/Makefile
-
 ifdef CONFIG_READABLE_ASM
 # Disable optimizations that make assembler listings hard to read.
 # reorder blocks reorders the control in the function
-- 
1.9.1

--
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] Makefile: fix syntax error in warning message

2014-02-20 Thread Kees Cook
On Wed, Feb 19, 2014 at 2:13 PM,   wrote:
> From: Stefan Seyfried 
>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 893d6f0..eeaf3e7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -606,7 +606,7 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
>stackp-flag := -fstack-protector
>ifeq ($(call cc-option, $(stackp-flag)),)
>  $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
> - -fstack-protector not supported by compiler))
> + -fstack-protector not supported by compiler)
>endif
>  else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
>stackp-flag := -fstack-protector-strong

Hi!

Thanks, yes, this has already been picked up:
http://marc.info/?l=linux-mm-commits&m=139275774732494&w=2

-Kees

-- 
Kees Cook
Chrome OS Security
--
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] Makefile: fix syntax error in warning message

2014-02-19 Thread stefan . seyfried
From: Stefan Seyfried 

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 893d6f0..eeaf3e7 100644
--- a/Makefile
+++ b/Makefile
@@ -606,7 +606,7 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
   stackp-flag := -fstack-protector
   ifeq ($(call cc-option, $(stackp-flag)),)
 $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
- -fstack-protector not supported by compiler))
+ -fstack-protector not supported by compiler)
   endif
 else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
   stackp-flag := -fstack-protector-strong
-- 
1.8.5.2


Stefan Seyfried
Linux Consultant & Developer -- GPG Key: 0x731B665B

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
--
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] Makefile: fix extra parenthesis typo when CC_STACKPROTECTOR_REGULAR is enabled

2014-02-18 Thread Kees Cook
On Mon, Feb 17, 2014 at 1:42 AM, Fathi Boudra  wrote:
> extra parenthesis typo introduced in commit 19952a9203 is causing
> the following error when CONFIG_CC_STACKPROTECTOR_REGULAR is enabled:
> Makefile:608: Cannot use CONFIG_CC_STACKPROTECTOR: -fstack-protector not
> supported by compiler
> Makefile:608: *** missing separator.  Stop.

Yikes! I have no idea how that snuck in. :( Thank you for noticing and
fixing this.

> Signed-off-by: Fathi Boudra 

Acked-by: Kees Cook 

Thanks!

-Kees

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 893d6f0..eeaf3e7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -606,7 +606,7 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
>stackp-flag := -fstack-protector
>ifeq ($(call cc-option, $(stackp-flag)),)
>  $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
> - -fstack-protector not supported by compiler))
> + -fstack-protector not supported by compiler)
>endif
>  else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
>stackp-flag := -fstack-protector-strong
> --
> 1.8.1.2
>



-- 
Kees Cook
Chrome OS Security
--
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] Makefile: fix order of INITRD_COMPRESS-y assignments

2013-12-20 Thread Jeff Layton
Commit 7ac181568342ec (fix build with make 3.80) changed how the
Makefile handles the INITRD_COMPRESS-y assignment in order to make it
work properly with older versions of make. Unfortunately, it also
changes the behavior of how that assignment works when multiple
CONFIG_RD_* options are set, such that they are now preferred in the
reverse order of the way they were before.

Reverse the order of assignments to try and preserve the earlier
precedence in this situation.

Cc: Jan Beulich 
Cc: P J P 
Cc: Andrew Morton 
Signed-off-by: Jeff Layton 
---
 Makefile | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 89cee86..fb76899 100644
--- a/Makefile
+++ b/Makefile
@@ -733,11 +733,11 @@ export mod_strip_cmd
 # This shall be used by the dracut(8) tool while creating an initramfs image.
 #
 INITRD_COMPRESS-y  := gzip
-INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
-INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
-INITRD_COMPRESS-$(CONFIG_RD_XZ):= xz
-INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
 INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
+INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
+INITRD_COMPRESS-$(CONFIG_RD_XZ):= xz
+INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
+INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
 export INITRD_COMPRESS := $(INITRD_COMPRESS-y)
 
 ifdef CONFIG_MODULE_SIG_ALL
-- 
1.8.4.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/


[PATCH] Makefile: fix out-of-tree builds for multiple targets with 'all'

2013-11-03 Thread Yann E. MORIN
From: "Yann E. MORIN" 

For out-of-tree builds, this use-case fails to build:
$ make clean all

This is because 'all' is filtered-out in the Makefile wrapper, since
the wrapper itself has a 'all' target.

The 'all' target is just the usual naming for the default target in a
Makefile. In fact, the first target is the default one, so we can name
it whatever we want.

Rename the Makefile wrapper 'all' target to avoid name-clashing.

Reported-by: Ryan Barnett 
Signed-off-by: "Yann E. MORIN" 
Cc: Ryan Barnett 

---
Note: this still does not allow 'make menuconfig all', but that is not
even working for in-tree builds either.
---
 scripts/mkmakefile | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc0442..28583bc 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -42,18 +42,18 @@ MAKEARGS += O=\$(if \$(patsubst 
/%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$
 
 MAKEFLAGS += --no-print-directory
 
-.PHONY: all \$(MAKECMDGOALS)
+.PHONY: _all \$(MAKECMDGOALS)
 
-all:= \$(filter-out all Makefile,\$(MAKECMDGOALS))
+all:= \$(filter-out Makefile,\$(MAKECMDGOALS))
 
-all:
+_all:
\$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
 
 Makefile:;
 
-\$(all): all
+\$(all): _all
@:
 
-%/: all
+%/: _all
@:
 EOF
-- 
1.8.1.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] Makefile: Fix install error with make -j option

2013-07-03 Thread Michal Marek
On Wed, Jun 12, 2013 at 12:13:47PM +0200, Robert Richter wrote:
> Michal,
> 
> please apply this fix, ideally for v3.10 if possible.

I applied it to kbuild.git#kbuild now, with Cc:
.

Michal
> 
> Thanks,
> 
> -Robert
> 
> 
> On 02.05.13 08:50:37, Robert Richter wrote:
> > From: Robert Richter 
> > 
> > Make modules_install fails with -j option:
> > 
> >DEPMOD
> >  Usage: .../.source/linux/scripts/depmod.sh /sbin/depmod 
> >  make[1]: *** [_modinst_post] Error 1
> > 
> > Adding kernelrelease dependency to fix this.
> > 
> > Signed-off-by: Robert Richter 
> > ---
> >  Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 46263d8..0205e79 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -979,7 +979,7 @@ _modinst_:
> >  # boot a modules.dep even before / is mounted read-write.  However the
> >  # boot script depmod is the master version.
> >  PHONY += _modinst_post
> > -_modinst_post: _modinst_
> > +_modinst_post: include/config/kernel.release _modinst_
> > $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware 
> > __fw_modinst
> > $(call cmd,depmod)
> >  
> > -- 
> > 1.8.1.1
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
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] Makefile: Fix install error with make -j option

2013-06-12 Thread Robert Richter
Michal,

please apply this fix, ideally for v3.10 if possible.

Thanks,

-Robert


On 02.05.13 08:50:37, Robert Richter wrote:
> From: Robert Richter 
> 
> Make modules_install fails with -j option:
> 
>DEPMOD
>  Usage: .../.source/linux/scripts/depmod.sh /sbin/depmod 
>  make[1]: *** [_modinst_post] Error 1
> 
> Adding kernelrelease dependency to fix this.
> 
> Signed-off-by: Robert Richter 
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 46263d8..0205e79 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -979,7 +979,7 @@ _modinst_:
>  # boot a modules.dep even before / is mounted read-write.  However the
>  # boot script depmod is the master version.
>  PHONY += _modinst_post
> -_modinst_post: _modinst_
> +_modinst_post: include/config/kernel.release _modinst_
>   $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware 
> __fw_modinst
>   $(call cmd,depmod)
>  
> -- 
> 1.8.1.1
> 
--
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] Makefile: Fix install error with make -j option

2013-05-02 Thread Robert Richter
From: Robert Richter 

Make modules_install fails with -j option:

   DEPMOD
 Usage: .../.source/linux/scripts/depmod.sh /sbin/depmod 
 make[1]: *** [_modinst_post] Error 1

Adding kernelrelease dependency to fix this.

Signed-off-by: Robert Richter 
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 46263d8..0205e79 100644
--- a/Makefile
+++ b/Makefile
@@ -979,7 +979,7 @@ _modinst_:
 # boot a modules.dep even before / is mounted read-write.  However the
 # boot script depmod is the master version.
 PHONY += _modinst_post
-_modinst_post: _modinst_
+_modinst_post: include/config/kernel.release _modinst_
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware 
__fw_modinst
$(call cmd,depmod)
 
-- 
1.8.1.1

--
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[ Makefile: Fix scripts_basic / archscripts build order

2012-09-20 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/19/12 1:42 PM, H. Peter Anvin wrote:
> Kbuild people, any comments?

Thanks for bouncing along.

This patch is wrong. It fixes the 'make' case because scripts_basic is
build before archscripts but doesn't get rid of the root cause.

'make archscripts' alone still fails. I'll send a replacement that
addresses that dependency issue directly.

- -Jeff

> On 09/19/2012 10:38 AM, Jeff Mahoney wrote:
>> The SUSE kernel packages are built by doing the following:
>> 
>> make silentoldonfig make prepare make scripts make clean
>> 
>> 
>> 
>> make -j$NCPUs
>> 
>> On parallel builds (also using -C/O=), this can occasionally fail
>> with: HOSTCC  scripts/basic/fixdep /bin/sh: scripts/basic/fixdep:
>> No such file or directory make[3]: *** [arch/x86/tools/relocs]
>> Error 1 make[2]: *** [archscripts] Error 2 make[2]: *** Waiting
>> for unfinished jobs make[1]: *** [sub-make] Error 2 make: ***
>> [all] Error 2
>> 
>> The error can also be "Permission denied."
>> 
>> Without the make clean this works ok.
>> 
>> What seems to be happening is that fixdep exists so relocs is
>> able to be rebuilt, but then somewhere there is a FORCE rule that
>> applies to fixdep so it is rebuilt. If the timing is right, the
>> relocs build can happen while the fixdep rebuild is happening and
>> we either get a non-executable fixdep or a nonexistent fixdep.
>> 
>> This patch moves the archscripts dependency after scripts_basic
>> so that fixdep is always built after relocs. If I understand the
>> build order correctly, this should be the case since
>> scripts_basic is essentially a prereq of everything.
>> 
>> This was introduced by commit 6520fe55 (x86, realmode: 16-bit
>> real-mode code support for relocs), which added the archscripts
>> dependency to archprepare.
>> 
>> Signed-off-by: Jeff Mahoney  --- Makefile |2
>> +- 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> --- a/Makefile +++ b/Makefile @@ -835,7 +835,7 @@ prepare1:
>> prepare2 include/linux/version include/config/auto.conf 
>> $(cmd_crmodverdir)
>> 
>> -archprepare: archheaders archscripts prepare1 scripts_basic 
>> +archprepare: archheaders scripts_basic archscripts prepare1
>> 
>> prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=.
>> 
> 
> 


- -- 
Jeff Mahoney
SUSE Labs
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQWycqAAoJEB57S2MheeWyrOcP/1zkI9gwRCwjGhzd78177JHZ
6YFAkg3bTfQjCKrb1uU414wlFyRS+yHV2TlSDk4UTFfXMM7Y1FKmhGVF2ZJF2EBs
FNOXnRFwh4zhcztXtrSNqs1omhAEfS9FBGlwOmSdSg+mMSK6cAoK2krQuEsrTYUR
9uTeJfvfOJJgTHw5+jM6HH17swF2MkhwS/C5cBt3qGc4keE/+YL7Ub8DRIcrwMN3
1ux87W7Y2e1PaPcxDufZnryMkOSq8IOmRB1ErdJ1fCRcoE3RG5esrrbULURscA3b
OS5+mhJZj8Q5GlFYm1zrKNVxN973nsdw80d6QSGLU6oMtDEF7Hei4fg+KPzgFHNy
Q+Cqt/il1onehS/aMxcjU9OdOPObMau5OVzDv3n+EYnR1wUW7nRevtUt4eVsYG4Z
qEy50tHuv8AO+sfB3nVC268sHOteUwqDDWKJC/vRMnJ4tKHi/vNJinweXzb1G+lp
O/Q2em0zBqmSnBsnlxhk+Ga4riBkcBsHtBiPFZ7NFpXrSXj93ASAURnlRFvpFa/u
mGz/izuFx9s1FFWAfjLMC+LtlMndr4p0DYa2tODt72+HibVA435JMsKSQL8s8fji
HdBJux8MOJzjBqic6y3lHyJKwpjXBB6zNqxr0WNocvwJiS5mEBERpDc4JQp+DCI6
EJV+7rUH8MDw5w69+e2f
=rC/d
-END PGP SIGNATURE-
--
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[ Makefile: Fix scripts_basic / archscripts build order

2012-09-19 Thread H. Peter Anvin
Kbuild people, any comments?

On 09/19/2012 10:38 AM, Jeff Mahoney wrote:
> The SUSE kernel packages are built by doing the following:
> 
> make silentoldonfig
> make prepare
> make scripts
> make clean
> 
> 
> 
> make -j$NCPUs
> 
> On parallel builds (also using -C/O=), this can occasionally fail with:
>   HOSTCC  scripts/basic/fixdep
>   /bin/sh: scripts/basic/fixdep: No such file or directory
>   make[3]: *** [arch/x86/tools/relocs] Error 1
>   make[2]: *** [archscripts] Error 2
>   make[2]: *** Waiting for unfinished jobs
>   make[1]: *** [sub-make] Error 2
>   make: *** [all] Error 2
> 
> The error can also be "Permission denied."
> 
> Without the make clean this works ok.
> 
> What seems to be happening is that fixdep exists so relocs is able to be
> rebuilt, but then somewhere there is a FORCE rule that applies to fixdep
> so it is rebuilt. If the timing is right, the relocs build can happen while
> the fixdep rebuild is happening and we either get a non-executable fixdep
> or a nonexistent fixdep.
> 
> This patch moves the archscripts dependency after scripts_basic so that
> fixdep is always built after relocs. If I understand the build order
> correctly, this should be the case since scripts_basic is essentially
> a prereq of everything.
> 
> This was introduced by commit
> 6520fe55 (x86, realmode: 16-bit real-mode code support for relocs),
> which added the archscripts dependency to archprepare.
> 
> Signed-off-by: Jeff Mahoney 
> ---
>  Makefile |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/Makefile
> +++ b/Makefile
> @@ -835,7 +835,7 @@ prepare1: prepare2 include/linux/version
> include/config/auto.conf
>   $(cmd_crmodverdir)
>  
> -archprepare: archheaders archscripts prepare1 scripts_basic
> +archprepare: archheaders scripts_basic archscripts prepare1
>  
>  prepare0: archprepare FORCE
>   $(Q)$(MAKE) $(build)=.
> 


--
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[ Makefile: Fix scripts_basic / archscripts build order

2012-09-19 Thread Jeff Mahoney
The SUSE kernel packages are built by doing the following:

make silentoldonfig
make prepare
make scripts
make clean



make -j$NCPUs

On parallel builds (also using -C/O=), this can occasionally fail with:
  HOSTCC  scripts/basic/fixdep
  /bin/sh: scripts/basic/fixdep: No such file or directory
  make[3]: *** [arch/x86/tools/relocs] Error 1
  make[2]: *** [archscripts] Error 2
  make[2]: *** Waiting for unfinished jobs
  make[1]: *** [sub-make] Error 2
  make: *** [all] Error 2

The error can also be "Permission denied."

Without the make clean this works ok.

What seems to be happening is that fixdep exists so relocs is able to be
rebuilt, but then somewhere there is a FORCE rule that applies to fixdep
so it is rebuilt. If the timing is right, the relocs build can happen while
the fixdep rebuild is happening and we either get a non-executable fixdep
or a nonexistent fixdep.

This patch moves the archscripts dependency after scripts_basic so that
fixdep is always built after relocs. If I understand the build order
correctly, this should be the case since scripts_basic is essentially
a prereq of everything.

This was introduced by commit
6520fe55 (x86, realmode: 16-bit real-mode code support for relocs),
which added the archscripts dependency to archprepare.

Signed-off-by: Jeff Mahoney 
---
 Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Makefile
+++ b/Makefile
@@ -835,7 +835,7 @@ prepare1: prepare2 include/linux/version
include/config/auto.conf
$(cmd_crmodverdir)
 
-archprepare: archheaders archscripts prepare1 scripts_basic
+archprepare: archheaders scripts_basic archscripts prepare1
 
 prepare0: archprepare FORCE
$(Q)$(MAKE) $(build)=.

-- 
Jeff Mahoney
SUSE Labs
--
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: [Git Patch] Makefile: fix wrong dirs when making cscope

2007-11-04 Thread WANG Cong
On Mon, Nov 05, 2007 at 08:33:17AM +0100, Sam Ravnborg wrote:
>Hi Wang.
>
>Thanks for this fix, but I have a few comments. See below.
>
>On Mon, Nov 05, 2007 at 03:09:53PM +0800, WANG Cong wrote:
>> 
>> Hi, Sam!
>> 
>> This patch fixed the following errors when doing "make cscope" and
>> "make cscope ARCH=um".
>> 
>>   FILELST cscope.files
>> find: arch/i386: No such file or directory
>>   MAKEcscope.out
>> 
>> 
>>   FILELST cscope.files
>> find: include/asm-i386: No such file or directory
>>   MAKEcscope.out
>> 
>> 
>> Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
>> Cc: Sam Ravnborg <[EMAIL PROTECTED]>
>> 
>> ---
>>  Makefile |4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> Index: linux-2.6/Makefile
>> ===
>> --- linux-2.6.orig/Makefile
>> +++ linux-2.6/Makefile
>> @@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
>>  endif
>>  
>>  define find-sources
>> -( for arch in $(ALLSOURCE_ARCHS) ; do \
>> +( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
>> find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
>>  -name $1 -print; \
>>done ; \
>
>Could you change this such that the substitution takes places where we
>assign ALLSOURCE_ARCHS so all potential users benefit from this fix.
>And on top of this fix it so x86_64 is also replaced by x86 so we fix
>both x86 architectures.

OK. Thank you. I will try to do that. ;)

>
>
>> @@ -1331,7 +1331,7 @@ define find-sources
>>find $(__srctree)include $(RCS_FIND_IGNORE) \
>> \( -name config -o -name 'asm-*' \) -prune \
>> -o -name $1 -print; \
>> -  for arch in $(ALLINCLUDE_ARCHS) ; do \
>> +  for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
>> find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
>>  -name $1 -print; \
>>done ; \
>> 
>Same comments for ALLINCLUDE_ARCHS
>
>PS. Yout patch may be obsoleted by ongoing work to eliminate
>ARCH=i386 / ARCH=x86_64. But if/when this hits mainline I dunno so
>please do the requested changes and send me a new patch.

Sam, the root of this problem is the use of `uname -m' command. It always
outputs 'i*86' on x86_32 machines. Unless this output changes or we find another
way to determine the arch, we will always need to fix this.

New patch will come soon.

Thanks.

WANG Cong

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Git Patch] Makefile: fix wrong dirs when making cscope

2007-11-04 Thread Sam Ravnborg
Hi Wang.

Thanks for this fix, but I have a few comments. See below.

On Mon, Nov 05, 2007 at 03:09:53PM +0800, WANG Cong wrote:
> 
> Hi, Sam!
> 
> This patch fixed the following errors when doing "make cscope" and
> "make cscope ARCH=um".
> 
>   FILELST cscope.files
> find: arch/i386: No such file or directory
>   MAKEcscope.out
> 
> 
>   FILELST cscope.files
> find: include/asm-i386: No such file or directory
>   MAKEcscope.out
> 
> 
> Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
> Cc: Sam Ravnborg <[EMAIL PROTECTED]>
> 
> ---
>  Makefile |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6/Makefile
> ===
> --- linux-2.6.orig/Makefile
> +++ linux-2.6/Makefile
> @@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
>  endif
>  
>  define find-sources
> -( for arch in $(ALLSOURCE_ARCHS) ; do \
> +( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
>  find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
>   -name $1 -print; \
> done ; \

Could you change this such that the substitution takes places where we
assign ALLSOURCE_ARCHS so all potential users benefit from this fix.
And on top of this fix it so x86_64 is also replaced by x86 so we fix
both x86 architectures.


> @@ -1331,7 +1331,7 @@ define find-sources
> find $(__srctree)include $(RCS_FIND_IGNORE) \
>  \( -name config -o -name 'asm-*' \) -prune \
>  -o -name $1 -print; \
> -   for arch in $(ALLINCLUDE_ARCHS) ; do \
> +   for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
>  find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
>   -name $1 -print; \
> done ; \
> 
Same comments for ALLINCLUDE_ARCHS

PS. Yout patch may be obsoleted by ongoing work to eliminate
ARCH=i386 / ARCH=x86_64. But if/when this hits mainline I dunno so
please do the requested changes and send me a new patch.

Tanks,
Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[Git Patch] Makefile: fix wrong dirs when making cscope

2007-11-04 Thread WANG Cong

Hi, Sam!

This patch fixed the following errors when doing "make cscope" and
"make cscope ARCH=um".

  FILELST cscope.files
find: arch/i386: No such file or directory
  MAKEcscope.out


  FILELST cscope.files
find: include/asm-i386: No such file or directory
  MAKEcscope.out


Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>

---
 Makefile |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/Makefile
===
--- linux-2.6.orig/Makefile
+++ linux-2.6/Makefile
@@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
 endif
 
 define find-sources
-( for arch in $(ALLSOURCE_ARCHS) ; do \
+( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
   find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
-name $1 -print; \
  done ; \
@@ -1331,7 +1331,7 @@ define find-sources
  find $(__srctree)include $(RCS_FIND_IGNORE) \
   \( -name config -o -name 'asm-*' \) -prune \
   -o -name $1 -print; \
- for arch in $(ALLINCLUDE_ARCHS) ; do \
+ for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
   find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
-name $1 -print; \
  done ; \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] Makefile: fix spaces instead of tab

2005-04-05 Thread Sam Ravnborg
On Tue, Apr 05, 2005 at 02:21:57PM +0200, Adrian Bunk wrote:
> GNU Emacs correctly complains because of spaces instead of a tab.
> 
> Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
> 
> --- linux-2.6.12-rc2-mm1-full/Makefile.old2005-04-05 14:00:06.0 
> +0200
> +++ linux-2.6.12-rc2-mm1-full/Makefile2005-04-05 14:00:16.0 
> +0200
> @@ -577,7 +577,7 @@
>  
>  ifdef CONFIG_LOCALVERSION_AUTO
>   localversion-auto := \
> - $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
> + $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
>   LOCALVERSION := $(LOCALVERSION)$(localversion-auto)
>  endif

In this case it makes sense - thanks.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[-mm patch] Makefile: fix spaces instead of tab

2005-04-05 Thread Adrian Bunk
On Tue, Apr 05, 2005 at 12:05:24AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.12-rc1-mm4:
>...
>  bk-kbuild.patch
>...


GNU Emacs correctly complains because of spaces instead of a tab.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

--- linux-2.6.12-rc2-mm1-full/Makefile.old  2005-04-05 14:00:06.0 
+0200
+++ linux-2.6.12-rc2-mm1-full/Makefile  2005-04-05 14:00:16.0 +0200
@@ -577,7 +577,7 @@
 
 ifdef CONFIG_LOCALVERSION_AUTO
localversion-auto := \
-   $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
+   $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
LOCALVERSION := $(LOCALVERSION)$(localversion-auto)
 endif
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Makefile fix for FORE 200e and a typo in lec.c

2001-01-02 Thread Jan Rekorajski

Hi,
The Fore dirver in 2.4.0-prerelease just does not build
with the current makefile. This patch fixes it (works for me):

--- linux/drivers/atm/Makefile.orig Tue Jan  2 10:18:25 2001
+++ linux/drivers/atm/Makefile  Tue Jan  2 12:00:05 2001
@@ -46,7 +46,7 @@
   endif
 endif
 
-obj-$(CONFIG_ATM_FORE200E) += fore200e.o $(FORE200E_FW_OBJS)
+obj-$(CONFIG_ATM_FORE200E) += fore_200e.o
 
 include $(TOPDIR)/Rules.make


Second thing, there is a typo in net/atm/lec.c:

--- linux/net/atm/lec.c.origSat Dec 30 20:19:13 2000
+++ linux/net/atm/lec.c Tue Jan  2 12:06:34 2001
@@ -857,7 +857,7 @@
 for (i = 0; i < MAX_LEC_ITF; i++) {
 if (dev_lec[i] != NULL) {
 priv = (struct lec_priv *)dev_lec[i]->priv;
-unregister_trdev(dev_lec[i]);
+unregister_netdev(dev_lec[i]);
 kfree(dev_lec[i]);
 dev_lec[i] = NULL;
 }

And, just in case you missed it, modular LEC fix:

--- linux/net/atm/Makefile.orig Sun Dec 31 17:57:15 2000
+++ linux/net/atm/Makefile  Sun Dec 31 19:04:49 2000
@@ -33,7 +33,13 @@
 obj-y += proc.o
 endif
 
-obj-$(CONFIG_ATM_LANE) += lec.o lane_mpoa_init.o
+ifneq ($(CONFIG_ATM_LANE),n)
+ifneq ($(CONFIG_ATM_LANE),)
+obj-y += lane_mpoa_init.o
+endif
+endif
+
+obj-$(CONFIG_ATM_LANE) += lec.o
 obj-$(CONFIG_ATM_MPOA) += mpoa.o
 
 include $(TOPDIR)/Rules.make

Jan
-- 
Jan Rękorajski|  ALL SUSPECTS ARE GUILTY. PERIOD!
bagginsmimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, MANIAC  |   -- TROOPS by Kevin Rubio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[PATCH] Makefile fix for ieee1394

2001-01-01 Thread Andreas Bombe

Now that I've had the time to understand the new kernel makefile
structure the patch Kai Germaschewski posted is indeed the correct fix
(move include line up).  Furthermore it builds an .o object in the
static compiled case now.  I don't see any reason to choose the .a
format and most other drivers also do .o.

-- 
 Andreas E. Bombe <[EMAIL PROTECTED]>DSA key 0x04880A44
http://home.pages.de/~andreas.bombe/http://linux1394.sourceforge.net/


diff -ruN linux-2.4.orig/Makefile linux-2.4/Makefile
--- linux-2.4.orig/Makefile Tue Jan  2 03:38:50 2001
+++ linux-2.4/Makefile  Tue Jan  2 05:12:36 2001
@@ -145,7 +145,7 @@
 DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
 DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
 DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
-DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394.a
+DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
 
 ifneq 
($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
 DRIVERS-y += drivers/cdrom/driver.o
diff -ruN linux-2.4.orig/drivers/ieee1394/Makefile linux-2.4/drivers/ieee1394/Makefile
--- linux-2.4.orig/drivers/ieee1394/MakefileTue Jan  2 03:38:59 2001
+++ linux-2.4/drivers/ieee1394/Makefile Tue Jan  2 05:12:38 2001
@@ -8,7 +8,7 @@
 # Note 2! The CFLAGS definitions are now in the main makefile.
 #
 
-L_TARGET := ieee1394.a
+O_TARGET = ieee1394drv.o
 
 export-objs := ieee1394_syms.o
 
@@ -23,7 +23,7 @@
 obj-$(CONFIG_IEEE1394_VIDEO1394) += video1394.o
 obj-$(CONFIG_IEEE1394_RAWIO) += raw1394.o
 
+include $(TOPDIR)/Rules.make
+
 ieee1394.o: $(ieee1394-objs)
$(LD) -r -o $@ $(ieee1394-objs)
-
-include $(TOPDIR)/Rules.make
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[PATCH] Makefile fix

2000-12-14 Thread Brian Gerst

This patch should be obviously correct.

diff -urN linux-2.4.0t13p1/arch/i386/Makefile linux/arch/i386/Makefile
--- linux-2.4.0t13p1/arch/i386/Makefile Thu Dec 14 20:54:41 2000
+++ linux/arch/i386/MakefileThu Dec 14 21:04:34 2000
@@ -91,7 +91,7 @@
 
 ifdef CONFIG_MATH_EMULATION
 SUBDIRS += arch/i386/math-emu
-SUBDIRS += arch/i386/math-emu/math.o
+DRIVERS += arch/i386/math-emu/math.o
 endif
 
 arch/i386/kernel: dummy
-- 

Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/