diff options
author | Randy Eckenrode <randy@largeandhighquality.com> | 2023-11-06 16:49:22 -0500 |
---|---|---|
committer | Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com> | 2023-11-08 10:50:07 +0000 |
commit | bec14225ab79b37be29ff15cf33e135158873f0a (patch) | |
tree | 61ee4986390ac09de96c47602c1081d3ad8917dd /pkgs/development/compilers/gcc | |
parent | 93153208ccd87b7e7dcfc00b5f1a732e675ff5a6 (diff) | |
download | nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar.gz nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar.bz2 nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar.lz nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar.xz nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.tar.zst nixlib-bec14225ab79b37be29ff15cf33e135158873f0a.zip |
gcc{48,49,6,7,8,9,10}: fix missing symbol errors on x86_64-darwin
The x86_64-darwin build fails with the following symbol errors when building gencondmd: Undefined symbols for architecture x86_64: "_ix86_excess_precision", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_fpmath", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_isa_flags", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_unsafe_math_optimizations", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_target_flags", referenced from: ___cxx_global_var_init.101 in gencondmd.o This commit applies a workaround posted to the GCC BugZilla. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061.
Diffstat (limited to 'pkgs/development/compilers/gcc')
-rw-r--r-- | pkgs/development/compilers/gcc/patches/clang-genconditions.patch | 34 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/patches/default.nix | 3 |
2 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/development/compilers/gcc/patches/clang-genconditions.patch b/pkgs/development/compilers/gcc/patches/clang-genconditions.patch new file mode 100644 index 000000000000..655afd2abbc2 --- /dev/null +++ b/pkgs/development/compilers/gcc/patches/clang-genconditions.patch @@ -0,0 +1,34 @@ +From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061#c5 + +--- a/gcc/genconditions.c 2019-01-01 12:37:19.064943662 +0100 ++++ b/gcc/genconditions.c 2019-10-11 10:57:11.464595789 +0200 +@@ -57,8 +57,9 @@ write_header (void) + \n\ + /* It is necessary, but not entirely safe, to include the headers below\n\ + in a generator program. As a defensive measure, don't do so when the\n\ +- table isn't going to have anything in it. */\n\ +-#if GCC_VERSION >= 3001\n\ ++ table isn't going to have anything in it.\n\ ++ Clang 9 is buggy and doesn't handle __builtin_constant_p correctly. */\n\ ++#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\ + \n\ + /* Do not allow checking to confuse the issue. */\n\ + #undef CHECKING_P\n\ +@@ -170,7 +171,7 @@ struct c_test\n\ + vary at run time. It works in 3.0.1 and later; 3.0 only when not\n\ + optimizing. */\n\ + \n\ +-#if GCC_VERSION >= 3001\n\ ++#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\ + static const struct c_test insn_conditions[] = {\n"); + + traverse_c_tests (write_one_condition, 0); +@@ -191,7 +192,7 @@ write_writer (void) + " unsigned int i;\n" + " const char *p;\n" + " puts (\"(define_conditions [\");\n" +- "#if GCC_VERSION >= 3001\n" ++ "#if GCC_VERSION >= 3001 && __clang_major__ < 9\n" + " for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n" + " {\n" + " printf (\" (%d \\\"\", insn_conditions[i].value);\n" diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index 4325c9f81677..2dd480fc6e57 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -194,6 +194,9 @@ in sha256 = "sha256-XtykrPd5h/tsnjY1wGjzSOJ+AyyNLsfnjuOZ5Ryq9vA="; }) +# Fix undefined symbol errors when building older versions with clang +++ optional (!atLeast11 && stdenv.cc.isClang) ./clang-genconditions.patch + ## gcc 9.0 and older ############################################################################## |