Summary: | dev-haskell/libxml-sax-0.7.5 - ld: -r and -pie may not be used together | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Anton Kochkov <anton.kochkov> |
Component: | Current packages | Assignee: | Gentoo's Haskell Language team <haskell> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b4b1, didier.colle, M8R-u38wij, slyfox, tobiw, toralf, zerochaos |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=644004 https://bugs.gentoo.org/show_bug.cgi?id=647960 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
libxml-sax_build.log
emerge --info output dev-haskell/curl-1.3.8 failed build log dev-haskell/hackage-security-0.5.2.2 failed build log dev-haskell/hslua-0.3.6.1 failed build log |
Created attachment 514202 [details]
emerge --info output
[1 of 1] Compiling Text.XML.LibXML.SAX ( lib/Text/XML/LibXML/SAX.hs, dist/build/Text/XML/LibXML/SAX.o ) lib/Text/XML/LibXML/SAX.hs:19:1: warning: [-Wtabs] Tab character found here, and in 345 further locations. Please use spaces instead. lib/Text/XML/LibXML/SAX.hs:77:16: warning: [-Wunused-top-binds] Defined but not used: data constructor ‘Context’ /usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -pie may not be used together collect2: error: ld returned 1 exit status <no location info>: error: `x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1) I got similar problems with these haskell ebuilds: dev-haskell/hackage-security dev-haskell/curl dev-haskell/hslua And I think all haskell ebuild that depends on external compiled objects should have the same problem. A temporary solution to solve these emerge is to use no-pie flags with portage env feature: /etc/portage/package.env ------------------------ dev-haskell/hackage-security nopie.conf dev-haskell/curl nopie.conf dev-haskell/hslua nopie.conf /etc/portage/env/nopie.conf --------------------------- CFLAGS="${CFLAGS} -no-pie" CXXFLAGS="${CXXFLAGS} -no-pie" LDFLAGS="${LDFLAGS} -no-pie" >(In reply to Zentoo from comment #3) > > A temporary solution to solve these emerge is to use no-pie flags with > portage env feature: > > /etc/portage/package.env > ------------------------ > dev-haskell/hackage-security nopie.conf > dev-haskell/curl nopie.conf > dev-haskell/hslua nopie.conf > > /etc/portage/env/nopie.conf > --------------------------- > CFLAGS="${CFLAGS} -no-pie" > CXXFLAGS="${CXXFLAGS} -no-pie" > LDFLAGS="${LDFLAGS} -no-pie" Based on bug #60666 only LDFLAGS="-no-pie" is needed. So: /etc/portage/package.env ------------------------ dev-haskell/hackage-security ld-nopie.conf dev-haskell/curl ld-nopie.conf dev-haskell/hslua ld-nopie.conf /etc/portage/env/ld-nopie.conf --------------------------- LDFLAGS="${LDFLAGS} -no-pie" (In reply to Zentoo from comment #4) > Based on bug #60666 only LDFLAGS="-no-pie" is needed. ERRATA: it's bug #606666 Yes, also, just for the record, same problem for dev-haskell/x11-1.8-r1 (xmonad dependency)
>>> Compiling source in /var/tmp/portage/dev-haskell/x11-1.8-r1/work/X11-1.8 ...
./setup build
Building X11-1.8...
Preprocessing library X11-1.8...
[01m[KXF86.hsc:711:27:[m[K [01;35m[Kwarning: [m[Kextra tokens at end of #ifdef directive
[01m[KXF86.hsc:[m[K In function ‘[01m[Kmain[m[K’:
[01m[KXF86.hsc:711:27:[m[K [01;35m[Kwarning: [m[Kextra tokens at end of #ifdef directive
[01m[KXF86.hsc:711:27:[m[K [01;35m[Kwarning: [m[Kextra tokens at end of #ifdef directive
[ 1 of 28] Compiling Graphics.X11.Xlib.Internal ( dist/build/Graphics/X11/Xlib/Internal.hs, dist/build/Graphics/X11/Xlib/Internal.o )
[ 2 of 28] Compiling Graphics.X11.Types ( dist/build/Graphics/X11/Types.hs, dist/build/Graphics/X11/Types.o )
[ 3 of 28] Compiling Graphics.X11.Xlib.Types ( dist/build/Graphics/X11/Xlib/Types.hs, dist/build/Graphics/X11/Xlib/Types.o )
[ 4 of 28] Compiling Graphics.X11.Xlib.Atom ( dist/build/Graphics/X11/Xlib/Atom.hs, dist/build/Graphics/X11/Xlib/Atom.o )
[ 5 of 28] Compiling Graphics.X11.Xlib.Color ( Graphics/X11/Xlib/Color.hs, dist/build/Graphics/X11/Xlib/Color.o )
[ 6 of 28] Compiling Graphics.X11.Xlib.Context ( Graphics/X11/Xlib/Context.hs, dist/build/Graphics/X11/Xlib/Context.o )
[ 7 of 28] Compiling Graphics.X11.Xlib.Display ( Graphics/X11/Xlib/Display.hs, dist/build/Graphics/X11/Xlib/Display.o )
[ 8 of 28] Compiling Graphics.X11.Xlib.Event ( dist/build/Graphics/X11/Xlib/Event.hs, dist/build/Graphics/X11/Xlib/Event.o )
[ 9 of 28] Compiling Graphics.X11.Xlib.Font ( dist/build/Graphics/X11/Xlib/Font.hs, dist/build/Graphics/X11/Xlib/Font.o )
[10 of 28] Compiling Graphics.X11.Xlib.Cursor ( dist/build/Graphics/X11/Xlib/Cursor.hs, dist/build/Graphics/X11/Xlib/Cursor.o )
[11 of 28] Compiling Graphics.X11.Xlib.Image ( Graphics/X11/Xlib/Image.hs, dist/build/Graphics/X11/Xlib/Image.o )
[12 of 28] Compiling Graphics.X11.Xlib.Misc ( dist/build/Graphics/X11/Xlib/Misc.hs, dist/build/Graphics/X11/Xlib/Misc.o )
[13 of 28] Compiling Graphics.X11.Xlib.Region ( Graphics/X11/Xlib/Region.hs, dist/build/Graphics/X11/Xlib/Region.o )
[14 of 28] Compiling Graphics.X11.Xlib.Screen ( Graphics/X11/Xlib/Screen.hs, dist/build/Graphics/X11/Xlib/Screen.o )
[15 of 28] Compiling Graphics.X11.Xlib.Window ( Graphics/X11/Xlib/Window.hs, dist/build/Graphics/X11/Xlib/Window.o )
[16 of 28] Compiling Graphics.X11.Xlib ( Graphics/X11/Xlib.hs, dist/build/Graphics/X11/Xlib.o )
[17 of 28] Compiling Graphics.X11.XScreenSaver ( dist/build/Graphics/X11/XScreenSaver.hs, dist/build/Graphics/X11/XScreenSaver.o )
[18 of 28] Compiling Graphics.X11.Xrandr ( dist/build/Graphics/X11/Xrandr.hs, dist/build/Graphics/X11/Xrandr.o )
[19 of 28] Compiling Graphics.X11.Xlib.Extras ( dist/build/Graphics/X11/Xlib/Extras.hs, dist/build/Graphics/X11/Xlib/Extras.o )
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status
<no location info>: error:
`x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)
(In reply to Anton Kochkov from comment #6) > Yes, also, just for the record, same problem for dev-haskell/x11-1.8-r1 > (xmonad dependency) > ld: -r and -pie may not be used together > collect2: error: ld returned 1 exit status > > <no location info>: error: > `x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1) Does your ghc report no-pie support? $ ghc --info | grep pie ,("C compiler supports -no-pie","YES") It reports "NO" for "C compiler supports -no-pie" (In reply to Anton Kochkov from comment #8) > It reports "NO" for "C compiler supports -no-pie" Did you rebuild ghc after switch to gcc[pie]? Or maybe you use USE=binary ghc? As far as I understand this problem seems to appear when a haskell module is linked against an external library as curl for example. With gentoo profile 17.0, libraries are compiled with PIE and it seems that these particular haskell modules are generating relocatable output. Relocatable and PIE are not compatible for ld. That's why to force LD_FLAGS=-no-pie works to be able to emerge these ebuilds. I suppose that it would be better to do not use relocatable code and keep PIE to stay consistent but I'm not an expert about how haskell/cabal generates libraries. (In reply to Sergei Trofimovich from comment #9) > (In reply to Anton Kochkov from comment #8) > > It reports "NO" for "C compiler supports -no-pie" > > Did you rebuild ghc after switch to gcc[pie]? Or maybe you use USE=binary > ghc? Yes, it was rebuilt as a part of "emerge -e @world". But probably somehow in a wrong way. After explicitly rebuilding of ghc again, everything seem to work ok - it reports of "-no-pie" support and also dev-haskell/libxml-sax builds just fine. *** This bug has been marked as a duplicate of bug 644004 *** The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf8f136b40a11d047b6281970753ededfca09b04 commit bf8f136b40a11d047b6281970753ededfca09b04 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2018-01-22 00:01:07 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-01-22 00:01:07 +0000 dev-lang/ghc: rebuild ghc against gcc-6 (PIE support), bug #644170 Refresh binaries for amd64 and x86 to support -no-pie option by default. Reported-by: Anton Kochkov Bug: https://bugs.gentoo.org/644170 Package-Manager: Portage-2.3.19, Repoman-2.3.6 dev-lang/ghc/Manifest | 4 ++-- dev-lang/ghc/ghc-8.0.2.ebuild | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)} Pushed rebuilt binaries at least for amd64 and x86. These should work as-is for gcc-6. *** Bug 646994 has been marked as a duplicate of this bug. *** *** Bug 647960 has been marked as a duplicate of this bug. *** *** Bug 644004 has been marked as a duplicate of this bug. *** It seems some duplicates of this bug have been resolved but there are still ebuilds that don't compile and need the packange.env workaround: /etc/portage/package.env dev-haskell/hackage-security nopie.conf dev-haskell/curl nopie.conf dev-haskell/hslua nopie.conf /etc/portage/env/nopie.conf LDFLAGS="${LDFLAGS} -no-pie" These ebuilds don't compile with: dev-lang/ghc-7.10.3 sys-devel/gcc-7.3.0-r3 (In reply to Zentoo from comment #18) > It seems some duplicates of this bug have been resolved but there are still > ebuilds that don't compile and need the packange.env workaround Please provide a build log for example failure. It's not a specific ebuild problem but a lack of rebuild of one of dependencies that managed to persist old LDFLAGS. Created attachment 546266 [details]
dev-haskell/curl-1.3.8 failed build log
Created attachment 546268 [details]
dev-haskell/hackage-security-0.5.2.2 failed build log
Created attachment 546270 [details]
dev-haskell/hslua-0.3.6.1 failed build log
(In reply to Sergei Trofimovich from comment #19) > (In reply to Zentoo from comment #18) > > It seems some duplicates of this bug have been resolved but there are still > > ebuilds that don't compile and need the packange.env workaround > > Please provide a build log for example failure. It's not a specific ebuild > problem but a lack of rebuild of one of dependencies that managed to persist > old LDFLAGS. Please find failed builds logs as attachments for: - dev-haskell/curl-1.3.8 - dev-haskell/hackage-security-0.5.2.2 - dev-haskell/curl-1.3.8 Note: whole world have been rebuild before generate these builds. Please post output of 'ghc --info' as well. (In reply to Sergei Trofimovich from comment #24) > Please post output of 'ghc --info' as well. # ghc --info [("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv") ,("C compiler command","x86_64-pc-linux-gnu-gcc") ,("C compiler flags"," -fno-stack-protector") ,("C compiler link flags","") ,("Haskell CPP command","x86_64-pc-linux-gnu-gcc") ,("Haskell CPP flags","-E -undef -traditional ") ,("ld command","/usr/bin/x86_64-pc-linux-gnu-ld") ,("ld flags","") ,("ld supports compact unwind","YES") ,("ld supports build-id","YES") ,("ld supports filelist","NO") ,("ld is GNU ld","YES") ,("ar command","/usr/bin/x86_64-pc-linux-gnu-ar") ,("ar flags","q") ,("ar supports at file","YES") ,("touch command","touch") ,("dllwrap command","/bin/false") ,("windres command","/bin/false") ,("libtool command","libtool") ,("readelf command","/usr/bin/x86_64-pc-linux-gnu-readelf") ,("perl command","/usr/bin/perl") ,("cross compiling","NO") ,("target os","OSLinux") ,("target arch","ArchX86_64") ,("target word size","8") ,("target has GNU nonexec stack","True") ,("target has .ident directive","True") ,("target has subsections via symbols","False") ,("Unregisterised","NO") ,("LLVM llc command","llc") ,("LLVM opt command","opt") ,("Project version","7.10.3") ,("Project Git commit id","97e7c293abbde5223d2bf0516f8969bdd1a9a7a2") ,("Booter version","7.10.3") ,("Stage","2") ,("Build platform","x86_64-unknown-linux") ,("Host platform","x86_64-unknown-linux") ,("Target platform","x86_64-unknown-linux") ,("Have interpreter","YES") ,("Object splitting supported","YES") ,("Have native code generator","YES") ,("Support SMP","YES") ,("Tables next to code","YES") ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn") ,("Support dynamic-too","YES") ,("Support parallel --make","YES") ,("Support reexported-modules","YES") ,("Support thinning and renaming package flags","YES") ,("Uses package keys","YES") ,("Dynamic by default","NO") ,("GHC Dynamic","YES") ,("Leading underscore","NO") ,("Debug on","False") ,("LibDir","/usr/lib64/ghc-7.10.3") ,("Global Package DB","/usr/lib64/ghc-7.10.3/package.conf.d") ] *** Bug 642018 has been marked as a duplicate of this bug. *** *** Bug 702556 has been marked as a duplicate of this bug. *** *** Bug 691074 has been marked as a duplicate of this bug. *** *** Bug 691078 has been marked as a duplicate of this bug. *** *** Bug 691082 has been marked as a duplicate of this bug. *** *** Bug 691154 has been marked as a duplicate of this bug. *** All old ghcs were removed from the tree. All current ones should work as is. |
Created attachment 514200 [details] libxml-sax_build.log After updating to 17.0 profile and during "emerge -e @world"