@@ -284,7 +284,7 @@ stdenv.mkDerivation ({
284284 # only use the links hack if we're actually building dylibs. otherwise, the
285285 # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes
286286 # "ln -s $out/lib/links", which tries to recreate the links dir and fails
287− + (optionalString (stdenv.isDarwin && enableSharedLibraries) ''
287+ + (optionalString (stdenv.isDarwin && (enableSharedLibraries || enableSharedExecutables)) ''
288288 # Work around a limit in the macOS Sierra linker on the number of paths
289289 # referenced by any one dynamic library:
290290 #