From 5982591afc07480808d9c71a5b97463fc4cc9943 Mon Sep 17 00:00:00 2001 From: Evgeny Egorochkin Date: Tue, 29 Mar 2016 22:46:22 +0300 Subject: [PATCH 1/8] binutils: cherry-pick a patch from master; this fixes build failure for akonadi; see https://sourceware.org/bugzilla/show_bug.cgi?id=19698 --- .../tools/misc/binutils/default.nix | 3 + .../binutils/fix-update-symbol-version.patch | 106 ++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 pkgs/development/tools/misc/binutils/fix-update-symbol-version.patch diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 89dd269b8cc1..9bcb87dd789e 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -35,6 +35,9 @@ stdenv.mkDerivation rec { # Bug fix backported from binutils master. ./fix-bsymbolic.patch + + # Bug fix backported from binutils master. + ./fix-update-symbol-version.patch ]; outputs = [ "out" "info" ]; diff --git a/pkgs/development/tools/misc/binutils/fix-update-symbol-version.patch b/pkgs/development/tools/misc/binutils/fix-update-symbol-version.patch new file mode 100644 index 000000000000..ca7dcf969f37 --- /dev/null +++ b/pkgs/development/tools/misc/binutils/fix-update-symbol-version.patch @@ -0,0 +1,106 @@ +NOTE: removed Changelog diffs to avoid the patch failing to apply + +From 544ddf9322b1b83982e5cb84a54d084ee7e718ea Mon Sep 17 00:00:00 2001 +From: H.J. Lu +Date: Wed, 24 Feb 2016 15:13:35 -0800 +Subject: [PATCH] Update symbol version for symbol from linker script + +We need to update symbol version for symbols from linker script. + +Backport from master + +bfd/ + + PR ld/19698 + * elflink.c (bfd_elf_record_link_assignment): Set versioned if + symbol version is unknown. + +ld/ + + PR ld/19698 + * testsuite/ld-elf/pr19698.d: New file. + * testsuite/ld-elf/pr19698.s: Likewise. + * testsuite/ld-elf/pr19698.t: Likewise. +--- + bfd/ChangeLog | 9 +++++++++ + bfd/elflink.c | 13 +++++++++++++ + ld/ChangeLog | 10 ++++++++++ + ld/testsuite/ld-elf/pr19698.d | 10 ++++++++++ + ld/testsuite/ld-elf/pr19698.s | 5 +++++ + ld/testsuite/ld-elf/pr19698.t | 11 +++++++++++ + 6 files changed, 58 insertions(+), 0 deletions(-) + create mode 100644 ld/testsuite/ld-elf/pr19698.d + create mode 100644 ld/testsuite/ld-elf/pr19698.s + create mode 100644 ld/testsuite/ld-elf/pr19698.t + +diff --git a/bfd/elflink.c b/bfd/elflink.c +index ae8d148..8fcaadd 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -555,6 +555,19 @@ bfd_elf_record_link_assignment (bfd *output_bfd, + if (h == NULL) + return provide; + ++ if (h->versioned == unknown) ++ { ++ /* Set versioned if symbol version is unknown. */ ++ char *version = strrchr (name, ELF_VER_CHR); ++ if (version) ++ { ++ if (version > name && version[-1] != ELF_VER_CHR) ++ h->versioned = versioned_hidden; ++ else ++ h->versioned = versioned; ++ } ++ } ++ + switch (h->root.type) + { + case bfd_link_hash_defined: +diff --git a/ld/testsuite/ld-elf/pr19698.d b/ld/testsuite/ld-elf/pr19698.d +new file mode 100644 +index 0000000..a39f67a +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.d +@@ -0,0 +1,10 @@ ++#ld: -shared $srcdir/$subdir/pr19698.t ++#readelf : --dyn-syms --wide ++#target: *-*-linux* *-*-gnu* *-*-solaris* ++ ++Symbol table '\.dynsym' contains [0-9]+ entries: ++#... ++ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@VERS.1 ++#... ++ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@@VERS.2 ++#pass +diff --git a/ld/testsuite/ld-elf/pr19698.s b/ld/testsuite/ld-elf/pr19698.s +new file mode 100644 +index 0000000..875dca4 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.s +@@ -0,0 +1,5 @@ ++ .text ++ .globl foo ++ .type foo, %function ++foo: ++ .byte 0 +diff --git a/ld/testsuite/ld-elf/pr19698.t b/ld/testsuite/ld-elf/pr19698.t +new file mode 100644 +index 0000000..09d9125 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.t +@@ -0,0 +1,11 @@ ++"foo@VERS.1" = foo; ++ ++VERSION { ++VERS.2 { ++ global: ++ foo; ++}; ++ ++VERS.1 { ++}; ++} +-- +1.7.1 + From 60f07e8e109456c083c95fbf6618b38628e17956 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 31 Mar 2016 12:30:54 +0200 Subject: [PATCH 2/8] Revert "gcc: Use the pre-C++11 ABI by default" This reverts commit 83011723af5cf666db4cd10c14f9162b0a463fa1. This never worked because gcc's setup hook is never actually sourced. I could fix this but since nobody complained, we probably don't need it. --- pkgs/development/compilers/gcc/5/default.nix | 2 -- pkgs/development/compilers/gcc/5/use-old-abi.sh | 1 - 2 files changed, 3 deletions(-) delete mode 100644 pkgs/development/compilers/gcc/5/use-old-abi.sh diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 53e64fe8abc6..3b105143c0bf 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -495,8 +495,6 @@ stdenv.mkDerivation ({ inherit (stdenv) is64bit; - setupHook = ./use-old-abi.sh; - meta = { homepage = http://gcc.gnu.org/; license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/5/use-old-abi.sh b/pkgs/development/compilers/gcc/5/use-old-abi.sh deleted file mode 100644 index 3a0c996033a9..000000000000 --- a/pkgs/development/compilers/gcc/5/use-old-abi.sh +++ /dev/null @@ -1 +0,0 @@ -NIX_CFLAGS_COMPILE+=" -D_GLIBCXX_USE_CXX11_ABI=0" From f752424924478722229751fa3302de52fdbe214a Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 28 Mar 2016 13:27:06 +0300 Subject: [PATCH 3/8] qt55.qtbase: use more system libraries --- pkgs/development/libraries/qt-5/5.5/qtbase/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix index e6927ffb9ca4..ffa0a95be2c0 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix @@ -3,8 +3,8 @@ , xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi , xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon -, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre -, zlib, libjpeg, libpng, libtiff, sqlite, icu +, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre16 +, zlib, libjpeg, libpng, libtiff, sqlite, icu, harfbuzz , coreutils, bison, flex, gdb, gperf, lndir, ruby , python, perl, pkgconfig @@ -164,8 +164,10 @@ stdenv.mkDerivation { -system-zlib -system-libpng -system-libjpeg + -system-harfbuzz -system-xcb -system-xkbcommon + -system-pcre -openssl-linked -dbus-linked @@ -186,8 +188,8 @@ stdenv.mkDerivation { propagatedBuildInputs = [ xlibs.libXcomposite libX11 libxcb libXext libXrender libXi - fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre - zlib libjpeg libpng libtiff sqlite icu + fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre16 + zlib libjpeg libpng libtiff sqlite icu harfbuzz xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon ] # Qt doesn't directly need GLU (just GL), but many apps use, it's small and From 7f336a45132815d0968f2b45c5713c627a218062 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 31 Mar 2016 14:33:09 -0500 Subject: [PATCH 4/8] qtbase: unset QT_PLUGIN_PATH after loading --- .../libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch index 470526b1dcdb..d20767a38e5b 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch +++ b/pkgs/development/libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch @@ -2,10 +2,11 @@ Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplica =================================================================== --- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/corelib/kernel/qcoreapplication.cpp +++ qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplication.cpp -@@ -2498,6 +2498,21 @@ QStringList QCoreApplication::libraryPat +@@ -2498,6 +2498,22 @@ QStringList QCoreApplication::libraryPat } } } ++ qunsetenv("QT_PLUGIN_PATH"); // do not propagate to child processes + + // Add library paths derived from NIX_PROFILES. + const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES"); From da4b9d3b6203c1bc158f875dcdc0cb3ffe0a7c0b Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 31 Mar 2016 16:08:24 -0500 Subject: [PATCH 5/8] qtdeclarative: unset QML2_IMPORT_PATH after loading --- .../0001-nix-profiles-import-paths.patch | 37 ------------------- .../qt-5/5.5/qtdeclarative/default.nix | 4 +- .../nix-profiles-import-paths.patch | 0 .../libraries/qt-5/5.5/qtdeclarative/series | 1 + 4 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.5/qtdeclarative/0001-nix-profiles-import-paths.patch create mode 100644 pkgs/development/libraries/qt-5/5.5/qtdeclarative/nix-profiles-import-paths.patch create mode 100644 pkgs/development/libraries/qt-5/5.5/qtdeclarative/series diff --git a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/0001-nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/0001-nix-profiles-import-paths.patch deleted file mode 100644 index 8e86f97a9477..000000000000 --- a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/0001-nix-profiles-import-paths.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3f6fa74067aacd0e595e45b4ef7ce754514cb205 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -Date: Sat, 17 Oct 2015 09:28:18 -0500 -Subject: [PATCH] nix profiles import paths - ---- - src/qml/qml/qqmlimport.cpp | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp -index 5a54609..f33c2f9 100644 ---- a/src/qml/qml/qqmlimport.cpp -+++ b/src/qml/qml/qqmlimport.cpp -@@ -1549,6 +1549,20 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) - QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); - addImportPath(installImportsPath); - -+ // Add import paths derived from NIX_PROFILES. -+ const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES"); -+ if (!nixProfilesEnv.isEmpty()) { -+ QLatin1Char pathSep(' '); -+ QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts); -+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) { -+ it->append("/lib/qt5/qml"); -+ QString canonicalPath = QDir(*it).canonicalPath(); -+ if (!canonicalPath.isEmpty()) { -+ addImportPath(canonicalPath); -+ } -+ } -+ } -+ - // env import paths - QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH"); - if (!envImportPath.isEmpty()) { --- -2.5.2 - diff --git a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/default.nix b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/default.nix index 9181c37b2258..328d8aee72bd 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/default.nix +++ b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/default.nix @@ -1,8 +1,8 @@ -{ qtSubmodule, python, qtbase, qtsvg, qtxmlpatterns }: +{ qtSubmodule, lib, copyPathsToStore, python, qtbase, qtsvg, qtxmlpatterns }: qtSubmodule { name = "qtdeclarative"; - patches = [ ./0001-nix-profiles-import-paths.patch ]; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); qtInputs = [ qtbase qtsvg qtxmlpatterns ]; nativeBuildInputs = [ python ]; } diff --git a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/nix-profiles-import-paths.patch new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/development/libraries/qt-5/5.5/qtdeclarative/series b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/series new file mode 100644 index 000000000000..7dbe197c56e0 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.5/qtdeclarative/series @@ -0,0 +1 @@ +nix-profiles-import-paths.patch From 314792d9eb92b6dcce57750b9811c8ff5794213e Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 31 Mar 2016 16:12:35 -0500 Subject: [PATCH 6/8] qtquick1: unset QML_IMPORT_PATH after loading --- .../0001-nix-profiles-import-paths.patch | 37 ------------------- .../libraries/qt-5/5.5/qtquick1/default.nix | 4 +- .../qtquick1/nix-profiles-import-paths.patch | 0 .../libraries/qt-5/5.5/qtquick1/series | 1 + 4 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.5/qtquick1/0001-nix-profiles-import-paths.patch create mode 100644 pkgs/development/libraries/qt-5/5.5/qtquick1/nix-profiles-import-paths.patch create mode 100644 pkgs/development/libraries/qt-5/5.5/qtquick1/series diff --git a/pkgs/development/libraries/qt-5/5.5/qtquick1/0001-nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.5/qtquick1/0001-nix-profiles-import-paths.patch deleted file mode 100644 index 63b141f6ce5a..000000000000 --- a/pkgs/development/libraries/qt-5/5.5/qtquick1/0001-nix-profiles-import-paths.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bbc706b3fcb90ca3b2b51d5e3434145572152711 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -Date: Sat, 17 Oct 2015 09:29:51 -0500 -Subject: [PATCH] nix profiles import paths - ---- - src/declarative/qml/qdeclarativeimport.cpp | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp -index 9404834..d185ed5 100644 ---- a/src/declarative/qml/qdeclarativeimport.cpp -+++ b/src/declarative/qml/qdeclarativeimport.cpp -@@ -725,6 +725,20 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) - - addImportPath(installImportsPath); - -+ // Add import paths derived from NIX_PROFILES. -+ const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES"); -+ if (!nixProfilesEnv.isEmpty()) { -+ QLatin1Char pathSep(' '); -+ QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts); -+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) { -+ it->append("/lib/qt5/imports"); -+ QString canonicalPath = QDir(*it).canonicalPath(); -+ if (!canonicalPath.isEmpty()) { -+ addImportPath(canonicalPath); -+ } -+ } -+ } -+ - // env import paths - QByteArray envImportPath = qgetenv("QML_IMPORT_PATH"); - if (!envImportPath.isEmpty()) { --- -2.5.2 - diff --git a/pkgs/development/libraries/qt-5/5.5/qtquick1/default.nix b/pkgs/development/libraries/qt-5/5.5/qtquick1/default.nix index d1c7bb389a49..64937b3dcd37 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtquick1/default.nix +++ b/pkgs/development/libraries/qt-5/5.5/qtquick1/default.nix @@ -1,7 +1,7 @@ -{ qtSubmodule, qtscript, qtsvg, qtwebkit, qtxmlpatterns }: +{ qtSubmodule, lib, copyPathsToStore, qtscript, qtsvg, qtwebkit, qtxmlpatterns }: qtSubmodule { name = "qtquick1"; - patches = [ ./0001-nix-profiles-import-paths.patch ]; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); qtInputs = [ qtscript qtsvg qtwebkit qtxmlpatterns ]; } diff --git a/pkgs/development/libraries/qt-5/5.5/qtquick1/nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.5/qtquick1/nix-profiles-import-paths.patch new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/development/libraries/qt-5/5.5/qtquick1/series b/pkgs/development/libraries/qt-5/5.5/qtquick1/series new file mode 100644 index 000000000000..7dbe197c56e0 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.5/qtquick1/series @@ -0,0 +1 @@ +nix-profiles-import-paths.patch From 6c9ce23c00be88447a8b4d436025508001717b28 Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Sat, 2 Apr 2016 19:19:53 +0200 Subject: [PATCH 7/8] cc-wrapper: Fix a typo in param parsing (close #14401) --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 3c3dbc03d413..673d9ec494cb 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -46,9 +46,9 @@ while [ $n -lt ${#params[*]} ]; do isCpp=1 elif [ "$p" = -nostdlib ]; then isCpp=-1 - elif [ "${i:0:1}" != - ]; then + elif [ "${p:0:1}" != - ]; then nonFlagArgs=1 - elif [ "$i" = -m32 ]; then + elif [ "$p" = -m32 ]; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" fi From bde82098b88861a27faadc8a69b597510e56d846 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Thu, 31 Mar 2016 02:56:18 -0400 Subject: [PATCH 8/8] stdenv: don't complain about configure script not existing Close #14335. Since 89036ef76ab09a, when a package doesn't include a configure script, the build complains with: grep: : No such file or directory grep: : No such file or directory This prevents that. --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 97eb855d3594..cca4648d2375 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -649,14 +649,14 @@ configurePhase() { # Add --disable-dependency-tracking to speed up some builds. if [ -z "$dontAddDisableDepTrack" ]; then - if grep -q dependency-tracking "$configureScript"; then + if [ -f "$configureScript" ] && grep -q dependency-tracking "$configureScript"; then configureFlags="--disable-dependency-tracking $configureFlags" fi fi # By default, disable static builds. if [ -z "$dontDisableStatic" ]; then - if grep -q enable-static "$configureScript"; then + if [ -f "$configureScript" ] && grep -q enable-static "$configureScript"; then configureFlags="--disable-static $configureFlags" fi fi