From e9e734bf1710f2bd38e7a63b0f098873139a11b4 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 3 Jun 2022 13:43:06 +0100 Subject: [PATCH] openjfx11, openjfx15: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here openjfx17 is not affected. --- .../development/compilers/openjdk/openjfx/11.nix | 5 ++++- .../development/compilers/openjdk/openjfx/15.nix | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/openjdk/openjfx/11.nix b/pkgs/development/compilers/openjdk/openjfx/11.nix index ff243372b4a..7a01486e2dd 100644 --- a/pkgs/development/compilers/openjdk/openjfx/11.nix +++ b/pkgs/development/compilers/openjdk/openjfx/11.nix @@ -92,7 +92,10 @@ in makePackage { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + # -fcommon: gstreamer workaround for -fno-common toolchains: + # ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of + # `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS -fcommon"; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/15.nix b/pkgs/development/compilers/openjdk/openjfx/15.nix index 3feda519b08..74f83fdabf1 100644 --- a/pkgs/development/compilers/openjdk/openjfx/15.nix +++ b/pkgs/development/compilers/openjdk/openjfx/15.nix @@ -31,8 +31,15 @@ let JDK_HOME = ${openjdk11_headless.home} '' + args.gradleProperties or ""); - #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc. - NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + NIX_CFLAGS_COMPILE = [ + #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc. + "-DGLIB_DISABLE_DEPRECATION_WARNINGS" + + # gstreamer workaround for -fno-common toolchains: + # ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of + # `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here + "-fcommon" + ]; buildPhase = '' runHook preBuild @@ -89,7 +96,10 @@ in makePackage { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + # -fcommon: gstreamer workaround for -fno-common toolchains: + # ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of + # `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS -fcommon"; stripDebugList = [ "." ];