diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-12-30 16:38:38 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2019-12-30 16:38:38 +0100 |
commit | 6d059becd396ca8722904081cff7225bc64d5a44 (patch) | |
tree | e723580f3aa9aeec12d407dbea2c4a0fa1808c95 /pkgs/os-specific | |
parent | bfa5af85b733defd158965fe91d60fd3f7a8a666 (diff) | |
parent | 59ab29fe88b06b31de5bea7ac11492a9dbc0c680 (diff) |
Merge gcc-9 into staging (#68029)
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/firmware/fwupdate/default.nix | 2 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/perf.nix | 5 | ||||
-rw-r--r-- | pkgs/os-specific/linux/mstpd/default.nix | 14 | ||||
-rw-r--r-- | pkgs/os-specific/linux/usbip/default.nix | 8 | ||||
-rw-r--r-- | pkgs/os-specific/linux/usbip/fix-strncpy-truncation.patch | 37 |
5 files changed, 56 insertions, 10 deletions
diff --git a/pkgs/os-specific/linux/firmware/fwupdate/default.nix b/pkgs/os-specific/linux/firmware/fwupdate/default.nix index 70a0bdbe2406a..60b87d2dd9aa2 100644 --- a/pkgs/os-specific/linux/firmware/fwupdate/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupdate/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation { ./do-not-create-sharedstatedir.patch ]; - NIX_CFLAGS_COMPILE = [ "-I${gnu-efi}/include/efi" ]; + NIX_CFLAGS_COMPILE = [ "-I${gnu-efi}/include/efi" "-Wno-error=address-of-packed-member" ]; # TODO: Just apply the disable to the efi subdir hardeningDisable = [ "stackprotector" ]; diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix index f343f11f5b608..faf6dabc2276d 100644 --- a/pkgs/os-specific/linux/kernel/perf.nix +++ b/pkgs/os-specific/linux/kernel/perf.nix @@ -51,10 +51,7 @@ stdenv.mkDerivation { "-Wno-error=bool-compare" "-Wno-error=deprecated-declarations" "-DOBJDUMP_PATH=\"${binutils}/bin/objdump\"" - ] - # gcc before 6 doesn't know these options - ++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [ - "-Wno-error=unused-const-variable" "-Wno-error=misleading-indentation" + "-Wno-error=stringop-truncation" ]; doCheck = false; # requires "sparse" diff --git a/pkgs/os-specific/linux/mstpd/default.nix b/pkgs/os-specific/linux/mstpd/default.nix index 492a9321a21cf..4a7c6282d4c76 100644 --- a/pkgs/os-specific/linux/mstpd/default.nix +++ b/pkgs/os-specific/linux/mstpd/default.nix @@ -1,16 +1,24 @@ -{ stdenv, fetchFromGitHub, autoreconfHook }: +{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }: stdenv.mkDerivation rec { pname = "mstpd"; - version = "0.0.7"; + version = "0.0.8"; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; - sha256 = "01majib6d1rixngf8c8vcrj1akf8nsqpxhdfdxxi2xwg23vx8f1a"; + sha256 = "1xkfydxljdnj49p5r3mirk4k146428b6imfc9bkfps9yjn64mkgb"; }; + patches = [ + (fetchpatch { + name = "fix-strncpy-gcc9.patch"; + url = "https://github.com/mstpd/mstpd/commit/d27d7e93485d881d8ff3a7f85309b545edbe1fc6.patch"; + sha256 = "19456daih8l3y6m9kphjr7pj7slrqzbj6yacnlgznpxyd8y4d86y"; + }) + ]; + nativeBuildInputs = [ autoreconfHook ]; configureFlags = [ diff --git a/pkgs/os-specific/linux/usbip/default.nix b/pkgs/os-specific/linux/usbip/default.nix index 61f2c45404658..f927eaefb4eb7 100644 --- a/pkgs/os-specific/linux/usbip/default.nix +++ b/pkgs/os-specific/linux/usbip/default.nix @@ -1,18 +1,22 @@ -{ stdenv, kernel, udev, autoconf, automake, libtool }: +{ lib, stdenv, kernel, udev, autoconf, automake, libtool }: stdenv.mkDerivation { name = "usbip-${kernel.name}"; src = kernel.src; - patches = [ + patches = lib.optionals (lib.versionAtLeast "5.4" kernel.version) [ # fixes build with gcc8 ./fix-snprintf-truncation.patch + # fixes build with gcc9 + ./fix-strncpy-truncation.patch ]; nativeBuildInputs = [ autoconf automake libtool ]; buildInputs = [ udev ]; + NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + preConfigure = '' cd tools/usb/usbip ./autogen.sh diff --git a/pkgs/os-specific/linux/usbip/fix-strncpy-truncation.patch b/pkgs/os-specific/linux/usbip/fix-strncpy-truncation.patch new file mode 100644 index 0000000000000..a5c4c97bbc084 --- /dev/null +++ b/pkgs/os-specific/linux/usbip/fix-strncpy-truncation.patch @@ -0,0 +1,37 @@ +diff --git a/tools/usb/usbip/libsrc/usbip_common.c b/tools/usb/usbip/libsrc/usbip_common.c +index bb424638d75b..2fc5837e609a 100644 +--- a/tools/usb/usbip/libsrc/usbip_common.c ++++ b/tools/usb/usbip/libsrc/usbip_common.c +@@ -226,8 +226,8 @@ int read_usb_device(struct udev_device *sdev, struct usbip_usb_device *udev) + path = udev_device_get_syspath(sdev); + name = udev_device_get_sysname(sdev); + +- strncpy(udev->path, path, SYSFS_PATH_MAX); +- strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE); ++ strncpy(udev->path, path, SYSFS_PATH_MAX-1); ++ strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE-1); + + sscanf(name, "%u-%u", &busnum, &devnum); + udev->busnum = busnum; +diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c b/tools/usb/usbip/libsrc/usbip_device_driver.c +index 5a3726eb44ab..95b416af8b99 100644 +--- a/tools/usb/usbip/libsrc/usbip_device_driver.c ++++ b/tools/usb/usbip/libsrc/usbip_device_driver.c +@@ -91,7 +91,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev) + copy_descr_attr16(dev, &descr, idProduct); + copy_descr_attr16(dev, &descr, bcdDevice); + +- strncpy(dev->path, path, SYSFS_PATH_MAX); ++ strncpy(dev->path, path, SYSFS_PATH_MAX-1); + + dev->speed = USB_SPEED_UNKNOWN; + speed = udev_device_get_sysattr_value(sdev, "current_speed"); +@@ -110,7 +110,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev) + dev->busnum = 0; + + name = udev_device_get_sysname(plat); +- strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE); ++ strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE-1); + return 0; + err: + fclose(fd); |