diff --git a/pkgs/development/compilers/ocaml/4.00.1.nix b/pkgs/development/compilers/ocaml/4.00.1.nix index abc5ff14bf29..2033cbc32d23 100644 --- a/pkgs/development/compilers/ocaml/4.00.1.nix +++ b/pkgs/development/compilers/ocaml/4.00.1.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation rec { sha256 = "sha256:07g9q9sjk4xsbqix7jxggfp36v15pmqw4bms80g5car0hfbszirn"; })]; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; + prefixKey = "-prefix "; configureFlags = [ "-no-tk" ] ++ optionals useX11 [ "-x11lib" xlibsWrapper ]; buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix index c19f03c5d164..801e12d1549b 100644 --- a/pkgs/development/compilers/ocaml/4.01.0.nix +++ b/pkgs/development/compilers/ocaml/4.01.0.nix @@ -10,4 +10,10 @@ import ./generic.nix { sha256 = "sha256:08mpy7lsiwv8m5qrqc4xzyiv2hri5713gz2qs1nfz02hz1bd79mc"; } ]; sha256 = "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7"; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.02.nix b/pkgs/development/compilers/ocaml/4.02.nix index 9610b7825760..42b9e21108d8 100644 --- a/pkgs/development/compilers/ocaml/4.02.nix +++ b/pkgs/development/compilers/ocaml/4.02.nix @@ -10,4 +10,10 @@ import ./generic.nix { sha256 = "sha256:12sw512kpwk0xf2g6j0h5vqgd8xcmgrvgyilx6fxbd6bnfv1yib9"; } ]; sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3"; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.03.nix b/pkgs/development/compilers/ocaml/4.03.nix index 9f6c24014ea1..ea0a23502fed 100644 --- a/pkgs/development/compilers/ocaml/4.03.nix +++ b/pkgs/development/compilers/ocaml/4.03.nix @@ -9,4 +9,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/a8b2cc3b40f5269ce8525164ec2a63b35722b22b.patch"; sha256 = "sha256:1rrknmrk86xrj2k3hznnjk1gwnliyqh125zabg1hvy6dlvml9b0x"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.04.nix b/pkgs/development/compilers/ocaml/4.04.nix index 7fa1367a5125..6d92ba187706 100644 --- a/pkgs/development/compilers/ocaml/4.04.nix +++ b/pkgs/development/compilers/ocaml/4.04.nix @@ -12,4 +12,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/6bcff7e6ce1a43e088469278eb3a9341e6a2ca5b.patch"; sha256 = "sha256:1hd45f7mwwrrym2y4dbcwklpv0g94avbz7qrn81l7w8mrrj3bngi"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.05.nix b/pkgs/development/compilers/ocaml/4.05.nix index 60cd6c359993..332aa7399009 100644 --- a/pkgs/development/compilers/ocaml/4.05.nix +++ b/pkgs/development/compilers/ocaml/4.05.nix @@ -12,4 +12,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/50c2d1275e537906ea144bd557fde31e0bf16e5f.patch"; sha256 = "sha256:0ck9b2dpgg5k2p9ndbgniql24h35pn1bbpxjvk69j715lswzy4mh"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.06.nix b/pkgs/development/compilers/ocaml/4.06.nix index 0f5e0a2d70be..6e06ad585b2c 100644 --- a/pkgs/development/compilers/ocaml/4.06.nix +++ b/pkgs/development/compilers/ocaml/4.06.nix @@ -12,4 +12,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/137a4ad167f25fe1bee792977ed89f30d19bcd74.patch"; sha256 = "sha256:0izsf6rm3677vbbx0snkmn9pkfcsayrdwz3ipiml5wjiaysnchjz"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.07.nix b/pkgs/development/compilers/ocaml/4.07.nix index 8292213bf46d..1356a2b3c8e4 100644 --- a/pkgs/development/compilers/ocaml/4.07.nix +++ b/pkgs/development/compilers/ocaml/4.07.nix @@ -12,4 +12,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/00b8c4d503732343d5d01761ad09650fe50ff3a0.patch"; sha256 = "sha256:02cfya5ff5szx0fsl5x8ax76jyrla9zmf3qxavf3adhwq5ssrfcv"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; } diff --git a/pkgs/development/compilers/ocaml/4.08.nix b/pkgs/development/compilers/ocaml/4.08.nix index 3c4cf0a71255..9ab19a612671 100644 --- a/pkgs/development/compilers/ocaml/4.08.nix +++ b/pkgs/development/compilers/ocaml/4.08.nix @@ -15,4 +15,10 @@ import ./generic.nix { { url = "https://github.com/ocaml/ocaml/commit/17df117b4939486d3285031900587afce5262c8c.patch"; sha256 = "sha256:1b3jc6sj2k23yvfwrv6nc1f4x2n2biqbhbbp74aqb6iyqyjsq35n"; } ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of + # `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; }