about summary refs log tree commit diff
path: root/pkgs/applications/emulators/retroarch/default.nix
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-06-10 09:18:09 +0100
committerSergei Trofimovich <slyich@gmail.com>2022-06-10 09:18:41 +0100
commit6130c92db65606145f7d7f869f08f59f37af5edf (patch)
tree15989534867d2c650639ad472e9948d8d22c9b47 /pkgs/applications/emulators/retroarch/default.nix
parent19e8b063a968b4d8e25f2f9edaf78808f7503e19 (diff)
retroarchBare: add -fcommon workaround
Workaround build failure on -fno-common toolchains like upstream
gcc-10 or llvm-11. Otherwise build fails as:

    duplicate symbol '_apple_platform' in:ui_cocoa.o cocoa_common.o
Diffstat (limited to 'pkgs/applications/emulators/retroarch/default.nix')
-rw-r--r--pkgs/applications/emulators/retroarch/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/applications/emulators/retroarch/default.nix b/pkgs/applications/emulators/retroarch/default.nix
index e9aa7d80d57fc..0a078f68c7a35 100644
--- a/pkgs/applications/emulators/retroarch/default.nix
+++ b/pkgs/applications/emulators/retroarch/default.nix
@@ -126,7 +126,12 @@ stdenv.mkDerivation rec {
 
   # Workaround for the following error affecting newer versions of Clang:
   # ./config.def.h:xxx:x: error: 'TARGET_OS_TV' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
-  NIX_CFLAGS_COMPILE = lib.optional stdenv.cc.isClang [ "-Wno-undef-prefix" ];
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-Wno-undef-prefix" ]
+    # Workaround build failure on -fno-common toolchains:
+    #   duplicate symbol '_apple_platform' in:ui_cocoa.o cocoa_common.o
+    # TODO: drop when upstream gets a fix for it:
+    #   https://github.com/libretro/RetroArch/issues/14025
+    ++ lib.optionals stdenv.isDarwin [ "-fcommon" ];
 
   meta = with lib; {
     homepage = "https://libretro.com";