All of lore.kernel.org
 help / color / mirror / Atom feed
* make menuconfig and make j$(nproc) throwing errors
@ 2022-02-24  3:58 Aruna Hewapathirane
  2022-02-24  6:46 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Aruna Hewapathirane @ 2022-02-24  3:58 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I am trying to compile the 5.16.10 kernel and make menuconfig throws
this error below:

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make menuconfig
  HOSTLD  scripts/kconfig/mconf
/usr/bin/ld: scripts/kconfig/confdata.o: relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIE
/usr/bin/ld: scripts/kconfig/expr.o: relocation R_X86_64_32S against
`.rodata' can not be used when making a PIE object; recompile with
-fPIE
/usr/bin/ld: scripts/kconfig/lexer.lex.o: relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIE
/usr/bin/ld: scripts/kconfig/menu.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile
with -fPIE
/usr/bin/ld: scripts/kconfig/parser.tab.o: relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIE
/usr/bin/ld: scripts/kconfig/preprocess.o: relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIE
/usr/bin/ld: scripts/kconfig/symbol.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile
with -fPIE
/usr/bin/ld: scripts/kconfig/util.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile
with -fPIE
/usr/bin/ld: scripts/kconfig/util.o: warning: relocation against
`free@@GLIBC_2.2.5' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/Makefile.host:104: scripts/kconfig/mconf] Error 1
make: *** [Makefile:619: menuconfig] Error 2

And I tried to build without make menuconfig and make is telling me I
need 'bison' ? Why do I need bison ? Since when
did we need bison ? See below for details.

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -j$(nproc)
  DESCEND objtool
  HOSTCC  scripts/asn1_compiler
  YACC    scripts/genksyms/parse.tab.[ch]
/bin/sh: 1: bison: not found
make[2]: *** [scripts/genksyms/Makefile:21:
scripts/genksyms/parse.tab.c] Error 127
make[1]: *** [scripts/Makefile.build:549: scripts/genksyms] Error 2
make[1]: *** Waiting for unfinished jobs....
<stdin>:1:10: fatal error: libelf.h: No such file or directory
compilation terminated.
  CC      /media/aruna/linux-next/home/linux-5.16.10/tools/objtool/arch/x86/special.o
  CC      /media/aruna/linux-next/home/linux-5.16.10/tools/objtool/weak.o
  CC      /media/aruna/linux-next/home/linux-5.16.10/tools/objtool/check.o
In file included from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/objtool.h:13,
                 from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/arch.h:11,
                 from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/check.h:11,
                 from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/special.h:10,
                 from arch/x86/special.c:4:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/elf.h:10:10:
fatal error: gelf.h: No such file or directory
   10 | #include <gelf.h>
      |          ^~~~~~~~
compilation terminated.
make[4]: *** [/media/aruna/linux-next/home/linux-5.16.10/tools/build/Makefile.build:97:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/arch/x86/special.o]
Error 1
make[3]: *** [/media/aruna/linux-next/home/linux-5.16.10/tools/build/Makefile.build:139:
arch/x86] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/objtool.h:13,
                 from weak.c:10:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/elf.h:10:10:
fatal error: gelf.h: No such file or directory
   10 | #include <gelf.h>
      |          ^~~~~~~~
compilation terminated.
make[3]: *** [/media/aruna/linux-next/home/linux-5.16.10/tools/build/Makefile.build:97:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/weak.o] Error
1
In file included from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/objtool.h:13,
                 from
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/arch.h:11,
                 from check.c:13:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/include/objtool/elf.h:10:10:
fatal error: gelf.h: No such file or directory
   10 | #include <gelf.h>
      |          ^~~~~~~~
compilation terminated.
make[3]: *** [/media/aruna/linux-next/home/linux-5.16.10/tools/build/Makefile.build:97:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/check.o]
Error 1
make[2]: *** [Makefile:56:
/media/aruna/linux-next/home/linux-5.16.10/tools/objtool/objtool-in.o]
Error 2
make[1]: *** [Makefile:69: objtool] Error 2
make: *** [Makefile:1349: tools/objtool] Error 2
make: *** Waiting for unfinished jobs....
make: *** [Makefile:1181: scripts] Error 2

HELP!

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2
--prefix=/usr --with-gcc-major-version-only --program-suffix=-10
--program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie
--with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa
--without-cuda-driver --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean
--enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make menuconfig and make j$(nproc) throwing errors
  2022-02-24  3:58 make menuconfig and make j$(nproc) throwing errors Aruna Hewapathirane
@ 2022-02-24  6:46 ` Greg KH
  2022-02-24 10:40   ` Aruna Hewapathirane
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-02-24  6:46 UTC (permalink / raw)
  To: Aruna Hewapathirane; +Cc: kernelnewbies

On Wed, Feb 23, 2022 at 10:58:45PM -0500, Aruna Hewapathirane wrote:
> And I tried to build without make menuconfig and make is telling me I
> need 'bison' ? Why do I need bison ? Since when
> did we need bison ? See below for details.
> 
> aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -j$(nproc)
>   DESCEND objtool
>   HOSTCC  scripts/asn1_compiler
>   YACC    scripts/genksyms/parse.tab.[ch]
> /bin/sh: 1: bison: not found

You need bison to build the kernel, sorry, please install it.

> make[2]: *** [scripts/genksyms/Makefile:21:
> scripts/genksyms/parse.tab.c] Error 127
> make[1]: *** [scripts/Makefile.build:549: scripts/genksyms] Error 2
> make[1]: *** Waiting for unfinished jobs....
> <stdin>:1:10: fatal error: libelf.h: No such file or directory

You also need libelf.

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make menuconfig and make j$(nproc) throwing errors
  2022-02-24  6:46 ` Greg KH
@ 2022-02-24 10:40   ` Aruna Hewapathirane
  2022-02-24 11:37     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Aruna Hewapathirane @ 2022-02-24 10:40 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 2292 bytes --]

On Thu, Feb 24, 2022 at 1:46 AM Greg KH <greg@kroah.com> wrote:
>
> On Wed, Feb 23, 2022 at 10:58:45PM -0500, Aruna Hewapathirane wrote:
> > And I tried to build without make menuconfig and make is telling me I
> > need 'bison' ? Why do I need bison ? Since when
> > did we need bison ? See below for details.
> >
> > aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -j$(nproc)
> >   DESCEND objtool
> >   HOSTCC  scripts/asn1_compiler
> >   YACC    scripts/genksyms/parse.tab.[ch]
> > /bin/sh: 1: bison: not found
>
> You need bison to build the kernel, sorry, please install it.
Oh my, you actually went through that mess ? I will do so thank you.
>
> > make[2]: *** [scripts/genksyms/Makefile:21:
> > scripts/genksyms/parse.tab.c] Error 127
> > make[1]: *** [scripts/Makefile.build:549: scripts/genksyms] Error 2
> > make[1]: *** Waiting for unfinished jobs....
> > <stdin>:1:10: fatal error: libelf.h: No such file or directory
>
> You also need libelf.
I will install libelf-dev as well thanks.

Greg, now make complains it requires 'flex' ?

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -j$(nproc)
  DESCEND objtool
  HOSTCC  scripts/genksyms/parse.tab.o
  LEX     scripts/genksyms/lex.lex.c
/bin/sh: 1: flex: not found
make[2]: *** [scripts/Makefile.host:9: scripts/genksyms/lex.lex.c] Error 127
make[2]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/extract-cert
make[1]: *** [scripts/Makefile.build:549: scripts/genksyms] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1181: scripts] Error 2

In the early days we used to sudo apt-get install build-essential and be
done with it.
I guess a lot has changed since then. Maybe someone should update the 'what
tools
do I need' section in https://kernelnewbies.org/KernelBuild ?

Does anyone have a fix for make menuconfig error below please ?
aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make menuconfig
  HOSTLD  scripts/kconfig/mconf
/usr/bin/ld: scripts/kconfig/confdata.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile with
-fPIE

At some point am going to need menuconfig to work again so anyone else ever
had this problem ? If you did 'how' did you resolve ?

Thanks - Aruna

>
> thanks,
>
> greg k-h

[-- Attachment #1.2: Type: text/html, Size: 2960 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make menuconfig and make j$(nproc) throwing errors
  2022-02-24 10:40   ` Aruna Hewapathirane
@ 2022-02-24 11:37     ` Greg KH
  2022-02-24 12:02       ` Aruna Hewapathirane
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-02-24 11:37 UTC (permalink / raw)
  To: Aruna Hewapathirane; +Cc: kernelnewbies

On Thu, Feb 24, 2022 at 05:40:33AM -0500, Aruna Hewapathirane wrote:
> On Thu, Feb 24, 2022 at 1:46 AM Greg KH <greg@kroah.com> wrote:
> >
> > On Wed, Feb 23, 2022 at 10:58:45PM -0500, Aruna Hewapathirane wrote:
> > > And I tried to build without make menuconfig and make is telling me I
> > > need 'bison' ? Why do I need bison ? Since when
> > > did we need bison ? See below for details.
> > >
> > > aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ make -j$(nproc)
> > >   DESCEND objtool
> > >   HOSTCC  scripts/asn1_compiler
> > >   YACC    scripts/genksyms/parse.tab.[ch]
> > > /bin/sh: 1: bison: not found
> >
> > You need bison to build the kernel, sorry, please install it.
> Oh my, you actually went through that mess ? I will do so thank you.
> >
> > > make[2]: *** [scripts/genksyms/Makefile:21:
> > > scripts/genksyms/parse.tab.c] Error 127
> > > make[1]: *** [scripts/Makefile.build:549: scripts/genksyms] Error 2
> > > make[1]: *** Waiting for unfinished jobs....
> > > <stdin>:1:10: fatal error: libelf.h: No such file or directory
> >
> > You also need libelf.
> I will install libelf-dev as well thanks.
> 
> Greg, now make complains it requires 'flex' ?

Yes, please install that.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make menuconfig and make j$(nproc) throwing errors
  2022-02-24 11:37     ` Greg KH
@ 2022-02-24 12:02       ` Aruna Hewapathirane
  2022-02-24 13:28         ` Constantine Shulyupin
  0 siblings, 1 reply; 6+ messages in thread
From: Aruna Hewapathirane @ 2022-02-24 12:02 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 746 bytes --]

<snip>

> > Greg, now make complains it requires 'flex' ?
>
> Yes, please install that.


Done and first compile went smooth took slightly over 40 minutes and below
is the second run...

aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ time make
-j$(nproc)
  DESCEND objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready  (#1)

real 0m20.783s     [ pre-compiled kernel ]
user 0m54.987s
sys 0m12.117s

Now I have to install and start praying :-)

For anyone who may  be interested I had to install these to get things
going:
build-essential
libncurses-dev
libssl-dev
bison
libelf-dev
flex
bc

Make menuconfig still needs a fix :-(

[-- Attachment #1.2: Type: text/html, Size: 1199 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make menuconfig and make j$(nproc) throwing errors
  2022-02-24 12:02       ` Aruna Hewapathirane
@ 2022-02-24 13:28         ` Constantine Shulyupin
  0 siblings, 0 replies; 6+ messages in thread
From: Constantine Shulyupin @ 2022-02-24 13:28 UTC (permalink / raw)
  To: Aruna Hewapathirane; +Cc: Greg KH, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1205 bytes --]

You are welcome to use and update manual:
https://en.wikibooks.org/wiki/The_Linux_Kernel/Updating

On Thu, 24 Feb 2022 at 14:03, Aruna Hewapathirane <
aruna.hewapathirane@gmail.com> wrote:

> <snip>
>
>> > Greg, now make complains it requires 'flex' ?
>>
>> Yes, please install that.
>
>
> Done and first compile went smooth took slightly over 40 minutes and below
> is the second run...
>
> aruna@debian:/media/aruna/linux-next/home/linux-5.16.10$ time make
> -j$(nproc)
>   DESCEND objtool
>   CALL    scripts/atomic/check-atomics.sh
>   CALL    scripts/checksyscalls.sh
>   CHK     include/generated/compile.h
> Kernel: arch/x86/boot/bzImage is ready  (#1)
>
> real 0m20.783s     [ pre-compiled kernel ]
> user 0m54.987s
> sys 0m12.117s
>
> Now I have to install and start praying :-)
>
> For anyone who may  be interested I had to install these to get things
> going:
> build-essential
> libncurses-dev
> libssl-dev
> bison
> libelf-dev
> flex
> bc
>
> Make menuconfig still needs a fix :-(
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


-- 
Constantine Shulyupin

[-- Attachment #1.2: Type: text/html, Size: 2239 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-24 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  3:58 make menuconfig and make j$(nproc) throwing errors Aruna Hewapathirane
2022-02-24  6:46 ` Greg KH
2022-02-24 10:40   ` Aruna Hewapathirane
2022-02-24 11:37     ` Greg KH
2022-02-24 12:02       ` Aruna Hewapathirane
2022-02-24 13:28         ` Constantine Shulyupin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.