Skip to content

Commit f3139e9

Browse files
committed
Merge "Bump gcc to gcc10 and binutils to 2.34 #89793" into staging-next
2 parents 92cc194 + 22daf1c commit f3139e9

48 files changed

Lines changed: 433 additions & 1668 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{ stdenv, fetchurl, cmake }:
22

33
stdenv.mkDerivation rec {
4-
version = "0.6.1";
4+
version = "0.6.3";
55
pname = "game-music-emu";
66

77
src = fetchurl {
8-
url = "https://bitbucket.org/mpyne/game-music-emu/downloads/${pname}-${version}.tar.bz2";
9-
sha256 = "08fk7zddpn7v93d0fa7fcypx7hvgwx9b5psj9l6m8b87k2hbw4fw";
8+
url = "https://bitbucket.org/mpyne/game-music-emu/downloads/${pname}-${version}.tar.xz";
9+
sha256 = "07857vdkak306d9s5g6fhmjyxk7vijzjhkmqb15s7ihfxx9lx8xb";
1010
};
1111

1212
buildInputs = [ cmake ];
@@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
1616
description = "A collection of video game music file emulators";
1717
license = licenses.lgpl21Plus;
1818
platforms = platforms.all;
19-
maintainers = [ ];
19+
maintainers = with maintainers; [ luc65r ];
2020
};
2121
}

pkgs/development/compilers/gcc/common/configure-flags.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ let
7373
"--enable-libssp"
7474
"--disable-nls"
7575
# To keep ABI compatibility with upstream mingw-w64
76-
"--enable-fully-dynamic-string"
76+
"--enable-fully-dynamic-string"
7777
] ++ lib.optionals (crossMingw && targetPlatform.isx86_32) [
7878
# See Note [Windows Exception Handling]
7979
"--enable-sjlj-exceptions"
@@ -187,13 +187,16 @@ let
187187
"--disable-symvers"
188188
"libat_cv_have_ifunc=no"
189189
"--disable-gnu-indirect-function"
190-
]
190+
]
191191
++ lib.optionals langJit [
192192
"--enable-host-shared"
193-
]
193+
]
194194
++ lib.optionals (langD) [
195195
"--with-target-system-zlib=yes"
196196
]
197+
# Make -fcommon default on gcc10
198+
# TODO: fix all packages (probably 100+) and remove that
199+
++ lib.optional (version >= "10.1.0") "--with-specs=%{!fno-common:%{!fcommon:-fcommon}}"
197200
;
198201

199202
in configureFlags
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
From 9b5a023a5dc3127da15253f7acad71019395ebe1 Mon Sep 17 00:00:00 2001
2+
From: Pablo Galindo <Pablogsal@gmail.com>
3+
Date: Thu, 8 Oct 2020 19:50:37 +0100
4+
Subject: [PATCH] [3.7] bpo-41976: Fix the fallback to gcc of
5+
ctypes.util.find_library when using gcc>9 (GH-22598). (GH-22601)
6+
7+
(cherry picked from commit 27ac19cca2c639caaf6fedf3632fe6beb265f24f)
8+
9+
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
10+
---
11+
Lib/ctypes/test/test_find.py | 12 ++++++-
12+
Lib/ctypes/util.py | 32 +++++++++++++++----
13+
.../2020-10-08-18-22-28.bpo-41976.Svm0wb.rst | 3 ++
14+
3 files changed, 39 insertions(+), 8 deletions(-)
15+
create mode 100644 Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
16+
17+
diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
18+
index b99fdcba7b28f..92ac1840ad7d4 100644
19+
--- a/Lib/ctypes/test/test_find.py
20+
+++ b/Lib/ctypes/test/test_find.py
21+
@@ -1,4 +1,5 @@
22+
import unittest
23+
+import unittest.mock
24+
import os.path
25+
import sys
26+
import test.support
27+
@@ -72,7 +73,7 @@ def test_shell_injection(self):
28+
29+
@unittest.skipUnless(sys.platform.startswith('linux'),
30+
'Test only valid for Linux')
31+
-class LibPathFindTest(unittest.TestCase):
32+
+class FindLibraryLinux(unittest.TestCase):
33+
def test_find_on_libpath(self):
34+
import subprocess
35+
import tempfile
36+
@@ -111,6 +112,15 @@ def test_find_on_libpath(self):
37+
# LD_LIBRARY_PATH)
38+
self.assertEqual(find_library(libname), 'lib%s.so' % libname)
39+
40+
+ def test_find_library_with_gcc(self):
41+
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
42+
+ self.assertNotEqual(find_library('c'), None)
43+
+
44+
+ def test_find_library_with_ld(self):
45+
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
46+
+ unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
47+
+ self.assertNotEqual(find_library('c'), None)
48+
+
49+
50+
if __name__ == "__main__":
51+
unittest.main()
52+
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
53+
index 97973bce001d9..0c2510e1619c8 100644
54+
--- a/Lib/ctypes/util.py
55+
+++ b/Lib/ctypes/util.py
56+
@@ -93,6 +93,12 @@ def find_library(name):
57+
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
58+
import re, tempfile
59+
60+
+ def _is_elf(filename):
61+
+ "Return True if the given file is an ELF file"
62+
+ elf_header = b'\x7fELF'
63+
+ with open(filename, 'br') as thefile:
64+
+ return thefile.read(4) == elf_header
65+
+
66+
def _findLib_gcc(name):
67+
# Run GCC's linker with the -t (aka --trace) option and examine the
68+
# library name it prints out. The GCC command will fail because we
69+
@@ -299,17 +312,22 @@ def _findLib_ld(name):
70+
stderr=subprocess.PIPE,
71+
universal_newlines=True)
72+
out, _ = p.communicate()
73+
- res = re.search(expr, os.fsdecode(out))
74+
- if res:
75+
- result = res.group(0)
76+
- except Exception as e:
77+
+ res = re.findall(expr, os.fsdecode(out))
78+
+ for file in res:
79+
+ # Check if the given file is an elf file: gcc can report
80+
+ # some files that are linker scripts and not actual
81+
+ # shared objects. See bpo-41976 for more details
82+
+ if not _is_elf(file):
83+
+ continue
84+
+ return os.fsdecode(file)
85+
+ except Exception:
86+
pass # result will be None
87+
return result
88+
89+
def find_library(name):
90+
# See issue #9998
91+
return _findSoname_ldconfig(name) or \
92+
- _get_soname(_findLib_gcc(name) or _findLib_ld(name))
93+
+ _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
94+
95+
################################################################
96+
# test code
97+
diff --git a/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
98+
new file mode 100644
99+
index 0000000000000..c8b3fc771845e
100+
--- /dev/null
101+
+++ b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
102+
@@ -0,0 +1,3 @@
103+
+Fixed a bug that was causing :func:`ctypes.util.find_library` to return
104+
+``None`` when triying to locate a library in an environment when gcc>=9 is
105+
+available and ``ldconfig`` is not. Patch by Pablo Galindo

pkgs/development/interpreters/python/cpython/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ in with passthru; stdenv.mkDerivation {
165165
] ++ [
166166
# LDSHARED now uses $CC instead of gcc. Fixes cross-compilation of extension modules.
167167
./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch
168+
] ++ optionals (isPy37 || isPy38) [
169+
# Backport a fix for ctypes.util.find_library.
170+
./3.7/find_library.patch
168171
];
169172

170173
postPatch = ''

pkgs/development/libraries/gdk-pixbuf/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ stdenv.mkDerivation rec {
109109

110110
setupHook = ./setup-hook.sh;
111111

112+
separateDebugInfo = stdenv.isLinux;
113+
112114
passthru = {
113115
updateScript = gnome3.updateScript {
114116
packageName = pname;

pkgs/development/libraries/glib/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ in
4545

4646
stdenv.mkDerivation rec {
4747
pname = "glib";
48-
version = "2.66.3";
48+
version = "2.66.4";
4949

5050
src = fetchurl {
5151
url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
52-
sha256 = "1cdmyyycw2mf5s0f5sfd59q91223s4smcqi8n2fwrccwm5ji7wvr";
52+
sha256 = "l9+GcOMvn9T3OSsJgOZh3WJQEgFdWDUNoeWOND9K+YQ=";
5353
};
5454

5555
patches = optionals stdenv.isDarwin [

pkgs/development/libraries/glibc/common.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ stdenv.mkDerivation ({
214214
configureScript="`pwd`/../$sourceRoot/configure"
215215
216216
${lib.optionalString (stdenv.cc.libc != null)
217-
''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib"''
217+
''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib OBJDUMP=${stdenv.cc.bintools.bintools}/bin/objdump"''
218218
}
219219
220220

pkgs/development/libraries/lcms/default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{stdenv, fetchurl}:
22

3-
stdenv.mkDerivation {
4-
name = "lcms-1.19";
3+
stdenv.mkDerivation rec {
4+
pname = "lcms";
5+
version = "1.19";
56

67
src = fetchurl {
7-
url = "http://www.littlecms.com/lcms-1.19.tar.gz";
8+
url = "mirror://sourceforge/lcms/${pname}-${version}.tar.gz";
89
sha256 = "1abkf8iphwyfs3z305z3qczm3z1i9idc1lz4gvfg92jnkz5k5bl0";
910
};
1011

pkgs/development/libraries/libbfd/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
1010
outputs = [ "out" "dev" ];
1111

1212
patches = binutils-unwrapped.patches ++ [
13-
(binutils-unwrapped.patchesDir + "/build-components-separately.patch")
13+
../../tools/misc/binutils/build-components-separately.patch
1414
(fetchpatch {
1515
url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
1616
sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";

pkgs/development/libraries/libgcrypt/default.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ stdenv.mkDerivation rec {
3434
# aarch64
3535
configurePlatforms = [ "host" "build" ];
3636

37+
postConfigure = ''
38+
sed -i configure \
39+
-e 's/NOEXECSTACK_FLAGS=$/NOEXECSTACK_FLAGS="-Wa,--noexecstack"/'
40+
'';
41+
3742
# Make sure libraries are correct for .pc and .la files
3843
# Also make sure includes are fixed for callers who don't use libgpgcrypt-config
3944
postFixup = ''

0 commit comments

Comments
 (0)