sys-process/tini-0.15.0: does not compile because _FORTIFY_SOURCE is double set. [ 50%] Building C object CMakeFiles/tini.dir/src/tini.c.o /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-gcc -D_FORTIFY_SOURCE=2 -I/var/tmp/portage/sys-process/tini-0.15.0/work/tini -0.15.0_build -DNDEBUG -march=core2 -O2 -pipe -U_FORTIFY_SOURCE -std=gnu99 -Werror -Wextra -Wall -pedantic-errors -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -o CMakeFiles/tini.dir/src/tini.c.o -c /var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0/src/tini.c <command-line>:0:0: error: "_FORTIFY_SOURCE" redefined <command-line>:0:0: error: "_FORTIFY_SOURCE" redefined <built-in>: note: this is the location of the previous definition <command-line>:0:0: error: "_FORTIFY_SOURCE" redefined <built-in>: note: this is the location of the previous definition make[2]: *** [CMakeFiles/tini.dir/build.make:63: CMakeFiles/tini.dir/src/tini.c.o] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0_build' make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/tini.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: *** [CMakeFiles/tini-static.dir/build.make:63: CMakeFiles/tini-static.dir/src/tini.c.o] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0_build' make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/tini-static.dir/all] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0_build' make: *** [Makefile:152: all] Error 2 * ERROR: sys-process/tini-0.15.0::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-process/tini-0.15.0::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-process/tini-0.15.0::gentoo'`. * The complete build log is located at '/var/log/portage/sys-process:tini-0.15.0:20170728-132332.log'. * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-process/tini-0.15.0/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-process/tini-0.15.0/temp/environment'. * Working directory: '/var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0_build' * S: '/var/tmp/portage/sys-process/tini-0.15.0/work/tini-0.15.0' Reproducible: Always Steps to Reproduce: 1. emerge sys-process/tini 2. fails 3. emerge sys-process/tini 4. fails Actual Results: emerge =sys-process/tini-0.15.0 with -U_FORTIFY_SOURCE in CFLAGS Expected Results: installs This bug was fixed for Alpine Linux in version 0.83 in 2015. The Problem is our gcc is not set natively to this, only for packages build by emerge.
Created attachment 487060 [details] emerge-info.txt emerge --info
Created attachment 487062 [details, diff] fortify-source-CMakeLists.patch Quick solution: mkdir /etc/portage/patches/sys-process/tini/ -p cp fortify-source-CMakeLists.patch /etc/portage/patches/sys-process/tini/ emerge =sys-process/tini-0.15.0 ">>> sys-process/tini-0.15.0 merged."
This patch works for sys-process/tini-0.18.0 again.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c03a6d641dd2dce29a98e0cdf6930ab4d3754232 commit c03a6d641dd2dce29a98e0cdf6930ab4d3754232 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2018-07-26 07:29:11 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-07-26 07:31:50 +0000 sys-process/tini: remove -Werror (bug 626438) Fixes: https://bugs.gentoo.org/626438 Package-Manager: Portage-2.3.43, Repoman-2.3.10 sys-process/tini/tini-0.18.0.ebuild | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
(In reply to Joerg Neikes from comment #2) > Created attachment 487062 [details, diff] [details, diff] > fortify-source-CMakeLists.patch Some people might like to have _FORTIFY_SOURCE enabled though, so I've patched CMakeLists.txt to make macro redefinition non-fatal, be removing -Werror and -pedantic-errors from the internal CFLAGS setting.
(In reply to Zac Medico from comment #5) > (In reply to Joerg Neikes from comment #2) > > Created attachment 487062 [details, diff] [details, diff] [details, diff] > > fortify-source-CMakeLists.patch > > Some people might like to have _FORTIFY_SOURCE enabled though, so I've > patched CMakeLists.txt to make macro redefinition non-fatal, be removing > -Werror and -pedantic-errors from the internal CFLAGS setting. Yes my setting for the whole GCC settings is normaly with _FORTIFY_SOURCE on all systems. CFLAGS="-O2 -pipe -U_FORTIFY_SOURCE" CXXFLAGS="${CFLAGS}" Because of this, FORTIFY_SOURCE would be set twice. This won't work.
This test case shows that _FORTIFY_SOURCE is unset, despite the warning that it is redefined: > $ cat assert_no_fortify.c > #ifdef _FORTIFY_SOURCE > #error "defined: _FORTIFY_SOURCE" > #endif > int main(void) { > return 0; > } > $ gcc -D_FORTIFY_SOURCE=2 assert_no_fortify.c -o /dev/null > <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined > <built-in>: note: this is the location of the previous definition > assert_no_fortify.c:2:2: error: #error "defined: _FORTIFY_SOURCE" > #error "defined: _FORTIFY_SOURCE" > ^~~~~ > $ gcc -D_FORTIFY_SOURCE=2 -U_FORTIFY_SOURCE assert_no_fortify.c -o /dev/null > <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined > <built-in>: note: this is the location of the previous definition