building ports with poudriere with CFLAGS=-O0 -g and no strip

Don Lewis truckman at FreeBSD.org
Wed Aug 3 18:56:57 UTC 2016


On  3 Aug, Matthias Apitz wrote:
> 
> Hello,
> 
> I'm re-build some 100 ports in a poudriere jail r292778 amd64 and ports from r414411 with
> 
> CFLAGS=-O0 -g
> CXXFLAGS=-O0 -g
> 
> in the jails make.conf file to nail down or at least get a gdb backtrace
> of the astro/stellarium which crashes on start;

If it is crashing very early, run ldd on the executable and checked to
see if it is linked to both libstdc++ and libc++.  My experience is that
it is a fatal combination.  This happens if it is using some libraries
containing c++ code compiled with g++, and other libraries containing
c++ code compilied with clang++, or all of the libraries compiled with
one compiler and the application compiled with the other.  All of the
c++ code needs to use the same toolchain, which can be a PITA to
untangle, since changing the toolchain for one port can break other
ports that depend on it.

> Two problems:
> 
> The above CFLAGS/CXXFLAGS are fine for all ports, but devel/binutil does
> not compile (I can't find some libintl.h header file); I could file a PR
> if it is not a known issue already;
> 
> I found no way to avoid the strip of the binaries; I ended up with copy
> /usr/bin/true to /usr/bin/strip in the jail. What is the right way to do
> so with some config value?

For the latter, put WITH_DEBUG=yes in make.conf.  It changes
${STRIP_CMD} from /usr/bin/strip to /bin/true.  For ports that set
INSTALL_TARGET to install-strip, it changes the target to install.  It
also sets DEBUG_CFLAGS to -g.

For the first issue you might try setting DEBUG_CFLAGS to -O0 -g and not
directly setting CFLAGS and CXXFLAGS.



More information about the freebsd-ports mailing list