elfutils - 0.186 compilation error on RISC-V Linux

22 views
Skip to first unread message

Billa Surendra

unread,
Apr 6, 2022, 3:02:38 AM4/6/22
to RISC-V SW Dev
Hi All,

I am struggling for installing the elfutils-0.186 package in my RISC-V Linux distribution image. I am getting a strange error. I have looked into a config.log file, compilation process stopped because of these errors.

configure:5022: gcc -o conftest -g -O2   conftest.c   >&5                      
/tmp/cc1mRxPa.o: In function `yylex':                                          
/home/package_building/elfutils-0.186/lex.yy.c:864: undefined reference to `yyw
/tmp/cc1mRxPa.o: In function `yylex':                                          
/home/package_building/elfutils-0.186/conftest.l:3: undefined reference to `yyw
/tmp/cc1mRxPa.o: In function `main':                                          
/home/package_building/elfutils-0.186/conftest.l:17: undefined reference to `yy
collect2: error: ld returned 1 exit status

Here I am attaching config.log file. If anyone has any idea why I am getting the error, please help me out.

Thanks
Billa
config.log

Jim Wilson

unread,
Apr 6, 2022, 12:24:55 PM4/6/22
to Billa Surendra, RISC-V SW Dev
On Wed, Apr 6, 2022 at 12:02 AM Billa Surendra <billa.i...@gmail.com> wrote:
configure:5022: gcc -o conftest -g -O2   conftest.c   >&5                      
/tmp/cc1mRxPa.o: In function `yylex':                                          
/home/package_building/elfutils-0.186/lex.yy.c:864: undefined reference to `yyw

This isn't an error.  I don't see any configure error.  Different UNIX systems have different ways of doing things.  Different versions of tools have different ways of doing things.  So configure tries every possible method that might work to figure out which one does work.  In this case, it tried a method of linking lex output that didn't work.  It then immediately tried a different method that did work, and then recorded info on the method that did work so it could create a working makefile.  All intentional and normal.

If you are getting build errors, then you need to report that.

elfutils was only recently ported to RISC-V.  Maybe last year, or maybe 2 years ago.  You need to make sure you use a new enough version or you won't be able to build it for RISC-V.

Jim

Billa Surendra

unread,
Apr 7, 2022, 1:36:44 AM4/7/22
to Jim Wilson, RISC-V SW Dev
I am getting an error when I am trying to execute make -j8 command. I am using the latest version of elfutils package.

Error:

  CC       libdw_find_split_unit.os
  CC       dwarf_cu_info.os
  CC       dwarf_next_lines.os
  AR       libdw_pic.a
  CCLD     libdw.so
ld[18213]: unhandled signal 11 code 0x1 at 0x0000000000000088 in ld[10000+14b000]
CPU: 3 PID: 18213 Comm: ld Not tainted 5.4.1 #1
sepc: 000000000005333c ra : 0000000000054290 sp : 0000003fffb06730
 gp : 000000000015e4d0 tp : 0000003fdd097710 t0 : 0000000000097180
 t1 : 00000000000003fc t2 : 0000000000000000 s0 : 0000000000162de0
 s1 : 0000000000000000 a0 : 0000000000186f40 a1 : 0000000000000000
 a2 : 00000000014a49c0 a3 : 0000000000020ed8 a4 : 0000000000000003
 a5 : 0000000000149b18 a6 : 80012b0000000000 a7 : 0000000000000003
 s2 : 00000000014a35c0 s3 : 000000000148e460 s4 : 0000000001f0f020
 s5 : 00000000001892d0 s6 : 0000003fffb067e8 s7 : 0000000000000000
 s8 : 00000000014a7280 s9 : 00000000014a49c0 s10: 00000000014aa20a
 s11: 0000000000000000 t3 : 00000000000000ff t4 : 0000000000000000
 t5 : 0000000000000001 t6 : 0000000000097830
sstatus: 0000000000004020 sbadaddr: 0000000000000088 scause: 000000000000000d
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(bzlib.o): relocation R_RISCV_HI20 against `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(compress.o): relocation R_RISCV_HI20 against `stderr@@GLIBC_2.27' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(decompress.o): relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o): relocation R_RISCV_HI20 against `stderr@@GLIBC_2.27' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x58): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x5c): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x70): unresolvable R_RISCV_CALL relocation against symbol `fwrite@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x7dc): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x7e0): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x7f0): unresolvable R_RISCV_CALL relocation against symbol `fprintf@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x8e0): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x8e4): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0x8f4): unresolvable R_RISCV_CALL relocation against symbol `fprintf@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xaa4): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xaa8): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xabc): unresolvable R_RISCV_CALL relocation against symbol `fwrite@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xb78): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xb80): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xb94): unresolvable R_RISCV_CALL relocation against symbol `fwrite@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xd48): unresolvable R_RISCV_HI20 relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(blocksort.o)(.text+0xd4c): unresolvable R_RISCV_LO12_I relocation against symbol `stderr@@GLIBC_2.27'
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(bzlib.o)(.text+0x30d0): unresolvable R_RISCV_LO12_I relocation against symbol `stdout@@GLIBC_2.27'
make[3]: *** [Makefile:1435: libdw.so] Error 1
make[2]: *** [Makefile:675: all] Error 2
make[1]: *** [Makefile:532: all-recursive] Error 1
make: *** [Makefile:448: all] Error 2

Tommy Murphy

unread,
Apr 7, 2022, 9:14:57 AM4/7/22
to Billa Surendra, Jim Wilson, RISC-V SW Dev
If you do a clean build without -j8 parallelism does it behave any different?

John Leidel

unread,
Apr 7, 2022, 9:21:54 AM4/7/22
to Tommy Murphy, Billa Surendra, Jim Wilson, RISC-V SW Dev
I would suggest cleaning up some of the error messages that are
displayed. This may induce different behavior:

`...can not be used when making a shared object; recompile with -fPIC`

On Thu, Apr 7, 2022 at 8:14 AM Tommy Murphy <tommy_...@hotmail.com> wrote:
>
> If you do a clean build without -j8 parallelism does it behave any different?
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/LO2P265MB47760E20B651984116AF2247F9E69%40LO2P265MB4776.GBRP265.PROD.OUTLOOK.COM.

Billa Surendra

unread,
Apr 7, 2022, 9:38:14 AM4/7/22
to John Leidel, Tommy Murphy, Jim Wilson, RISC-V SW Dev
On Thu, 7 Apr, 2022, 6:51 pm John Leidel, <john....@gmail.com> wrote:
I would suggest cleaning up some of the error messages that are
displayed.  This may induce different behavior:

`...can not be used when making a shared object; recompile with -fPIC`

How to do that ?

Jim Wilson

unread,
Apr 7, 2022, 10:58:56 AM4/7/22
to Billa Surendra, RISC-V SW Dev
On Wed, Apr 6, 2022 at 10:36 PM Billa Surendra <billa.i...@gmail.com> wrote:
ld[18213]: unhandled signal 11 code 0x1 at 0x0000000000000088 in ld[10000+14b000]

This is a linker problem.  You might need a newer linker version.  But cleaning up some of the other errors might help.
 
/usr/lib/gcc/riscv64-unknown-linux-gnu/7.3.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/libbz2.a(bzlib.o): relocation R_RISCV_HI20 against `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC

You need to build a libbz2.so, which means rebuilding that package with shared library support enabled.

Jim
 

Billa Surendra

unread,
Apr 8, 2022, 1:49:32 AM4/8/22
to John Leidel, Tommy Murphy, Jim Wilson, RISC-V SW Dev
On Thu, Apr 7, 2022 at 6:51 PM John Leidel <john....@gmail.com> wrote:
I would suggest cleaning up some of the error messages that are
displayed.  This may induce different behavior:

`...can not be used when making a shared object; recompile with -fPIC`

recompiling with -fPIC also not working.

Billa Surendra

unread,
Apr 8, 2022, 1:54:23 AM4/8/22
to Tommy Murphy, Jim Wilson, RISC-V SW Dev
On Thu, Apr 7, 2022 at 6:45 PM Tommy Murphy <tommy_...@hotmail.com> wrote:
If you do a clean build without -j8 parallelism does it behave any different?

Tried $ make clean and after that $ make but still I am getting the same error.

Khem Raj

unread,
Apr 8, 2022, 2:01:41 AM4/8/22
to Billa Surendra, Jim Wilson, RISC-V SW Dev, Tommy Murphy
You have a linker crash for some one to help it would be good to build a standalone test case so it can be reproduced by someone else most probably it is already fixed in latest release of binutils 

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

Billa Surendra

unread,
Apr 8, 2022, 5:28:33 AM4/8/22
to Khem Raj, Jim Wilson, RISC-V SW Dev, Tommy Murphy
On Fri, Apr 8, 2022 at 11:31 AM Khem Raj <raj....@gmail.com> wrote:


On Thu, Apr 7, 2022 at 10:54 PM Billa Surendra <billa.i...@gmail.com> wrote:


On Thu, Apr 7, 2022 at 6:45 PM Tommy Murphy <tommy_...@hotmail.com> wrote:
If you do a clean build without -j8 parallelism does it behave any different?

Tried $ make clean and after that $ make but still I am getting the same error.

You have a linker crash for some one to help it would be good to build a standalone test case so it can be reproduced by someone else most probably it is already fixed in latest release of binutils 

Just now I have installed the latest version Binutils version still I am getting the same error.

Billa Surendra

unread,
Apr 8, 2022, 7:52:47 AM4/8/22
to Jim Wilson, RISC-V SW Dev
your correct Jim, after installing the latest version libbz2 package I could able to install the elfutils package.

Thanks
 
Jim
 
Reply all
Reply to author
Forward
0 new messages