From 1f4feb7c6f2bb7d257e860b2d8413a746fbe50c8 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sun, 1 Jan 2023 11:12:23 -0600 Subject: avr-gcc: fix build on Darwin Adds a patch which fixes a compilation error generated by Clang 11 compiling GCC 11.3. --- .../compilers/gcc/11/avr-gcc-11.3-darwin.patch | 20 ++++++++++++++++++++ pkgs/development/compilers/gcc/11/default.nix | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/development/compilers/gcc/11/avr-gcc-11.3-darwin.patch (limited to 'pkgs') diff --git a/pkgs/development/compilers/gcc/11/avr-gcc-11.3-darwin.patch b/pkgs/development/compilers/gcc/11/avr-gcc-11.3-darwin.patch new file mode 100644 index 00000000000..787862fbcff --- /dev/null +++ b/pkgs/development/compilers/gcc/11/avr-gcc-11.3-darwin.patch @@ -0,0 +1,20 @@ +--- a/gcc/config/avr/avr.c 2022-10-08 19:18:33.000000000 +0200 ++++ b/gcc/config/avr/avr.patched.c 2022-10-08 19:19:34.000000000 +0200 +@@ -10196,7 +10196,7 @@ + to track need of __do_copy_data. */ + + static void +-avr_output_data_section_asm_op (const void *data) ++avr_output_data_section_asm_op (const char *data) + { + avr_need_copy_data_p = true; + +@@ -10209,7 +10209,7 @@ + to track need of __do_clear_bss. */ + + static void +-avr_output_bss_section_asm_op (const void *data) ++avr_output_bss_section_asm_op (const char *data) + { + avr_need_clear_bss_p = true; + diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index de764b9ccc7..20b9c32bdf8 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -72,6 +72,8 @@ let majorVersion = "11"; sha256 = "sha256-LFAXUEoYD7YeCG8V9mWanygyQOI7U5OhCRIKOVCCDAg="; }) ] + # https://github.com/osx-cross/homebrew-avr/issues/280#issuecomment-1272381808 + ++ optional (stdenv.isDarwin && targetPlatform.isAvr) ./avr-gcc-11.3-darwin.patch # Obtain latest patch with ../update-mcfgthread-patches.sh ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch; -- cgit 1.4.1