[GHC] #9620: libffi.a is put in the wrong folder

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build System | Version: 7.9 Keywords: libffi lib64 | Operating System: Linux nixos | Type of failure: Building Architecture: Unknown/Multiple | GHC failed Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- This is dfeuer's error message, but it is equivalent to mine on NixOS x86_64 {{{ "/home/dfeuer/GHC/7.8.3.bin/bin/ghc" -o utils/genapply/dist/build/tmp/genapply -hisuf hi -osuf o -hcsuf hc -static -O -H64m -package pretty -package-db libraries/bootstrapping.conf -i -iutils/genapply/. -iutils/genapply/dist/build -iutils/genapply/dist/build/autogen -Iutils/genapply/dist/build -Iutils/genapply/dist/build/autogen -no-user-package-db -rtsopts -odir utils/genapply/dist/build -hidir utils/genapply/dist/build -stubdir utils/genapply/dist/build -static -O -H64m -package pretty -package-db libraries/bootstrapping.conf -i -iutils/genapply/. -iutils/genapply/dist/build -iutils/genapply/dist/build/autogen -Iutils/genapply/dist/build -Iutils/genapply/dist/build/autogen -no-user-package-db -rtsopts utils/genapply/dist/build/GenApply.o libffi/stamp.ffi.static-shared.install exists, but libffi/build/inst/lib/libffi.a does not. Suggest removing libffi/stamp.ffi.static-shared.install. make[1]: *** [libffi/build/inst/lib/libffi.a] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [all] Error 2 }}} libffi.a is build and linked into libffi/build/inst/lib64 instead of libffi/build/inst/lib, but the includes and pkg-config specific stuff is still put into libffi/build/inst/lib. GHC looks in lib for libffi.a and fails, the current workaround is to copy the contents of libffi/build/inst/lib64 into libffi/build/inst/lib and type make again. Symlinking won't work because libffi seems to sanitize the build directory before building the library I'd like to note that when compiling via the Debian source snapshot, libffi is put in the correct place if I run ./configure without using perl boot. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | nixos Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Building | Difficulty: Unknown GHC failed | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): I suspect this is due to a distro-specific autotools difference, especially in light of your last sentence. Can you attach your `libffi/build/configure` and `libffi/build/*/config.log` files? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | nixos Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Building | Difficulty: Unknown GHC failed | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rezb1t): Added requested logs, I checked autoconf and automake and they don't appear to have patches applied. There could be some other difference happening because of NixOS, though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dfeuer): * keywords: libffi lib64 nixos => libffi lib64 Comment: This is not just NixOS. I'm seeing it here on Fedora 20. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): But your workaround does not work for me. I then get a new message: {{{ make[1]: *** No rule to make target `libffi/build/inst/lib/libffi.so', needed by `rts/dist/build/libffi.so'. Stop. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Aha, here is the difference. From libffi's configure.ac: {{{ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` case $multi_os_directory in .) ;; # Avoid trailing /. ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; esac }}} Your `gcc -print-multi-os-directory` must print `../lib64`, while mine prints `../lib`. I don't yet see a great way to fix this, though... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Your `gcc -print-multi-os-directory` must print `../lib64`, while mine
#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): Replying to [comment:5 rwbarton]: prints `../lib`.
I don't yet see a great way to fix this, though...
I can verify that mine prints `../lib64`. It sounds likely that someone accidentally hardcoded `../lib` somewhere else. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Well it's not accidental. ghc's build system configures libffi with `--libdir=$(TOP)/libffi/build/inst/lib` with the intention that libffi should install its libraries into `libffi/build/inst/lib`. However libffi insists on installing its libraries into this mysterious "toolexeclibdir" instead. Seems like Gentoo ran into the same issue when packaging libffi: https://sourceware.org/ml/libffi-discuss/2014/msg00016.html Maybe we can adopt their workaround of `sed -i 's:@toolexeclibdir@:$(libdir):g' Makefile.in` before running libffi's configure script. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): dfeuer, could you try building with this patch? {{{ diff --git a/libffi/ghc.mk b/libffi/ghc.mk index bc62ad9..67dedf9 100644 --- a/libffi/ghc.mk +++ b/libffi/ghc.mk @@ -69,6 +69,11 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP) mv libffi/build/Makefile.in libffi/build/Makefile.in.orig sed "s/-MD/-MMD/" < libffi/build/Makefile.in.orig > libffi/build/Makefile.in + # libffi does not properly respect libdir; force it to do so. + # (https://sourceware.org/ml/libffi-discuss/2014/msg00016.html) + mv libffi/build/Makefile.in libffi/build/Makefile.in.orig + sed 's:@toolexeclibdir@:$$(libdir):g' < libffi/build/Makefile.in.orig > libffi/build/Makefile.in + # Their cmd invocation only works on msys. On cygwin it starts # a cmd interactive shell. The replacement works in both environments. mv libffi/build/ltmain.sh libffi/build/ltmain.sh.orig }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by slyfox): * cc: slyfox (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by slyfox): I'm also on gentoo/am64 and rwbarton's fix unbreaks build for me. I suggest pushing it as is. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rezb1t): The patch fixes the issue for me as well, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder
-------------------------------------+-------------------------------------
Reporter: rezb1t | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.10.1
Component: Build | Version: 7.9
System | Keywords: libffi lib64
Resolution: | Architecture: Unknown/Multiple
Operating System: Linux | Difficulty: Unknown
Type of failure: Building | Blocked By:
GHC failed | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Reid Barton

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: fixed | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.8.4 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: fixed | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: closed => merge * milestone: 7.10.1 => 7.8.4 Comment: Actually, might as well merge this too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9620: libffi.a is put in the wrong folder -------------------------------------+------------------------------------- Reporter: rezb1t | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.4 Component: Build | Version: 7.9 System | Keywords: libffi lib64 Resolution: fixed | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * milestone: 7.10.1 => 7.8.4 Comment: Merged to 7.8.4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9620#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC