-
Notifications
You must be signed in to change notification settings - Fork 545
Build Tricks
This page collects some known build errors and trick how to fix them
If compilation fails because of the following errors
undefined reference to `backtrace_symbols'
undefined reference to `backtrace'
then you need to link to execinfo
:
if [[ "${target}" == *-freebsd* ]]; then
export LDFLAGS="-lexecinfo"
fi
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target}
make -j ${nprocs}
make install
When building for Windows, sometimes libtool refuses to build the shared library because of undefined symbols. When this happens, compilation is successful but BinaryBuilder's audit can't find the expected LibraryProduct
s.
In the log of compilation you can usually find messages like
libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only
or
libtool: error: can't build i686-w64-mingw32 shared library unless -no-undefined is specified
In these cases you have to pass the -no-undefined
option to the linker, as explicitly suggested by the second message.
Doing this properly is a bit tricky: I couldn't make CFLAGS=-Wl,-no-undefined
work, instead setting LDFLAGS=-no-undefined
before ./configure
make this fail (because it will run a command like cc -no-undefined conftest.c
, which upsets the compiler). What I use to do is to pass LDFLAGS=-no-undefined
only to make
:
FLAGS=()
if [[ "${target}" == *-mingw* ]]; then
FLAGS+=(LDFLAGS="-no-undefined")
fi
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target}
make -j ${nprocs} "${FLAGS[@]}"
make install