Bug#835665: llvm-toolchain-3.8: FTBFS on kfreebsd

Debian BTS debbugs at buxtehude.debian.org
Sun Aug 28 08:36:05 UTC 2016


Hi,
Reply-To: Pino Toscano <pino at debian.org>, 835665 at bugs.debian.org
Resent-From: Pino Toscano <pino at debian.org>
Resent-To: debian-bugs-dist at lists.debian.org
Resent-CC: debian-bsd at lists.debian.org, LLVM Packaging Team <pkg-llvm-team at lists.alioth.debian.org>
X-Loop: owner at bugs.debian.org
Resent-Date: Sun, 28 Aug 2016 08:36:01 +0000
Resent-Message-ID: <handler.835665.B.14723732267660 at bugs.debian.org>
Resent-Sender: owner at bugs.debian.org
X-Debian-PR-Message: report 835665
X-Debian-PR-Package: src:llvm-toolchain-3.8
X-Debian-PR-Keywords: patch
X-Debian-PR-Source: llvm-toolchain-3.8
Received: via spool by submit at bugs.debian.org id=B.14723732267660
          (code B); Sun, 28 Aug 2016 08:36:01 +0000
Received: (at submit) by bugs.debian.org; 28 Aug 2016 08:33:46 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-8.9 required=4.0 tests=BAYES_00,FOURLA,FROMDEVELOPER,
	MURPHY_DRUGS_REL8,PUSSY,XMAILER_REPORTBUG,X_DEBBUGS_CC autolearn=ham
	autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 56; hammy, 150; neutral, 181; spammy,
	0. spammytokens: hammytokens:0.000-+--HX-Debbugs-Cc:sk:debian-,
	0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug, 0.000-+--H*x:reportbug,
	0.000-+--H*x:6.6.6
Received: from shyrka.net ([88.198.192.28])
	by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.84_2)
	(envelope-from <pino at debian.org>)
	id 1bdvXF-0001yr-Ht
	for submit at bugs.debian.org; Sun, 28 Aug 2016 08:33:45 +0000
Received: from [127.0.1.1] (unknown [176.74.128.57])
	(Authenticated sender: pino at pino.toscano.name)
	by shyrka.net (Postfix) with ESMTPA id 08E6117126;
	Sun, 28 Aug 2016 10:33:39 +0200 (CEST)
Content-Type: multipart/mixed; boundary="===============8752614877722480319=="
MIME-Version: 1.0
From: Pino Toscano <pino at debian.org>
To: Debian Bug Tracking System <submit at bugs.debian.org>
Message-ID: <147237321406.18794.1680153701854226725.reportbug at pendragon>
X-Mailer: reportbug 6.6.6
Date: Sun, 28 Aug 2016 10:33:34 +0200
Delivered-To: submit at bugs.debian.org

This is a multi-part MIME message sent by reportbug.


--===============8752614877722480319==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Source: llvm-toolchain-3.8
Version: 1:3.8.1-9
Severity: important
Tags: patch
User: debian-bsd at lists.debian.org
Usertags: kfreebsd

llvm-toolchain-3.8 currently fails to build on kFreeBSD, and there are
different issues.

The attached patch should fix all of them (at least for building,
I haven't tried the resulting binaries yet); follows the details of the
changes in the patch per file:

* compiler-rt/cmake/config-ix.cmake
disable the common parts for the sanitizer tools, as it seems not
supported yet (maybe it can be, but let's stay on the safe side for now)

* tools/llvm-shlib/CMakeLists.txt
use the right link flags, so the resulting libLLVM-3.8 has all the
proper symbols

* lldb/cmake/LLDBDependencies.cmake
do not link to execinfo, as backtrace() is provided by in GNU libc
already

* lldb/scripts/utilsOsType.py
add a simple OS identification, even if not actually used ("Unknown"
as result will cause lldb/scripts/finishSwigWrapperClasses.py to error
out)

* lldb/scripts/Python/modules/CMakeLists.txt
enable the readline Python extension

Please note a couple of the changes contain patches for Hurd as well:
they are fine, although not complete to fix the build there too.

Thanks,
-- 
Pino

--===============8752614877722480319==
Content-Type: text/x-diff; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="kfreebsd.diff"

--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -560,7 +560,8 @@ endif()
 
 if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
     (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR
-    (OS_NAME MATCHES "Windows" AND MSVC)))
+    (OS_NAME MATCHES "Windows" AND MSVC))
+    AND NOT (OS_NAME STREQUAL "kFreeBSD"))
   set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
 else()
   set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)
--- a/tools/llvm-shlib/CMakeLists.txt
+++ b/tools/llvm-shlib/CMakeLists.txt
@@ -42,7 +42,7 @@ add_llvm_library(LLVM SHARED DISABLE_LLV
 set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME
 
 list(REMOVE_DUPLICATES LIB_NAMES)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf"
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD") # FIXME: It should be "GNU ld for elf"
   # GNU ld doesn't resolve symbols in the version script.
   set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
--- a/lldb/cmake/LLDBDependencies.cmake
+++ b/lldb/cmake/LLDBDependencies.cmake
@@ -153,7 +153,7 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windo
   endif()
 endif()
 # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") AND NOT CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)
 endif()
 
--- a/lldb/scripts/utilsOsType.py
+++ b/lldb/scripts/utilsOsType.py
@@ -35,6 +35,7 @@ if sys.version_info.major >= 3:
         Linux = 3
         NetBSD = 4
         Windows = 5
+        kFreeBSD = 6
 else:
     class EnumOsType(object):
         values = ["Unknown",
@@ -42,7 +43,8 @@ else:
                   "FreeBSD",
                   "Linux",
                   "NetBSD",
-                  "Windows"]
+                  "Windows",
+                  "kFreeBSD"]
         class __metaclass__(type):
 #++---------------------------------------------------------------------------
 # Details:  Fn acts as an enumeration.
@@ -86,5 +88,7 @@ def determine_os_type():
         eOSType = EnumOsType.NetBSD
     elif strOS == "win32":
         eOSType = EnumOsType.Windows
+    elif strOS.startswith("gnukfreebsd"):
+        eOSType = EnumOsType.kFreeBSD
 
     return eOSType
--- a/lldb/scripts/Python/modules/CMakeLists.txt
+++ b/lldb/scripts/Python/modules/CMakeLists.txt
@@ -5,7 +5,7 @@ if (CXX_SUPPORTS_NO_MACRO_REDEFINED)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-macro-redefined")
 endif ()
 
-# build the Python readline suppression module only on Linux
-if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT __ANDROID_NDK__)
+# build the Python readline suppression module only on Linux or GNU systems
+if ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "GNU" OR CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD") AND NOT __ANDROID_NDK__)
    add_subdirectory(readline)
 endif()

--===============8752614877722480319==--



More information about the Pkg-llvm-team mailing list