On 2019-05-11 08:33 -0500, William Harrington wrote:
> > On May 10, 2019, at 16:25, Niels Terp <[email protected]> wrote:
> > 
> > Hey, I’m kind of new here. I build LFS several times a few years ago, but
> > then got busy with other things.
> >  
> > Now I’m back, I’m following current stable lfs, and here is my first
> > problem:
> >  
> > I have a script that builds the  temporary system. Since i want to install
> > RPM, I continue with the deps of RPM, among wich is elfutils.
> >  
> > It is set up like chapter 6.48.1 with ./configure –prefix=/tools –program-
> > prefix=”eu-”
> >  
> > When I run ”make” I get these errors:
> >  
> >   CC       dwarf_next_lines.os
> >   AR       libdw.a
> >   AR       libdw_pic.a
> >   CCLD     libdw.so
> > /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-
> > pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-
> > gnu/8.2.0/../../../../lib64/libbz2.a(bzlib.o): relocation R_X86_64_32S
> > against symbol `BZ2_crc32Table' can not be used when making a shared object;
> > recompile with -fPIC
> > /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-
> > pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-
> > gnu/8.2.0/../../../../lib64/libbz2.a(compress.o): relocation R_X86_64_32
> > against `.rodata.str1.1' can not be used when making a shared object;
> > recompile with -fPIC
> > /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-
> > pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-
> > gnu/8.2.0/../../../../lib64/libbz2.a(decompress.o): relocation R_X86_64_32S
> > against `.rodata' can not be used when making a shared object; recompile
> > with -fPIC
> > /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-
> > pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-
> > gnu/8.2.0/../../../../lib64/libbz2.a(blocksort.o): relocation R_X86_64_32
> > against `.rodata.str1.1' can not be used when making a shared object;
> > recompile with -fPIC
> > /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-
> > pc-linux-gnu/bin/ld: final link failed: nonrepresentable section on output
> > collect2: error: ld returned 1 exit status
> > make[3]: *** [Makefile:1372: libdw.so] Error 1
> > make[2]: *** [Makefile:614: all] Error 2
> > make[1]: *** [Makefile:485: all-recursive] Error 1
> > make: *** [Makefile:401: all] Error 2
> >  
> > The full log file is enclosed.
> >  
> > I see that I have to recompile with -fPIC – but how do I do that ?
> >  
> 
> No, you don't need to recompile with -fPIC. read the errors. You can't use
> 64bit against 32bit. When you are building elfutils it's using the wrong
> compiler or you gave the wrong options. Make sure it is using 32bit for 32bit
> and 64bit for 64bit. That's all that is going on here.

I don't think so...

This error message comes from when the linker tries to link a shared object from
non PIC code on x86_64:

$ LANG= cc hw.c -shared  -fno-pic 
/usr/bin/ld: /tmp/ccRXQvvQ.o: relocation R_X86_64_32 against `.rodata.str1.1'
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status

For incompatible ABI (32 vs 64), the message is:

$ cc hw.c -c && LANG= cc hw.o -m32 
/usr/bin/ld: i386:x86-64 architecture of input file `hw.o' is incompatible with
i386 output
collect2: error: ld returned 1 exit status
-- 
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to