2015年1月18日 星期日

[LFS] 6.13. Binutils-2.25

The Binutils package contains a linker, an assembler, and other tools for handling object files.


1. Verify that the PTYs are working properly
expect -c "spawn ls"
This command should output the following
spawn ls

2. Indicate library path, and make sure libbfd-2.25.so and libdl-2.20.so is under library folder.
export LD_LIBRARY_PATH=/lib:/usr/lib


3. Make binutils-build and ./configure
mkdir -v ../binutils-build
cd ../binutils-build

../binutils-2.25/configure --prefix=/usr   \
                           --enable-shared \
                           --disable-werror\
                           LIBS=-ldl-2.20

3. Compiler and Install package
make tooldir=/usr

make tooldir=/usr install




Problem:
 error: undefined reference to 'dlsym'
 error: undefined reference to 'dlopen'
 error: undefined reference to 'dlclose'
Method 1:
vim lfs/tmp/binutils-build/Makefile +384
LDFLAGS = --> LDFLAGS = -ldl-2.20
Method 2:
../binutils-2.25/configure --prefix=/usr   \
                           --enable-shared \
                           --disable-werror\
                           LIBS=-ldl-2.20


Reference:
1. 6.13. Binutils-2.25
2. Error compiling under Precise " undefined reference to ‘dlsym’ "

0 意見:

張貼留言