[pkg-apparmor] Bug#1015354: apparmor: ftbfs with LTO (link time optimization) enabled

Matthias Klose doko at debian.org
Tue Jul 19 17:50:30 BST 2022


Package: src:apparmor
Version: 3.0.4-2
Severity: minor
Tags: sid bookworm
User: debian-gcc at lists.debian.org
Usertags: ftbfs-lto

This package currently fails to build (at least on the amd64
architecture) with link time optimizations enabled.  For a background
for LTO please see

https://wiki.debian.org/ToolChain/LTO

The goal is to enable this optimization by default in an upcoming
Debian release in dpkg-buildflags for 64bit architectures.  The goal
is to get this package to build with link time optimizations, or to
explicitly disable link time optimizations for this package build.

To reproduce the build failure, enable the lto optimization in
testing/unstable by adding "optimize=+lto" to DEB_BUILD_MAINT_OPTIONS
in the debian/rules file, or if this macro is unset, just set it:

export DEB_BUILD_MAINT_OPTIONS = optimize=+lto

Please try to fix the build with lto enabled, fixing the packaging or
forwarding the issue upstream. If the issue cannot be fixed,
explicitly disallow building the package with lto by adding to your
rules file:

export DEB_BUILD_MAINT_OPTIONS = optimize=-lto

or adding that string to your existing setting of DEB_BUILD_MAINT_OPTIONS.

The full build log can be found at:
http://qa-logs.debian.net/2022/06/09/dpkglto/apparmor_3.0.4-2_unstable_dpkglto.log
The last lines of the build log are at the end of this report.

[...]
msgfmt -c -o tr.mo tr.po
msgfmt -c -o ug.mo ug.po
msgfmt -c -o uk.mo uk.po
msgfmt -c -o vi.mo vi.po
msgfmt -c -o wa.mo wa.po
msgfmt -c -o xh.mo xh.po
msgfmt -c -o zh_CN.mo zh_CN.po
msgfmt -c -o zh_TW.mo zh_TW.po
msgfmt -c -o zu.mo zu.po
make[3]: Leaving directory '/<<PKGBUILDDIR>>/parser/po'
g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x  -DHAVE_REALLOCARRAY=1 -DPACKAGE=\"apparmor-parser\" -DLOCALEDIR=\"/usr/share/locale\" -I../libraries/libapparmor/include -c -o parser_misc.o parser_misc.c
g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x  -DHAVE_REALLOCARRAY=1 -DPACKAGE=\"apparmor-parser\" -DLOCALEDIR=\"/usr/share/locale\" -I../libraries/libapparmor/include -c -o network.o network.c
g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x -I../../libraries/libapparmor/include -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -c -o chfa.o chfa.cc
g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x -I../../libraries/libapparmor/include -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -c -o aare_rules.o aare_rules.cc
g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x -I../../libraries/libapparmor/include -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -c -o parse.o parse.cc
ar -rcs libapparmor_re.a parse.o expr-tree.o hfa.o chfa.o aare_rules.o
make[3]: Leaving directory '/<<PKGBUILDDIR>>/parser/libapparmor_re'
g++ -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Wall -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough -std=gnu++0x  -DHAVE_REALLOCARRAY=1 -DPACKAGE=\"apparmor-parser\" -DLOCALEDIR=\"/usr/share/locale\" -I../libraries/libapparmor/include -o apparmor_parser parser_common.o parser_include.o parser_interface.o parser_lex.o parser_main.o parser_misc.o parser_merge.o parser_symtab.o parser_yacc.o parser_regex.o parser_variable.o parser_policy.o parser_alias.o common_optarg.o lib.o network.o  mount.o  dbus.o  profile.o  rule.o  signal.o  ptrace.o  af_rule.o  af_unix.o policy_cache.o default_features.o  \
        libapparmor_re/libapparmor_re.a -static-libgcc -static-libstdc++ -L. -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -L../libraries/libapparmor/src/.libs -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread
parser_yacc.h:163:7: warning: type ‘union YYSTYPE’ violates the C++ One Definition Rule [-Wodr]
  163 | union YYSTYPE
      |       ^
libapparmor_re/parse.cc:129:7: note: a different type is defined in another translation unit
  129 | union YYSTYPE
      |       ^
parser_yacc.y:197:15: note: the first difference of corresponding definitions is field ‘id’
  197 |         char *id;
      |               ^
libapparmor_re/parse.y:30:14: note: a field with different name is defined in another translation unit
   30 |         char c;
      |              ^
parser_yacc.c:614:7: warning: type ‘union yyalloc’ violates the C++ One Definition Rule [-Wodr]
  614 | union yyalloc
      |       ^
libapparmor_re/parse.cc:477:7: note: a different type is defined in another translation unit
  477 | union yyalloc
      |       ^
parser_yacc.c:616:14: note: the first difference of corresponding definitions is field ‘yyss_alloc’
  616 |   yy_state_t yyss_alloc;
      |              ^
libapparmor_re/parse.cc:479:14: note: a field of same name but different type is defined in another translation unit
  479 |   yy_state_t yyss_alloc;
      |              ^
parser_yacc.c:185:6: warning: type ‘yysymbol_kind_t’ violates the C++ One Definition Rule [-Wodr]
  185 | enum yysymbol_kind_t
      |      ^
libapparmor_re/parse.cc:153:6: note: an enum with different value name is defined in another translation unit
  153 | enum yysymbol_kind_t
      |      ^
parser_yacc.c:191:3: note: name ‘YYSYMBOL_TOK_ID’ differs from name ‘YYSYMBOL_CHAR’ defined in another translation unit
  191 |   YYSYMBOL_TOK_ID = 3,                     /* TOK_ID  */
      |   ^
libapparmor_re/parse.cc:159:3: note: mismatching definition
  159 |   YYSYMBOL_CHAR = 3,                       /* CHAR  */
      |   ^
/tmp/cczxOw1E.s: Assembler messages:
/tmp/cczxOw1E.s: Error: invalid attempt to declare external version name as default in symbol `change_hat@@APPARMOR_1.0'
make[3]: *** [/tmp/ccCrkKUF.mk:2: /tmp/cc5Bx6vR.ltrans0.ltrans.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:215: apparmor_parser] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>/parser'
dh_auto_build: error: cd parser && make -j8 "INSTALL=install --strip-program=true" V=1 returned exit code 2
make[1]: *** [debian/rules:36: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:15: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2



More information about the pkg-apparmor-team mailing list