Skip to content

Commit

Permalink
gcc12: disable libsanitizer for mips64
Browse files Browse the repository at this point in the history
    Without the change build on mips64-unknown-linux-gnu fails as:

        $ nix-build -A buildPackages.gcc12 --argstr crossSystem mips64-linux

        In file included from ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/bits/stat.h:25,
                         from ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/fcntl.h:78,
                         from ../../../../gcc-12.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:55:
        ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/bits/struct_stat.h:190:8: error: redefinition of 'struct stat64'
          190 | struct stat64
              |        ^~~~~~
  • Loading branch information
trofi committed Jun 14, 2023
1 parent ddb6fe5 commit 6cec030
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ lib.pipe (stdenv.mkDerivation ({

configurePlatforms = [ "build" "host" "target" ];

configureFlags = callFile ../common/configure-flags.nix { };
configureFlags = callFile ../common/configure-flags.nix { }
# On mips64-unknown-linux-gnu libsanitizer defines collide with
# glibc's definitions and fail the build. It was fixed in gcc-13+.
++ lib.optionals targetPlatform.isMips [ "--disable-libsanitizer" ];

targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;

Expand Down

0 comments on commit 6cec030

Please sign in to comment.