Hi!

On Sat, 2021-01-09 at 17:04:07 +0100, Santiago Vila wrote:
> Package: src:ddd
> Version: 1:3.3.12-5.1
> Tags: ftbfs

> This package FTBFS randomly when built with sbuild, because sbuild
> chooses a build directory called ddd-<randomstring>.
> 
> When <randomstring> starts with capital "O", the build fails:
> 
> make[5]: Entering directory '/<<PKGBUILDDIR>>/builddir/ddd'
> + gcc -DHAVE_CONFIG_H -I. -I/<<PKGBUILDDIR>>/./ddd
> -I/<<PKGBUILDDIR>>/./ddd/.. -Wdate-time -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/ddd -fstack-protector-strong -Wformat
> -Werror=format-security -W -c -g /<<PKGBUILDDIR>>/./ddd/ctest.c -o
> ctest.o
> cc1: error: invalid argument ‘/build/ddd’ to ‘-fdebug-prefix-map’
> 
> 
> I could provide a full build log if required, but this is easy to
> reproduce. Please do as follows on a machine running buster:
> 
> mkdir ddd-O
> cd ddd-O
> apt-get source ddd
> cd ddd-3.3.12
> dpkg-buildpackage -uc -us -b
> 
> I have no idea why this happens, and I'm not even sure it's a bug in
> ddd itself. It could be a bug in CDBS, or in dpkg. I'm therefore
> Cc:ing the dpkg maintainers in case they have any hint.

This seems to be due to the following upstream build system code:

  # We don't want no optimizing, but debugging info in our test files
  MAKE_DEBUG_FLAGS = \
        CXXFLAGS="`$(ECHO) '$(CXXFLAGS)' | \
        $(SED) 's/-O[^ ]*//' | $(SED) 's/-DNDEBUG//'`" \
        CFLAGS="`$(ECHO) '$(CFLAGS)' | \
        $(SED) 's/-O[^ ]*//' | $(SED) 's/-DNDEBUG//'`"

and then stuff like:

  ctest.$(OBJEXT): $(srcdir)/ctest.c
        @case '$(CFLAGS)' in \
        *-O*) $(MAKE) $(MAKE_DEBUG_FLAGS) $@;; \
        *) set -x; \
           $(COMPILE) -c -g $(srcdir)/ctest.c -o $@;; \
        esac

so it strips "-O[^ ]*" substrings from anything present in the
compiler options.

Thanks,
Guillem

Reply via email to