Linking unison ocamlopt -verbose -I lwt -I ubase -I +lablgtk2 -o unison unix.cmxa str.cmxa lablgtk.cmxa -cclib -lutil ubase/projectInfo.cmx ubase/myMap.cmx ubase/safelist.cmx ubase/uprintf.cmx ubase/util.cmx ubase/rx.cmx ubase/uarg.cmx ubase/prefs.cmx ubase/trace.cmx lwt/pqueue.cmx lwt/lwt.cmx lwt/lwt_util.cmx lwt/lwt_unix.cmx case.cmx pred.cmx uutil.cmx fileutil.cmx name.cmx path.cmx fspath.cmx fingerprint.cmx abort.cmx osx.cmx props.cmx fileinfo.cmx os.cmx lock.cmx clroot.cmx common.cmx tree.cmx checksum.cmx terminal.cmx transfer.cmx xferhint.cmx remote.cmx copy.cmx globals.cmx stasher.cmx update.cmx files.cmx sortri.cmx recon.cmx transport.cmx strings.cmx uicommon.cmx uitext.cmx main.cmx pixmaps.cmx uigtk2.cmx linkgtk2.cmx osxsupport.o pty.o + as -o /var/tmp/paludis/net-misc/unison-2.17.1-r1/temp/camlstartup7fa45e.o /var/tmp/paludis/net-misc/unison-2.17.1-r1/temp/camlstartup2ff732.s + gcc -Wl,--as-needed -o 'unison' -I'/usr/lib64/ocaml' '/var/tmp/paludis/net-misc/unison-2.17.1-r1/temp/camlstartup7fa45e.o' '/usr/lib64/ocaml/std_exit.o' 'linkgtk2.o' 'uigtk2.o' 'pixmaps.o' 'main.o' 'uitext.o' 'uicommon.o' 'strings.o' 'transport.o' 'recon.o' 'sortri.o' 'files.o' 'update.o' 'stasher.o' 'globals.o' 'copy.o' 'remote.o' 'xferhint.o' 'transfer.o' 'terminal.o' 'checksum.o' 'tree.o' 'common.o' 'clroot.o' 'lock.o' 'os.o' 'fileinfo.o' 'props.o' 'osx.o' 'abort.o' 'fingerprint.o' 'fspath.o' 'path.o' 'name.o' 'fileutil.o' 'uutil.o' 'pred.o' 'case.o' 'lwt/lwt_unix.o' 'lwt/lwt_util.o' 'lwt/lwt.o' 'lwt/pqueue.o' 'ubase/trace.o' 'ubase/prefs.o' 'ubase/uarg.o' 'ubase/rx.o' 'ubase/util.o' 'ubase/uprintf.o' 'ubase/safelist.o' 'ubase/myMap.o' 'ubase/projectInfo.o' '/usr/lib64/ocaml/lablgtk2/lablgtk.a' '/usr/lib64/ocaml/str.a' '/usr/lib64/ocaml/unix.a' '/usr/lib64/ocaml/stdlib.a' '-Llwt' '-Lubase' '-L/usr/lib64/ocaml/lablgtk2' '-L/usr/lib64/ocaml' '-llablgtk2' '-lgtk-x11-2.0' '-lgdk-x11-2.0' '-latk-1.0' '-lgdk_pixbuf-2.0' '-lm' '-lpangocairo-1.0' '-lpango-1.0' '-lcairo' '-lgobject-2.0' '-lgmodule-2.0' '-ldl' '-lglib-2.0' '-lstr' '-lunix' '-lutil' 'osxsupport.o' 'pty.o' '/usr/lib64/ocaml/libasmrun.a' -lm -ldl pty.o: In function `c_openpty': pty.c:(.text+0x17): undefined reference to `openpty' collect2: ld returned 1 exit status Error during linking make: *** [unison] Error 2 !!! ERROR in net-misc/unison-2.17.1-r1: !!! In src_compile at line 3108 !!! error making unsion
Created attachment 128438 [details, diff] unison-2.17.1-as-needed.patch -lutil must be after pty.o
I just encountered the same problem on my ~amd64 system. Any idea when this may hit portage?
Oops, I forgot to mention that the patch fixed the problem.
I'm getting the exact same error with unison-2.13.16 and use "--as-needed", as well. The particular machine I'm trying to rebuild unison on is running an amd64 install. I removed "--as-needed" from my LDFLAGS but unison would still not compile. I then stripped out all LDFLAGS I had in make.conf but unison would still not compile. I also, stripped down my CFLAGS but got the same error. I tried building unison-2.12.0-r1 but got the same results. This patch did fix the problem for unison-2.13.16 and unison-2.17.1-r1, however, I don't think the cause of this is due to "--as-needed".
unison is written in ocaml. Try to rebuild ocaml without --as-needed and then build unison...
*** Bug 193489 has been marked as a duplicate of this bug. ***
applied for 2.27.57, please dont forget to send it upstream as it was still needed for that version
dev-zero, maybe you want to send it upstream. I don't find an easy way to contact upstream and I don't even use unison.