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
dev-haskell/zlib breaks on -flto -ffat-lto-objects #1110
Comments
Can you post the output of |
I have been unable to reproduce the bug with the following: * Package: dev-haskell/yesod-core-1.6.18.8
* Repository: haskell
* Maintainer: haskell@gentoo.org
* USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
* FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox
* Package: dev-haskell/yesod-core-1.6.18.8
* Repository: haskell
* Maintainer: haskell@gentoo.org
* USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
* FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox @matoro have you tried running |
Yep, I have tried both of those. This was how I invoked the above build:
I also tried:
which successfully builds, but does not help the original issue. Here's my package lists:
|
Actually, scratch that, this might be the problem:
Not sure why this didn't show up or why portage allowed me to upgrade ghc then. Does that mean that dev-haskell/yesod-core is not compatible with newer ghc? |
@matoro can you please post the full output of |
|
Where did this message come from? Can you post that full output?
|
Yeah, I am not sure why it only shows up when I do my full system upgrade command:
There is a bunch of other irrelevant stuff going on there, but after it fails the build (see initial log) this seems to be the only relevant part:
|
This means your |
I'm getting a similar message when compiling
Immediately following are these two messages:
And then the rest of the log:
Note that the highlighted part of the log mentions |
Wow, that actually did it! I did not realize that CFLAGS affected haskell packages since, well, they're not written in C. Could you perhaps add |
I would guess Let's keep it open and check why |
Okay, this has gotten much worse with the latest ghc and now the workaround no longer completely works. Packages where it did help:
Packages where it did not help:
Can anybody help please?
|
I think minimizing amount of changes needed for a system to destabilize would be good to find out (say, in a fresh chroot). You have many options not safe to use due to relatively limited testing like |
I think I got minimal reproducer: -- cat Main.hs
{-# LANGUAGE ForeignFunctionInterface #-}
{-
$ /usr/bin/ghc --make -O -dynamic -fPIC -hide-all-packages -package=base Main.hs -fforce-recomp
<ok>
$ /usr/bin/ghc --make -O -dynamic -fPIC -hide-all-packages -package=base Main.hs -optc-flto -optc-ffat-lto-objects -optc-fuse-linker-plugin -optl-flto -optl-flto-partition=max -optl-fuse-linker-plugin -fforce-recomp
<artificial>:(.text+0xe8): undefined reference to `ZCMain_main_closure'
collect2: error: ld returned 1 exit status
-}
module Main (main) where
import Foreign.Ptr
-- Seemingly unrelated, but affects symbol resolution of 'ZCMain_main_closure'
foreign import ccall unsafe "stdlib.h free"
c_pcre_compile :: Ptr () -> IO ()
main :: IO ()
main = return () |
That forces false impression on |
The upstream bug is https://sourceware.org/PR12291 |
Filed https://sourceware.org/PR27122 to get better diagnostic from Meanwhile we'll need to avoid any LTO flags in haskell packages. |
Can you give d232818 a try and check how it goes? You'll need to rebuild all the haskell libraries that complain about missing symbols. It should not be too hard. Example error:
Example fix:
|
I just went ahead and rebuilt everything with that commit, and that did seem to resolve it. I guess LTO is just more trouble than it's worth for Haskell. Thank you very much for all the help. |
|
`ghc` uses partial linking to glue together object files produced by `gcc` and `ghc`. In case of -flto* flags we have a chance to mix IR section incorrectly due to ld deficiency: https://sourceware.org/PR12291 Let's filter out -flto-related flags until binutils is ready. Reported-by: matoro Closes: gentoo-haskell/gentoo-haskell#1110 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Hi, I am trying to rebuild all my haskell packages after the update to =dev-lang/ghc-8.10.2, but dev-haskell/yesod-core is failing due to the error in the title. The library in question is owned by dev-haskell/zlib, but rebuilding that does not help. Full build log & system info:
The text was updated successfully, but these errors were encountered: