Gentoolto: ebuilds with sed fail when using GCC 9.1 enhanced -falign syntax

Created on 6 May 2019  路  14Comments  路  Source: InBetweenNames/gentooLTO

during my gcc 9.1 world rebuild, sys-apps/iproute and app-arch/p7zip have both failed with sed -e expression _unknown option to `s'_ during prepare source phase.

All 14 comments

I was also trying out the new -falign-functions syntax, which should be equivalent to 24 (32 if it adjusts by less than 25 bytes) with a fallback to 16 : -falign-functions=32:25:16
also switched to -fvect-cost-model=unlimited

>>> Preparing source in /var/tmp/portage/app-arch/p7zip-16.02-r4/work/p7zip_16.02 ...
 * Applying p7zip-16.02-darwin.patch ...
 [ ok ]
 * Applying CVE-2016-9296.patch ...
 [ ok ]
 * Applying CVE-2017-17969.patch ...
 [ ok ]
 * Applying CVE-2018-5996.patch ...
 [ ok ]
 * Applying CVE-2018-10115.patch ...
 [ ok ]
sed: -e expression #5, char 164: unknown option to `s'
 * ERROR: app-arch/p7zip-16.02-r4::gentoo failed (prepare phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_prepare
 *   environment, line 3529:  Called die
 * The specific snippet of code:
 *       sed -e 's:-m32 ::g' -e 's:-m64 ::g' -e 's:-pipe::g' -e '/ALLFLAGS/s:-s ::' -e "/OPTFLAGS=/s:=.*:=${CXXFLAGS}:" -i makefile* || die;
>>> Preparing source in /var/tmp/portage/sys-apps/iproute2-5.0.0/work/iproute2-5.0.0 ...
 * Applying iproute2-3.1.0-mtu.patch ...
 [ ok ]
 * Applying iproute2-4.20.0-configure-nomagic.patch ...
 [ ok ]
sed: -e expression #3, char 152: unknown option to `s'
 * ERROR: sys-apps/iproute2-5.0.0::gentoo failed (prepare phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_prepare
 *   environment, line 3506:  Called die
 * The specific snippet of code:
 *       sed -i -e '/^CC :\?=/d' -e "/^LIBDIR/s:=.*:=/$(get_libdir):" -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" -e "/^DBM_INCLUDE/s:=.*:=${T}:" Makefile || die;

also a bunch of dev-qt packages

looks like -falign-functions=32:25 sucessfully compiles a broken sed, but -falign-functions=24 doesn't. not sure how to make a gcc bug for this

ooooooooooh. its not a gcc bug. its having colons in the FLAGS that breaks the sed expressions :rofl:

app-arch/p7zip-16.02-r4::pg_overlay was built with the following:
USE="pch -doc -kde -rar (-static) -wxwidgets" ABI_X86="(64) (-x32)"
CFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe"

sys-apps/iproute2-5.0.0::poly-c was built with the following:
USE="berkdb iptables ipv6 -atm -caps -elf -minimal (-selinux)" ABI_X86="(64)"
CFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe"

sys-apps/sed-4.7::gentoo was built with the following:
USE="acl nls -forced-sandbox (-selinux) -static" ABI_X86="(64)"
CFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu -march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -fipa-pta -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=3 -fuse-linker-plugin -pipe"

no problems here .

@wolfwood is it possible to escape the colon in such a way that GCC will ignore, but would pass through sed without issue? It does seem to me an ebuild bug though, to pass *FLAGS through sed like that.

yes, the gentoo devs have made a tracking bug and i think the plan is to fix individual ebuilds to escape uses of *FLAGS.

in the short term, escaping the colons with backslashes worked for p7zip and the qt libs, but iproute2 failed with a strange symbol redefinition error.

I'm glad you're trying out -falign-functions=24 too. I recall looking at the alignment code in the Clear Linux thread here: #164

yeah, it was that thread that made me want to try the new syntax with gcc 9.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prototype99 picture prototype99  路  3Comments

nivedita76 picture nivedita76  路  17Comments

Peter-Levine picture Peter-Levine  路  15Comments

pchome picture pchome  路  14Comments

jelinekto picture jelinekto  路  11Comments