Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ebuilds with sed fail when using GCC 9.1 enhanced -falign syntax #292

Open
wolfwood opened this issue May 5, 2019 · 14 comments
Open

ebuilds with sed fail when using GCC 9.1 enhanced -falign syntax #292

wolfwood opened this issue May 5, 2019 · 14 comments

Comments

@wolfwood
Copy link
Contributor

wolfwood commented May 5, 2019

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.

@wolfwood
Copy link
Contributor Author

wolfwood commented May 5, 2019

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

@wolfwood
Copy link
Contributor Author

wolfwood commented May 5, 2019

>>> 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;

@wolfwood
Copy link
Contributor Author

wolfwood commented May 6, 2019

also a bunch of dev-qt packages

@wolfwood
Copy link
Contributor Author

wolfwood commented May 6, 2019

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

@wolfwood
Copy link
Contributor Author

wolfwood commented May 6, 2019

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

@wolfwood
Copy link
Contributor Author

wolfwood commented May 6, 2019

https://bugs.gentoo.org/685160

@wolfwood wolfwood changed the title sed related failures with GCC 9.1 rebuild ebuilds with sed fail when using GCC 9.1 enhanced -falign syntax May 6, 2019
@javashin
Copy link

javashin commented May 6, 2019

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"

@javashin
Copy link

javashin commented May 6, 2019

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"

@javashin
Copy link

javashin commented May 6, 2019

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"

@javashin
Copy link

javashin commented May 6, 2019

no problems here .

@InBetweenNames
Copy link
Owner

@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.

@wolfwood
Copy link
Contributor Author

wolfwood commented May 6, 2019

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.

@InBetweenNames
Copy link
Owner

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

@wolfwood
Copy link
Contributor Author

wolfwood commented May 9, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants