From a5b85f130865a255de0e208a7c30f9f99ceffcdc Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Fri, 28 Aug 2015 07:16:02 +0000 Subject: [PATCH] Add patch from 3.7 trunk to fix kfreebsd build failure --- debian/changelog | 5 +++ debian/patches/kfreebsd-build-fix.patch | 41 +++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 47 insertions(+) create mode 100644 debian/patches/kfreebsd-build-fix.patch diff --git a/debian/changelog b/debian/changelog index a402fb0f..7d562768 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,12 +9,17 @@ llvm-toolchain-snapshot (1:3.8~svn245286-2) UNRELEASED; urgency=medium (Closes: #796811, #796843) * Remove an obsolete declaration about dragonegg (cherry-pick from 3.7 branch) + * debian/patches/kfreebsd-build-fix.patch: + - fix kfreebsd-* build failures by workarounding + missing F_DUPFD_CLOEXEC (rebased patch from gnome-terminal + 10_kfreebsd-f_dupfd_cloexec.patch) [ James Price ] * d/p/fix-cmake-config-prefix.diff: fix cmake path, needs a change after upstream revision r241080 (Addresses: #794905) + -- Gianfranco Costamagna Tue, 18 Aug 2015 18:37:46 +0200 llvm-toolchain-snapshot (1:3.8~svn245286-1) unstable; urgency=medium diff --git a/debian/patches/kfreebsd-build-fix.patch b/debian/patches/kfreebsd-build-fix.patch new file mode 100644 index 00000000..250abc52 --- /dev/null +++ b/debian/patches/kfreebsd-build-fix.patch @@ -0,0 +1,41 @@ +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +Description: Avoid usage of F_DUPFD_CLOEXEC where not available (e.g. kfreebsd*) + The patch is mostly taken from 10_kfreebsd-f_dupfd_cloexec.patch (gnome-terminal) + Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711529 + Description: Fix build on kfreebsd + + kfreebsd doesn't have F_DUPFD_CLOEXEC, so use it conditionally. + As mentioned in the bug report, it will have support for it in + jessie, so we can drop it in jessie+1 + Author: Emilio Pozuelo Monfort + Author: Petr Salinger + +Author: Gianfranco Costamagna +--- llvm-toolchain-3.7-3.7~+rc3.orig/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp ++++ llvm-toolchain-3.7-3.7~+rc3/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +@@ -462,11 +462,24 @@ ProcessPOSIX::DoLaunch (Module *module, + int terminal = m_monitor->GetTerminalFD(); + if (terminal >= 0) { + // The reader thread will close the file descriptor when done, so we pass it a copy. ++#ifdef F_DUPFD_CLOEXEC + int stdio = fcntl(terminal, F_DUPFD_CLOEXEC, 0); + if (stdio == -1) { + error.SetErrorToErrno(); + return error; + } ++#else ++ int stdio = fcntl(terminal, F_DUPFD, 0); ++ if (stdio == -1) { ++ error.SetErrorToErrno(); ++ return error; ++ } ++ stdio = fcntl(terminal, F_SETFD, FD_CLOEXEC); ++ if (stdio == -1) { ++ error.SetErrorToErrno(); ++ return error; ++ } ++#endif + SetSTDIOFileDescriptor(stdio); + } diff --git a/debian/patches/series b/debian/patches/series index 4b3f6625..bbfd02fc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -42,3 +42,4 @@ locale-issue-ld.diff CVE-2015-2305.patch bug783205.patch fix-cmake-config-prefix.diff +kfreebsd-build-fix.patch