ygrek / mldonkey

cross-platform multi-network p2p daemon
http://mldonkey.sourceforge.net/
Other
235 stars 43 forks source link

Failure to compile #71

Closed superbonaci closed 2 years ago

superbonaci commented 2 years ago

Get this error when compiling:

$ make
[]
-I build    build/extlib.cmxa    build/cdk.cmxa    build/bitstring.cmxa    build/magic.cmxa    build/common.cmxa    build/client.cmxa    build/core.cmxa    build/driver.cmxa    src/daemon/common/commonMain.cmx  
/usr/bin/ld: build/core.a(donkeyClient.o): in function `camlDonkeyClient__hash_1966':
:(.text+0x5162): undefined reference to `caml_hash_univ_param'
/usr/bin/ld: build/core.a(donkeyClient.o): in function `camlDonkeyClient__1':
:(.data+0x8728): undefined reference to `caml_hash_univ_param'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
make: *** [Makefile:2739: mlnet] Error 2
FabioLolix commented 2 years ago

I have the same error on Manjaro building with this pkgbuild https://github.com/FabioLolix/PKGBUILD-AUR_fix/blob/master/m/mldonkey-git/PKGBUILD (same with stable version and with or without external patches applied)

ygrek commented 2 years ago

please provide full configure and build log, otherwise it is a guesswork

ygrek commented 2 years ago

caml_hash_univ_param was removed in OCaml 4.12 but mldonkey doesn't build with 4.12 anyway yet. So my speculation for now is that your build environment has several ocaml versions and something gets mixed up during build.

ygrek commented 2 years ago

I see archlinux does disable safe-string https://github.com/archlinux/svntogit-packages/blob/master/ocaml/trunk/PKGBUILD ftr duplicate https://github.com/ygrek/mldonkey/issues/60

perfect7gentleman commented 2 years ago

patch

--- a/src/networks/donkey/donkeyClient.ml   2021-09-25 10:11:48.211287053 +0700
+++ b/src/networks/donkey/donkeyClient.ml   2021-09-25 10:12:32.348854429 +0700
@@ -810,10 +810,6 @@
           query_id ip port id
         end

-
-external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
-let hash x = hash_param 10 100 x
-
 let shared_of_file file =
   match file.file_shared with
     | None  -> None
ygrek commented 2 years ago

yes, just tested this is enough

ygrek commented 2 years ago

thanks for report

FabioLolix commented 2 years ago

Thanks @ygrek, pkgbuild have been fixed too, what do you say of releasing a new patch release?