mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-06-24 16:52:42 +00:00
Merge remote-tracking branch 'origin/8' into snapshot
This commit is contained in:
commit
5c65d87c76
8
debian/TODO
vendored
8
debian/TODO
vendored
@ -3,4 +3,10 @@ called libclang1-3.3.so)
|
||||
|
||||
* move the header at the right place in libclang-dev
|
||||
|
||||
* bootstrap of clang with itself
|
||||
* In 1:7.0.1~+rc2-5, we did:
|
||||
* Fix a baseline violation on armhf (Closes: #914268)
|
||||
clang-arm-default-vfp3-on-armv7a.patch has been updated to disable
|
||||
neon in another place
|
||||
It caused 200+ tests to fail on arm:
|
||||
https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-7&arch=amd64&ver=1%3A7.0.1%7E%2Brc2-4&stamp=1542503855&raw=0
|
||||
https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-7&arch=amd64&ver=1%3A7.0.1%7E%2Brc2-5&stamp=1542863723&raw=0
|
||||
|
18
debian/changelog
vendored
18
debian/changelog
vendored
@ -2,9 +2,6 @@ llvm-toolchain-snapshot (1:9~svn351420-1~exp2) experimental; urgency=medium
|
||||
|
||||
* Remove 'Multi-Arch: same' in libclang
|
||||
(Closes: #874248)
|
||||
|
||||
--
|
||||
|
||||
llvm-toolchain-snapshot (1:9~svn351420-1~exp1) experimental; urgency=medium
|
||||
|
||||
* New snapshot release
|
||||
@ -42,6 +39,14 @@ llvm-toolchain-snapshot (1:9~svn351375-1~exp1) experimental; urgency=medium
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 16 Jan 2019 21:59:29 +0100
|
||||
|
||||
llvm-toolchain-8 (1:8~+rc1-1~exp1) experimental; urgency=medium
|
||||
|
||||
* New snapshot release
|
||||
* Remove 'Multi-Arch: same' in libclang
|
||||
(Closes: #874248)
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Thu, 24 Jan 2019 08:49:34 +0100
|
||||
|
||||
llvm-toolchain-8 (1:8~svn351401-1~exp1) experimental; urgency=medium
|
||||
|
||||
* New snapshot release (branch 8 created)
|
||||
@ -532,6 +537,13 @@ llvm-toolchain-snapshot (1:8~svn340819-1) unstable; urgency=medium
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 28 Aug 2018 16:28:24 +0200
|
||||
|
||||
llvm-toolchain-7 (1:7.0.1-6) unstable; urgency=medium
|
||||
|
||||
* Add support for kfreebsd (Closes: #921246)
|
||||
Many thanks to Svante Signell for all patches
|
||||
|
||||
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 03 Feb 2019 17:27:51 +0100
|
||||
|
||||
llvm-toolchain-7 (1:7.0.1-5) unstable; urgency=medium
|
||||
|
||||
* Add 'Rules-Requires-Root: no' in debian/control
|
||||
|
2
debian/liblldb-7.install.kfreebsd
vendored
Normal file
2
debian/liblldb-7.install.kfreebsd
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
usr/lib/llvm-7/lib/liblldb-7.so.1 /usr/lib/i386-kfreebsd-gnu/
|
||||
usr/lib/llvm-7/lib/python2.7/site-packages/readline.so
|
13
debian/patches/kfreebsd/CMakeLists.txt.diff
vendored
Normal file
13
debian/patches/kfreebsd/CMakeLists.txt.diff
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Index: llvm-toolchain-7-7.0.1/CMakeLists.txt
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/CMakeLists.txt
|
||||
+++ llvm-toolchain-7-7.0.1/CMakeLists.txt
|
||||
@@ -821,7 +821,7 @@ if(LLVM_TARGET_IS_CROSSCOMPILE_HOST)
|
||||
# (this is a variable that CrossCompile sets on recursive invocations)
|
||||
endif()
|
||||
|
||||
-if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
|
||||
+if( ${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)" AND NOT "kFreeBSD" )
|
||||
# On FreeBSD, /usr/local/* is not used by default. In order to build LLVM
|
||||
# with libxml2, iconv.h, etc., we must add /usr/local paths.
|
||||
include_directories(SYSTEM "/usr/local/include")
|
48
debian/patches/kfreebsd/clang_lib_Basic_Targets.diff
vendored
Normal file
48
debian/patches/kfreebsd/clang_lib_Basic_Targets.diff
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
Index: llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/clang/lib/Basic/Targets.cpp
|
||||
+++ llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets.cpp
|
||||
@@ -469,8 +469,8 @@ TargetInfo *AllocateTarget(const llvm::T
|
||||
return new OpenBSDI386TargetInfo(Triple, Opts);
|
||||
case llvm::Triple::FreeBSD:
|
||||
return new FreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
|
||||
- case llvm::Triple::KFreeBSD:
|
||||
- return new KFreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
|
||||
+ case llvm::Triple::kFreeBSD:
|
||||
+ return new kFreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Minix:
|
||||
return new MinixTargetInfo<X86_32TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Solaris:
|
||||
@@ -528,8 +528,8 @@ TargetInfo *AllocateTarget(const llvm::T
|
||||
return new FreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Fuchsia:
|
||||
return new FuchsiaTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
- case llvm::Triple::KFreeBSD:
|
||||
- return new KFreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
+ case llvm::Triple::kFreeBSD:
|
||||
+ return new kFreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Solaris:
|
||||
return new SolarisTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Win32: {
|
||||
Index: llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets/OSTargets.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/clang/lib/Basic/Targets/OSTargets.h
|
||||
+++ llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets/OSTargets.h
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
|
||||
// GNU/kFreeBSD Target
|
||||
template <typename Target>
|
||||
-class LLVM_LIBRARY_VISIBILITY KFreeBSDTargetInfo : public OSTargetInfo<Target> {
|
||||
+class LLVM_LIBRARY_VISIBILITY kFreeBSDTargetInfo : public OSTargetInfo<Target> {
|
||||
protected:
|
||||
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
|
||||
MacroBuilder &Builder) const override {
|
||||
@@ -243,7 +243,7 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
- KFreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
|
||||
+ kFreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
|
||||
: OSTargetInfo<Target>(Triple, Opts) {}
|
||||
};
|
||||
|
559
debian/patches/kfreebsd/compiler-rt_lib.diff
vendored
Normal file
559
debian/patches/kfreebsd/compiler-rt_lib.diff
vendored
Normal file
@ -0,0 +1,559 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
|
||||
@@ -84,9 +84,14 @@
|
||||
extern "C" {
|
||||
// <sys/umtx.h> must be included after <errno.h> and <sys/types.h> on
|
||||
// FreeBSD 9.2 and 10.0.
|
||||
+#if SANITIZER_KFREEBSD
|
||||
+#include <bsd/sys/cdefs.h>
|
||||
+#endif
|
||||
#include <sys/umtx.h>
|
||||
}
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
#include <sys/thr.h>
|
||||
+#endif
|
||||
#endif // SANITIZER_FREEBSD
|
||||
|
||||
#if SANITIZER_NETBSD
|
||||
@@ -468,10 +473,12 @@ bool FileExists(const char *filename) {
|
||||
|
||||
#if !SANITIZER_NETBSD
|
||||
tid_t GetTid() {
|
||||
-#if SANITIZER_FREEBSD
|
||||
+#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
|
||||
long Tid;
|
||||
thr_self(&Tid);
|
||||
return Tid;
|
||||
+#elif SANITIZER_KFREEBSD
|
||||
+ return (uptr)pthread_self();
|
||||
#elif SANITIZER_OPENBSD
|
||||
return internal_syscall(SYSCALL(getthrid));
|
||||
#elif SANITIZER_SOLARIS
|
||||
@@ -1167,10 +1174,10 @@ bool LibraryNameIs(const char *full_name
|
||||
// Call cb for each region mapped by map.
|
||||
void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)) {
|
||||
CHECK_NE(map, nullptr);
|
||||
-#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
|
||||
+#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
|
||||
typedef ElfW(Phdr) Elf_Phdr;
|
||||
typedef ElfW(Ehdr) Elf_Ehdr;
|
||||
-#endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
|
||||
+#endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
|
||||
char *base = (char *)map->l_addr;
|
||||
Elf_Ehdr *ehdr = (Elf_Ehdr *)base;
|
||||
char *phdrs = base + ehdr->e_phoff;
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
@@ -36,10 +36,12 @@
|
||||
#include <syslog.h>
|
||||
|
||||
#if SANITIZER_FREEBSD
|
||||
-#include <pthread_np.h>
|
||||
+# if !SANITIZER_KFREEBSD
|
||||
+# include <pthread_np.h>
|
||||
+# define pthread_getattr_np pthread_attr_get_np
|
||||
+# endif
|
||||
#include <osreldate.h>
|
||||
#include <sys/sysctl.h>
|
||||
-#define pthread_getattr_np pthread_attr_get_np
|
||||
#endif
|
||||
|
||||
#if SANITIZER_OPENBSD
|
||||
@@ -528,9 +530,9 @@ void GetThreadStackAndTls(bool main, upt
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
|
||||
+#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
|
||||
typedef ElfW(Phdr) Elf_Phdr;
|
||||
-#elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2
|
||||
+#elif SANITIZER_WORDSIZE == 32 && !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
|
||||
#define Elf_Phdr XElf32_Phdr
|
||||
#define dl_phdr_info xdl_phdr_info
|
||||
#define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b))
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
|
||||
@@ -16,7 +16,7 @@
|
||||
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
|
||||
!defined(__OpenBSD__) && !defined(__APPLE__) && !defined(_WIN32) && \
|
||||
!defined(__Fuchsia__) && !defined(__rtems__) && \
|
||||
- !(defined(__sun__) && defined(__svr4__))
|
||||
+ !(defined(__sun__) && defined(__svr4__)) && !defined(__FreeBSD_kernel__)
|
||||
# error "This operating system is not supported"
|
||||
#endif
|
||||
|
||||
@@ -26,12 +26,18 @@
|
||||
# define SANITIZER_LINUX 0
|
||||
#endif
|
||||
|
||||
-#if defined(__FreeBSD__)
|
||||
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
# define SANITIZER_FREEBSD 1
|
||||
#else
|
||||
# define SANITIZER_FREEBSD 0
|
||||
#endif
|
||||
|
||||
+#if defined(__FreeBSD_kernel__)
|
||||
+# define SANITIZER_KFREEBSD 1
|
||||
+#else
|
||||
+# define SANITIZER_KFREEBSD 0
|
||||
+#endif
|
||||
+
|
||||
#if defined(__NetBSD__)
|
||||
# define SANITIZER_NETBSD 1
|
||||
#else
|
||||
@@ -113,7 +119,8 @@
|
||||
|
||||
#define SANITIZER_POSIX \
|
||||
(SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || \
|
||||
- SANITIZER_NETBSD || SANITIZER_OPENBSD || SANITIZER_SOLARIS)
|
||||
+ SANITIZER_NETBSD || SANITIZER_OPENBSD || SANITIZER_SOLARIS || \
|
||||
+ SANITIZER_KFREEBSD)
|
||||
|
||||
#if __LP64__ || defined(_WIN64)
|
||||
# define SANITIZER_WORDSIZE 64
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <utmp.h>
|
||||
#endif
|
||||
|
||||
-#if !SANITIZER_IOS
|
||||
+#if !SANITIZER_IOS && !SANITIZER_KFREEBSD
|
||||
#include <net/route.h>
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,11 @@ typedef struct user_fpregs elf_fpregset_
|
||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
#include <glob.h>
|
||||
#include <obstack.h>
|
||||
-#include <mqueue.h>
|
||||
+#if SANITIZER_KFREEBSD
|
||||
+# include <sys/mqueue.h>
|
||||
+#else
|
||||
+# include <mqueue.h>
|
||||
+#endif
|
||||
#include <net/if_ppp.h>
|
||||
#include <netax25/ax25.h>
|
||||
#include <netipx/ipx.h>
|
||||
@@ -146,6 +150,12 @@ typedef struct user_fpregs elf_fpregset_
|
||||
#include <linux/if_ppp.h>
|
||||
#endif
|
||||
|
||||
+#if SANITIZER_KFREEBSD
|
||||
+# include <sys/link_elf.h>
|
||||
+#else
|
||||
+# include <link.h>
|
||||
+#endif
|
||||
+
|
||||
#if SANITIZER_LINUX
|
||||
#include <link.h>
|
||||
#include <sys/vfs.h>
|
||||
@@ -256,7 +266,7 @@ namespace __sanitizer {
|
||||
#endif
|
||||
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
|
||||
unsigned struct_shminfo_sz = sizeof(struct shminfo);
|
||||
unsigned struct_shm_info_sz = sizeof(struct shm_info);
|
||||
int shmctl_ipc_stat = (int)IPC_STAT;
|
||||
@@ -286,7 +296,7 @@ namespace __sanitizer {
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX || SANITIZER_KFREEBSD
|
||||
unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
|
||||
#elif SANITIZER_FREEBSD
|
||||
unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
@@ -466,7 +476,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
|
||||
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
|
||||
#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
|
||||
-#if !SANITIZER_ANDROID && !SANITIZER_MAC
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_MAC && !SANITIZER_KFREEBSD
|
||||
unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req);
|
||||
unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
|
||||
#endif
|
||||
@@ -519,7 +529,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
|
||||
unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
|
||||
unsigned IOCTL_TIOCSTI = TIOCSTI;
|
||||
unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
|
||||
unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
|
||||
unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;
|
||||
#endif
|
||||
@@ -958,7 +968,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi
|
||||
CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
|
||||
CHECK_TYPE_SIZE(glob_t);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
|
||||
@@ -978,8 +988,10 @@ CHECK_SIZE_AND_OFFSET(addrinfo, ai_sockt
|
||||
CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
|
||||
CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
|
||||
CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen);
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname);
|
||||
CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr);
|
||||
+#endif
|
||||
|
||||
CHECK_TYPE_SIZE(hostent);
|
||||
CHECK_SIZE_AND_OFFSET(hostent, h_name);
|
||||
@@ -1001,7 +1013,9 @@ CHECK_SIZE_AND_OFFSET(msghdr, msg_contro
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen);
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_flags);
|
||||
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
CHECK_TYPE_SIZE(cmsghdr);
|
||||
+#endif
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
|
||||
@@ -1043,7 +1057,9 @@ CHECK_SIZE_AND_OFFSET(pollfd, fd);
|
||||
CHECK_SIZE_AND_OFFSET(pollfd, events);
|
||||
CHECK_SIZE_AND_OFFSET(pollfd, revents);
|
||||
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
CHECK_TYPE_SIZE(nfds_t);
|
||||
+#endif
|
||||
|
||||
CHECK_TYPE_SIZE(sigset_t);
|
||||
|
||||
@@ -1083,7 +1099,9 @@ CHECK_TYPE_SIZE(__kernel_fd_set);
|
||||
#endif
|
||||
|
||||
#if !SANITIZER_ANDROID
|
||||
+# if !SANITIZER_KFREEBSD
|
||||
CHECK_TYPE_SIZE(wordexp_t);
|
||||
+# endif
|
||||
CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);
|
||||
CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);
|
||||
CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs);
|
||||
@@ -1116,13 +1134,14 @@ CHECK_TYPE_SIZE(ether_addr);
|
||||
|
||||
#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
CHECK_TYPE_SIZE(ipc_perm);
|
||||
-# if SANITIZER_FREEBSD
|
||||
+#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, key);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, seq);
|
||||
-# else
|
||||
+#endif
|
||||
+#if !SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, __key);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, __seq);
|
||||
-# endif
|
||||
+#endif
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
|
||||
@@ -1161,7 +1180,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netma
|
||||
#ifdef ifa_dstaddr
|
||||
#undef ifa_dstaddr
|
||||
#endif
|
||||
-# if SANITIZER_FREEBSD
|
||||
+# if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
|
||||
# else
|
||||
COMPILER_CHECK(sizeof(((__sanitizer_ifaddrs *)nullptr)->ifa_dstaddr) ==
|
||||
@@ -1187,15 +1206,19 @@ CHECK_SIZE_AND_OFFSET(timeb, timezone);
|
||||
CHECK_SIZE_AND_OFFSET(timeb, dstflag);
|
||||
#endif
|
||||
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
CHECK_TYPE_SIZE(passwd);
|
||||
+#endif
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_name);
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_passwd);
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_uid);
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_gid);
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_dir);
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_shell);
|
||||
+#endif
|
||||
|
||||
-#if !SANITIZER_ANDROID
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(passwd, pw_gecos);
|
||||
#endif
|
||||
|
||||
@@ -1261,7 +1284,7 @@ CHECK_SIZE_AND_OFFSET(cookie_io_function
|
||||
CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, close);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
+#if SANITIZER_LINUX || (SANITIZER_FREEBSD && !SANITIZER_KFREEBSD)
|
||||
CHECK_TYPE_SIZE(sem_t);
|
||||
#endif
|
||||
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/asan/asan_linux.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/asan/asan_linux.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/asan/asan_linux.cc
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <unistd.h>
|
||||
#include <unwind.h>
|
||||
|
||||
-#if SANITIZER_FREEBSD
|
||||
+#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
|
||||
#include <sys/link_elf.h>
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,11 @@
|
||||
|
||||
#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
|
||||
#include <ucontext.h>
|
||||
+#if SANITIZER_KFREEBSD
|
||||
+#include <link.h>
|
||||
+#else
|
||||
extern "C" void* _DYNAMIC;
|
||||
+#endif
|
||||
#elif SANITIZER_NETBSD
|
||||
#include <link_elf.h>
|
||||
#include <ucontext.h>
|
||||
@@ -61,7 +65,7 @@ extern Elf_Dyn _DYNAMIC;
|
||||
// x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in
|
||||
// 32-bit mode.
|
||||
#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \
|
||||
- __FreeBSD_version <= 902001 // v9.2
|
||||
+ !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
|
||||
#define ucontext_t xucontext_t
|
||||
#endif
|
||||
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/ubsan/ubsan_platform.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/ubsan/ubsan_platform.h
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/ubsan/ubsan_platform.h
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// Other platforms should be easy to add, and probably work as-is.
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
|
||||
- defined(__NetBSD__) || defined(__OpenBSD__) || \
|
||||
+ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || \
|
||||
(defined(__sun__) && defined(__svr4__)) || \
|
||||
defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__)
|
||||
# define CAN_SANITIZE_UB 1
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
|
||||
@@ -197,7 +197,7 @@ ASM_SYMBOL_INTERCEPTOR(setjmp):
|
||||
lea 16(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xorq ___tsan_darwin_setjmp_xor_key(%rip), %rsi
|
||||
-#elif defined(__linux__)
|
||||
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
|
||||
lea 16(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp)
|
||||
@@ -246,7 +246,7 @@ ASM_SYMBOL_INTERCEPTOR(_setjmp):
|
||||
lea 16(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xorq ___tsan_darwin_setjmp_xor_key(%rip), %rsi
|
||||
-#elif defined(__linux__)
|
||||
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
|
||||
lea 16(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp)
|
||||
@@ -302,7 +302,7 @@ ASM_SYMBOL_INTERCEPTOR(sigsetjmp):
|
||||
lea 32(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xorq ___tsan_darwin_setjmp_xor_key(%rip), %rsi
|
||||
-#elif defined(__linux__)
|
||||
+#elif defined(__linux__) || defined(__FreeBSD_kernel__)
|
||||
lea 32(%rsp), %rdi
|
||||
mov %rdi, %rsi
|
||||
xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp)
|
||||
@@ -389,7 +389,7 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
|
||||
ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))
|
||||
#endif // !defined(__APPLE__) && !defined(__NetBSD__)
|
||||
|
||||
-#if defined(__FreeBSD__) || defined(__linux__)
|
||||
+#if defined(__FreeBSD__) || defined(__linux__) || defined(__FreeBSD_kernel__)
|
||||
/* We do not need executable stack. */
|
||||
/* This note is not needed on NetBSD. */
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#define LIBFUZZER_LINUX 1
|
||||
#define LIBFUZZER_NETBSD 0
|
||||
#define LIBFUZZER_FREEBSD 0
|
||||
+#define LIBFUZZER_KFREEBSD 1
|
||||
#define LIBFUZZER_OPENBSD 0
|
||||
#define LIBFUZZER_WINDOWS 0
|
||||
#elif __APPLE__
|
||||
@@ -54,6 +55,15 @@
|
||||
#define LIBFUZZER_FREEBSD 1
|
||||
#define LIBFUZZER_OPENBSD 0
|
||||
#define LIBFUZZER_WINDOWS 0
|
||||
+#elif __FreeBSD_kernel__
|
||||
+#define LIBFUZZER_APPLE 0
|
||||
+#define LIBFUZZER_FUCHSIA 0
|
||||
+#define LIBFUZZER_LINUX 0
|
||||
+#define LIBFUZZER_NETBSD 0
|
||||
+#define LIBFUZZER_FREEBSD 0
|
||||
+#define LIBFUZZER_KFREEBSD 1
|
||||
+#define LIBFUZZER_OPENBSD 0
|
||||
+#define LIBFUZZER_WINDOWS 0
|
||||
#elif __OpenBSD__
|
||||
#define LIBFUZZER_APPLE 0
|
||||
#define LIBFUZZER_FUCHSIA 0
|
||||
@@ -95,7 +105,7 @@
|
||||
|
||||
#define LIBFUZZER_POSIX \
|
||||
(LIBFUZZER_APPLE || LIBFUZZER_LINUX || LIBFUZZER_NETBSD || \
|
||||
- LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD)
|
||||
+ LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD)
|
||||
|
||||
#ifdef __x86_64
|
||||
# if __has_attribute(target)
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
|
||||
@@ -119,7 +119,7 @@ size_t GetPeakRSSMb() {
|
||||
if (getrusage(RUSAGE_SELF, &usage))
|
||||
return 0;
|
||||
if (LIBFUZZER_LINUX || LIBFUZZER_FREEBSD || LIBFUZZER_NETBSD ||
|
||||
- LIBFUZZER_OPENBSD) {
|
||||
+ LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD) {
|
||||
// ru_maxrss is in KiB
|
||||
return usage.ru_maxrss >> 10;
|
||||
} else if (LIBFUZZER_APPLE) {
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "FuzzerDefs.h"
|
||||
|
||||
#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD || \
|
||||
- LIBFUZZER_OPENBSD
|
||||
+ LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
|
||||
__attribute__((weak)) extern uint8_t __start___libfuzzer_extra_counters;
|
||||
__attribute__((weak)) extern uint8_t __stop___libfuzzer_extra_counters;
|
||||
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
|
||||
@@ -14,7 +14,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "FuzzerDefs.h"
|
||||
#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FUCHSIA || \
|
||||
- LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD
|
||||
+ LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
|
||||
|
||||
#include "FuzzerExtFunctions.h"
|
||||
#include "FuzzerIO.h"
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
|
||||
@@ -10,7 +10,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "FuzzerDefs.h"
|
||||
#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD || \
|
||||
- LIBFUZZER_OPENBSD
|
||||
+ LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
|
||||
#include "FuzzerCommand.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
|
||||
@@ -21,7 +21,7 @@
|
||||
// 32-bit mode.
|
||||
#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
|
||||
# include <osreldate.h>
|
||||
-# if __FreeBSD_version <= 902001 // v9.2
|
||||
+# if !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
|
||||
# include <link.h>
|
||||
# include <sys/param.h>
|
||||
# include <ucontext.h>
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
|
||||
@@ -38,7 +38,7 @@
|
||||
// Fix 'kinfo_vmentry' definition on FreeBSD prior v9.2 in 32-bit mode.
|
||||
#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
|
||||
#include <osreldate.h>
|
||||
-#if __FreeBSD_version <= 902001 // v9.2
|
||||
+#if !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
|
||||
#define kinfo_vmentry xkinfo_vmentry
|
||||
#endif
|
||||
#endif
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "sanitizer_internal_defs.h"
|
||||
#include "sanitizer_platform.h"
|
||||
|
||||
+#if !SANITIZER_KFREEBSD
|
||||
# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
|
||||
+#endif
|
||||
|
||||
#ifndef __GLIBC_PREREQ
|
||||
#define __GLIBC_PREREQ(x, y) 0
|
||||
Index: llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
|
||||
+++ llvm-toolchain-8-8~+rc1/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
|
||||
@@ -20,7 +20,7 @@
|
||||
# define SYSCALL(name) __NR_ ## name
|
||||
#endif
|
||||
|
||||
-#if defined(__x86_64__) && (SANITIZER_FREEBSD || SANITIZER_MAC)
|
||||
+#if defined(__x86_64__) && ((SANITIZER_FREEBSD && !SANITIZER_KFREEBSD) || SANITIZER_MAC)
|
||||
# define internal_syscall __syscall
|
||||
# else
|
||||
# define internal_syscall syscall
|
||||
Index: llvm-toolchain-8-8~+rc1/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
+++ llvm-toolchain-8-8~+rc1/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
@@ -110,9 +110,9 @@ typedef struct user_fpregs elf_fpregset_
|
||||
#include <glob.h>
|
||||
#include <obstack.h>
|
||||
#if SANITIZER_KFREEBSD
|
||||
-# include <mqueue.h>
|
||||
-#else
|
||||
# include <sys/mqueue.h>
|
||||
+#else
|
||||
+# include <mqueue.h>
|
||||
#endif
|
||||
#include <net/if_ppp.h>
|
||||
#include <netax25/ax25.h>
|
||||
@@ -151,9 +151,9 @@ typedef struct user_fpregs elf_fpregset_
|
||||
#endif
|
||||
|
||||
#if SANITIZER_KFREEBSD
|
||||
-# include <link.h>
|
||||
-#else
|
||||
# include <sys/link_elf.h>
|
||||
+#else
|
||||
+# include <link.h>
|
||||
#endif
|
||||
|
||||
#if SANITIZER_LINUX
|
33
debian/patches/kfreebsd/include_llvm_ADT_Triple.h.diff
vendored
Normal file
33
debian/patches/kfreebsd/include_llvm_ADT_Triple.h.diff
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
Index: llvm-toolchain-7-7.0.1/include/llvm/ADT/Triple.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/include/llvm/ADT/Triple.h
|
||||
+++ llvm-toolchain-7-7.0.1/include/llvm/ADT/Triple.h
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
FreeBSD,
|
||||
Fuchsia,
|
||||
IOS,
|
||||
- KFreeBSD,
|
||||
+ kFreeBSD,
|
||||
Linux,
|
||||
Lv2, // PS3
|
||||
MacOSX,
|
||||
@@ -575,8 +575,8 @@ public:
|
||||
}
|
||||
|
||||
/// Tests whether the OS is kFreeBSD.
|
||||
- bool isOSKFreeBSD() const {
|
||||
- return getOS() == Triple::KFreeBSD;
|
||||
+ bool isOSkFreeBSD() const {
|
||||
+ return getOS() == Triple::kFreeBSD;
|
||||
}
|
||||
|
||||
/// Tests whether the OS is Hurd.
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
|
||||
/// Tests whether the OS uses glibc.
|
||||
bool isOSGlibc() const {
|
||||
- return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
|
||||
+ return (getOS() == Triple::Linux || getOS() == Triple::kFreeBSD ||
|
||||
getOS() == Triple::Hurd) &&
|
||||
!isAndroid();
|
||||
}
|
12
debian/patches/kfreebsd/kfreebsd-libcxx-threads-detection.diff
vendored
Normal file
12
debian/patches/kfreebsd/kfreebsd-libcxx-threads-detection.diff
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
Index: llvm-toolchain-7-7.0.1/libcxx/include/__config
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/libcxx/include/__config
|
||||
+++ llvm-toolchain-7-7.0.1/libcxx/include/__config
|
||||
@@ -1107,6 +1107,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
|
||||
!defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
|
||||
!defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
|
||||
# if defined(__FreeBSD__) || \
|
||||
+ defined(__FreeBSD_kernel__) || \
|
||||
defined(__Fuchsia__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__linux__) || \
|
129
debian/patches/kfreebsd/kfreebsd-openmp.diff
vendored
Normal file
129
debian/patches/kfreebsd/kfreebsd-openmp.diff
vendored
Normal file
@ -0,0 +1,129 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp.h
|
||||
+++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp.h
|
||||
@@ -1077,6 +1077,10 @@ extern kmp_uint64 __kmp_now_nsec();
|
||||
/* TODO: tune for KMP_OS_OPENBSD */
|
||||
#define KMP_INIT_WAIT 1024U /* initial number of spin-tests */
|
||||
#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
|
||||
+#elif KMP_OS_KFREEBSD
|
||||
+/* TODO: tune for KMP_OS_KFREEBSD */
|
||||
+#define KMP_INIT_WAIT 1024U /* initial number of spin-tests */
|
||||
+#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
|
||||
#endif
|
||||
|
||||
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
|
||||
Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_ftn_entry.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_ftn_entry.h
|
||||
+++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_ftn_entry.h
|
||||
@@ -535,7 +535,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_
|
||||
int gtid;
|
||||
|
||||
#if KMP_OS_DARWIN || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_HURD
|
||||
+ KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
gtid = __kmp_entry_gtid();
|
||||
#elif KMP_OS_WINDOWS
|
||||
if (!__kmp_init_parallel ||
|
||||
Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_platform.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_platform.h
|
||||
+++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_platform.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#define KMP_OS_LINUX 0
|
||||
#define KMP_OS_DRAGONFLY 0
|
||||
#define KMP_OS_FREEBSD 0
|
||||
+#define KMP_OS_KFREEBSD 0
|
||||
#define KMP_OS_NETBSD 0
|
||||
#define KMP_OS_OPENBSD 0
|
||||
#define KMP_OS_DARWIN 0
|
||||
@@ -57,6 +58,11 @@
|
||||
#define KMP_OS_FREEBSD 1
|
||||
#endif
|
||||
|
||||
+#if (defined __FreeBSD_kernel__)
|
||||
+#undef KMP_OS_KFREEBSD
|
||||
+#define KMP_OS_KFREEBSD 1
|
||||
+#endif
|
||||
+
|
||||
#if (defined __NetBSD__)
|
||||
#undef KMP_OS_NETBSD
|
||||
#define KMP_OS_NETBSD 1
|
||||
@@ -79,12 +85,12 @@
|
||||
|
||||
#if (1 != \
|
||||
KMP_OS_LINUX + KMP_OS_DRAGONFLY + KMP_OS_FREEBSD + KMP_OS_NETBSD + \
|
||||
- KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD)
|
||||
+ KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD + KMP_OS_KFREEBSD)
|
||||
#error Unknown OS
|
||||
#endif
|
||||
|
||||
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD
|
||||
+ KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
#undef KMP_OS_UNIX
|
||||
#define KMP_OS_UNIX 1
|
||||
#endif
|
||||
Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_runtime.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/kmp_runtime.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/kmp_runtime.cpp
|
||||
@@ -8076,7 +8076,7 @@ __kmp_determine_reduction_method(
|
||||
#if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64
|
||||
|
||||
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD
|
||||
+ KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
|
||||
int teamsize_cutoff = 4;
|
||||
|
||||
@@ -8104,7 +8104,7 @@ __kmp_determine_reduction_method(
|
||||
|
||||
#elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
|
||||
|
||||
-#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
|
||||
+#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
|
||||
// basic tuning
|
||||
|
||||
Index: llvm-toolchain-8-8~+rc1/openmp/runtime/src/z_Linux_util.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/openmp/runtime/src/z_Linux_util.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/openmp/runtime/src/z_Linux_util.cpp
|
||||
@@ -448,7 +448,7 @@ void __kmp_terminate_thread(int gtid) {
|
||||
static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
|
||||
int stack_data;
|
||||
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_HURD
|
||||
+ KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
pthread_attr_t attr;
|
||||
int status;
|
||||
size_t size = 0;
|
||||
@@ -502,7 +502,7 @@ static void *__kmp_launch_worker(void *t
|
||||
#endif /* KMP_BLOCK_SIGNALS */
|
||||
void *exit_val;
|
||||
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_OPENBSD || KMP_OS_HURD
|
||||
+ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
void *volatile padding = 0;
|
||||
#endif
|
||||
int gtid;
|
||||
@@ -1772,7 +1772,7 @@ static int __kmp_get_xproc(void) {
|
||||
int r = 0;
|
||||
|
||||
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
||||
- KMP_OS_OPENBSD || KMP_OS_HURD
|
||||
+ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
|
||||
r = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
|
||||
@@ -1967,7 +1967,7 @@ int __kmp_is_address_mapped(void *addr)
|
||||
int found = 0;
|
||||
int rc;
|
||||
|
||||
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD
|
||||
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
|
||||
|
||||
/* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address
|
||||
ranges mapped into the address space. */
|
13
debian/patches/kfreebsd/kfreebsd-threads-build.diff
vendored
Normal file
13
debian/patches/kfreebsd/kfreebsd-threads-build.diff
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Index: llvm-toolchain-7-7.0.1/libcxx/src/thread.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/libcxx/src/thread.cpp
|
||||
+++ llvm-toolchain-7-7.0.1/libcxx/src/thread.cpp
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
# include <sys/param.h>
|
||||
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
||||
+# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
|
||||
# include <sys/sysctl.h>
|
||||
# endif
|
||||
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
612
debian/patches/kfreebsd/kfreebsd-triple-clang.diff
vendored
Normal file
612
debian/patches/kfreebsd/kfreebsd-triple-clang.diff
vendored
Normal file
@ -0,0 +1,612 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/CMakeLists.txt
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/clang/lib/Driver/CMakeLists.txt
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/CMakeLists.txt
|
||||
@@ -49,6 +49,7 @@ add_clang_library(clangDriver
|
||||
ToolChains/HIP.cpp
|
||||
ToolChains/Hexagon.cpp
|
||||
ToolChains/Hurd.cpp
|
||||
+ ToolChains/KFreeBSD.cpp
|
||||
ToolChains/Linux.cpp
|
||||
ToolChains/MipsLinux.cpp
|
||||
ToolChains/MinGW.cpp
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/Driver.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/clang/lib/Driver/Driver.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/Driver.cpp
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "ToolChains/Haiku.h"
|
||||
#include "ToolChains/Hexagon.h"
|
||||
#include "ToolChains/Hurd.h"
|
||||
+#include "ToolChains/KFreeBSD.h"
|
||||
#include "ToolChains/Lanai.h"
|
||||
#include "ToolChains/Linux.h"
|
||||
#include "ToolChains/MSP430.h"
|
||||
@@ -4546,6 +4547,9 @@ const ToolChain &Driver::getToolChain(co
|
||||
case llvm::Triple::FreeBSD:
|
||||
TC = llvm::make_unique<toolchains::FreeBSD>(*this, Target, Args);
|
||||
break;
|
||||
+ case llvm::Triple::kFreeBSD:
|
||||
+ TC = llvm::make_unique<toolchains::kFreeBSD>(*this, Target, Args);
|
||||
+ break;
|
||||
case llvm::Triple::Minix:
|
||||
TC = llvm::make_unique<toolchains::Minix>(*this, Target, Args);
|
||||
break;
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/Clang.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/clang/lib/Driver/ToolChains/Clang.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/Clang.cpp
|
||||
@@ -535,7 +535,7 @@ static bool useFramePointerForTargetByDe
|
||||
}
|
||||
|
||||
if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI ||
|
||||
- Triple.isOSHurd()) {
|
||||
+ Triple.isOSHurd() || Triple.isOSkFreeBSD()) {
|
||||
switch (Triple.getArch()) {
|
||||
// Don't use a frame pointer on linux if optimizing for certain targets.
|
||||
case llvm::Triple::mips64:
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/Gnu.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/clang/lib/Driver/ToolChains/Gnu.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/Gnu.cpp
|
||||
@@ -522,6 +522,18 @@ void tools::gnutools::Linker::ConstructJ
|
||||
CmdArgs.push_back("--wrap=pthread_create");
|
||||
|
||||
CmdArgs.push_back("-lc");
|
||||
+ if (getToolChain().getTriple().isOSkFreeBSD()) {
|
||||
+ switch (getToolChain().getArch()) {
|
||||
+ case llvm::Triple::x86_64:
|
||||
+ CmdArgs.push_back("-rpath-link=/lib/x86_64-kfreebsd-gnu");
|
||||
+ break;
|
||||
+ case llvm::Triple::x86:
|
||||
+ CmdArgs.push_back("-rpath-link=/lib/i386-kfreebsd-gnu");
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
// Add IAMCU specific libs, if needed.
|
||||
if (IsIAMCU)
|
||||
@@ -1898,7 +1910,8 @@ void Generic_GCC::GCCInstallationDetecto
|
||||
"x86_64-redhat-linux", "x86_64-suse-linux",
|
||||
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
|
||||
"x86_64-slackware-linux", "x86_64-unknown-linux",
|
||||
- "x86_64-amazon-linux", "x86_64-linux-android"};
|
||||
+ "x86_64-amazon-linux", "x86_64-linux-android",
|
||||
+ "x86_64-kfreebsd-gnu", "x86_64-pc-kfreebsd-gnu"};
|
||||
static const char *const X32LibDirs[] = {"/libx32"};
|
||||
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
|
||||
static const char *const X86Triples[] = {
|
||||
@@ -1907,6 +1920,8 @@ void Generic_GCC::GCCInstallationDetecto
|
||||
"i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
|
||||
"i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu",
|
||||
"i686-linux-android", "i386-gnu", "i486-gnu",
|
||||
+ "i686-kfreebsd-gnu", "i686-pc-kfreebsd-gnu", "i486-kfreebsd-gnu",
|
||||
+ "i386-kfreebsd-gnu",
|
||||
"i586-gnu", "i686-gnu"};
|
||||
|
||||
static const char *const MIPSLibDirs[] = {"/lib"};
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/KFreeBSD.cpp
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/KFreeBSD.cpp
|
||||
@@ -0,0 +1,459 @@
|
||||
+//===--- KFreeBSD.cpp - kFreeBSD ToolChain Implementations --------*- C++ -*-===//
|
||||
+//
|
||||
+// The LLVM Compiler Infrastructure
|
||||
+//
|
||||
+// This file is distributed under the University of Illinois Open Source
|
||||
+// License. See LICENSE.TXT for details.
|
||||
+//
|
||||
+//===----------------------------------------------------------------------===//
|
||||
+
|
||||
+#include "KFreeBSD.h"
|
||||
+#include "CommonArgs.h"
|
||||
+#include "clang/Config/config.h"
|
||||
+#include "clang/Driver/Driver.h"
|
||||
+#include "clang/Driver/Options.h"
|
||||
+#include "clang/Driver/SanitizerArgs.h"
|
||||
+#include "llvm/Option/ArgList.h"
|
||||
+#include "llvm/ProfileData/InstrProf.h"
|
||||
+#include "llvm/Support/Path.h"
|
||||
+#include "llvm/Support/VirtualFileSystem.h"
|
||||
+
|
||||
+using namespace clang::driver;
|
||||
+using namespace clang::driver::toolchains;
|
||||
+using namespace clang;
|
||||
+using namespace llvm::opt;
|
||||
+
|
||||
+using tools::addPathIfExists;
|
||||
+
|
||||
+/// Get our best guess at the multiarch triple for a target.
|
||||
+///
|
||||
+/// Debian-based systems are starting to use a multiarch setup where they use
|
||||
+/// a target-triple directory in the library and header search paths.
|
||||
+/// Unfortunately, this triple does not align with the vanilla target triple,
|
||||
+/// so we provide a rough mapping here.
|
||||
+static std::string getMultiarchTriple(const Driver &D,
|
||||
+ const llvm::Triple &TargetTriple,
|
||||
+ StringRef SysRoot) {
|
||||
+ // For most architectures, just use whatever we have rather than trying to be
|
||||
+ // clever.
|
||||
+ switch (TargetTriple.getArch()) {
|
||||
+ default:
|
||||
+ break;
|
||||
+
|
||||
+ // We use the existence of '/lib/<triple>' as a directory to detect
|
||||
+ // some common kfreebsd triples that don't quite match the Clang
|
||||
+ // triple for both 32-bit and 64-bit targets. Multiarch fixes its
|
||||
+ // install triples to these regardless of what the actual target
|
||||
+ // triple is.
|
||||
+ case llvm::Triple::x86_64:
|
||||
+ if (D.getVFS().exists(SysRoot + "/lib/x86_64-kfreebsd-gnu"))
|
||||
+ return "x86_64-kfreebsd-gnu";
|
||||
+ break;
|
||||
+ case llvm::Triple::x86:
|
||||
+ if (D.getVFS().exists(SysRoot + "/lib/i386-kfreebsd-gnu"))
|
||||
+ return "i386-kfreebsd-gnu";
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return TargetTriple.str();
|
||||
+}
|
||||
+
|
||||
+static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
|
||||
+ // It happens that only x86 and PPC use the 'lib32' variant of oslibdir, and
|
||||
+ // using that variant while targeting other architectures causes problems
|
||||
+ // because the libraries are laid out in shared system roots that can't cope
|
||||
+ // with a 'lib32' library search path being considered. So we only enable
|
||||
+ // them when we know we may need it.
|
||||
+ //
|
||||
+ // FIXME: This is a bit of a hack. We should really unify this code for
|
||||
+ // reasoning about oslibdir spellings with the lib dir spellings in the
|
||||
+ // GCCInstallationDetector, but that is a more significant refactoring.
|
||||
+
|
||||
+ if (Triple.getArch() == llvm::Triple::x86)
|
||||
+ return "lib";
|
||||
+
|
||||
+ if (Triple.getArch() == llvm::Triple::x86_64)
|
||||
+ return "lib";
|
||||
+
|
||||
+ return Triple.isArch32Bit() ? "lib" : "lib64";
|
||||
+}
|
||||
+
|
||||
+static void addMultilibsFilePaths(const Driver &D, const MultilibSet &Multilibs,
|
||||
+ const Multilib &Multilib,
|
||||
+ StringRef InstallPath,
|
||||
+ ToolChain::path_list &Paths) {
|
||||
+ if (const auto &PathsCallback = Multilibs.filePathsCallback())
|
||||
+ for (const auto &Path : PathsCallback(Multilib))
|
||||
+ addPathIfExists(D, InstallPath + Path, Paths);
|
||||
+}
|
||||
+
|
||||
+kFreeBSD::kFreeBSD(const Driver &D, const llvm::Triple &Triple,
|
||||
+ const ArgList &Args)
|
||||
+ : Generic_ELF(D, Triple, Args) {
|
||||
+ GCCInstallation.init(Triple, Args);
|
||||
+ Multilibs = GCCInstallation.getMultilibs();
|
||||
+ std::string SysRoot = computeSysRoot();
|
||||
+
|
||||
+ // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
|
||||
+ // least) put various tools in a triple-prefixed directory off of the parent
|
||||
+ // of the GCC installation. We use the GCC triple here to ensure that we end
|
||||
+ // up with tools that support the same amount of cross compiling as the
|
||||
+ // detected GCC installation. For example, if we find a GCC installation
|
||||
+ // targeting x86_64, but it is a bi-arch GCC installation, it can also be
|
||||
+ // used to target i386.
|
||||
+ // FIXME: This seems unlikely to be Linux-, kFreeBSD- or Hurd-specific.
|
||||
+ ToolChain::path_list &PPaths = getProgramPaths();
|
||||
+ PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
|
||||
+ GCCInstallation.getTriple().str() + "/bin")
|
||||
+ .str());
|
||||
+
|
||||
+#ifdef ENABLE_LINKER_BUILD_ID
|
||||
+ ExtraOpts.push_back("--build-id");
|
||||
+#endif
|
||||
+
|
||||
+ // The selection of paths to try here is designed to match the patterns which
|
||||
+ // the GCC driver itself uses, as this is part of the GCC-compatible driver.
|
||||
+ // This was determined by running GCC in a fake filesystem, creating all
|
||||
+ // possible permutations of these directories, and seeing which ones it added
|
||||
+ // to the link paths.
|
||||
+ path_list &Paths = getFilePaths();
|
||||
+
|
||||
+ const std::string OSLibDir = getOSLibDir(Triple, Args);
|
||||
+ const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
|
||||
+
|
||||
+ // Add the multilib suffixed paths where they are available.
|
||||
+ if (GCCInstallation.isValid()) {
|
||||
+ const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
|
||||
+ const std::string &LibPath = GCCInstallation.getParentLibPath();
|
||||
+ const Multilib &Multilib = GCCInstallation.getMultilib();
|
||||
+ const MultilibSet &Multilibs = GCCInstallation.getMultilibs();
|
||||
+
|
||||
+ // Add toolchain / multilib specific file paths.
|
||||
+ addMultilibsFilePaths(D, Multilibs, Multilib,
|
||||
+ GCCInstallation.getInstallPath(), Paths);
|
||||
+
|
||||
+ // Sourcery CodeBench MIPS toolchain holds some libraries under
|
||||
+ // a biarch-like suffix of the GCC installation.
|
||||
+ addPathIfExists(D, GCCInstallation.getInstallPath() + Multilib.gccSuffix(),
|
||||
+ Paths);
|
||||
+
|
||||
+ // GCC cross compiling toolchains will install target libraries which ship
|
||||
+ // as part of the toolchain under <prefix>/<triple>/<libdir> rather than as
|
||||
+ // any part of the GCC installation in
|
||||
+ // <prefix>/<libdir>/gcc/<triple>/<version>. This decision is somewhat
|
||||
+ // debatable, but is the reality today. We need to search this tree even
|
||||
+ // when we have a sysroot somewhere else. It is the responsibility of
|
||||
+ // whomever is doing the cross build targeting a sysroot using a GCC
|
||||
+ // installation that is *not* within the system root to ensure two things:
|
||||
+ //
|
||||
+ // 1) Any DSOs that are linked in from this tree or from the install path
|
||||
+ // above must be present on the system root and found via an
|
||||
+ // appropriate rpath.
|
||||
+ // 2) There must not be libraries installed into
|
||||
+ // <prefix>/<triple>/<libdir> unless they should be preferred over
|
||||
+ // those within the system root.
|
||||
+ //
|
||||
+ // Note that this matches the GCC behavior. See the below comment for where
|
||||
+ // Clang diverges from GCC's behavior.
|
||||
+ addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib/../" +
|
||||
+ OSLibDir + Multilib.osSuffix(),
|
||||
+ Paths);
|
||||
+
|
||||
+ // If the GCC installation we found is inside of the sysroot, we want to
|
||||
+ // prefer libraries installed in the parent prefix of the GCC installation.
|
||||
+ // It is important to *not* use these paths when the GCC installation is
|
||||
+ // outside of the system root as that can pick up unintended libraries.
|
||||
+ // This usually happens when there is an external cross compiler on the
|
||||
+ // host system, and a more minimal sysroot available that is the target of
|
||||
+ // the cross. Note that GCC does include some of these directories in some
|
||||
+ // configurations but this seems somewhere between questionable and simply
|
||||
+ // a bug.
|
||||
+ if (StringRef(LibPath).startswith(SysRoot)) {
|
||||
+ addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
|
||||
+ addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Similar to the logic for GCC above, if we currently running Clang inside
|
||||
+ // of the requested system root, add its parent library paths to
|
||||
+ // those searched.
|
||||
+ // FIXME: It's not clear whether we should use the driver's installed
|
||||
+ // directory ('Dir' below) or the ResourceDir.
|
||||
+ if (StringRef(D.Dir).startswith(SysRoot)) {
|
||||
+ addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths);
|
||||
+ addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths);
|
||||
+ }
|
||||
+
|
||||
+ addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
|
||||
+ addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
|
||||
+
|
||||
+ addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
|
||||
+ addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
|
||||
+
|
||||
+ // Try walking via the GCC triple path in case of biarch or multiarch GCC
|
||||
+ // installations with strange symlinks.
|
||||
+ if (GCCInstallation.isValid()) {
|
||||
+ addPathIfExists(D,
|
||||
+ SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
|
||||
+ "/../../" + OSLibDir,
|
||||
+ Paths);
|
||||
+
|
||||
+ // Add the 'other' biarch variant path
|
||||
+ Multilib BiarchSibling;
|
||||
+ if (GCCInstallation.getBiarchSibling(BiarchSibling)) {
|
||||
+ addPathIfExists(D, GCCInstallation.getInstallPath() +
|
||||
+ BiarchSibling.gccSuffix(),
|
||||
+ Paths);
|
||||
+ }
|
||||
+
|
||||
+ // See comments above on the multilib variant for details of why this is
|
||||
+ // included even from outside the sysroot.
|
||||
+ const std::string &LibPath = GCCInstallation.getParentLibPath();
|
||||
+ const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
|
||||
+ const Multilib &Multilib = GCCInstallation.getMultilib();
|
||||
+ addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib" +
|
||||
+ Multilib.osSuffix(),
|
||||
+ Paths);
|
||||
+
|
||||
+ // See comments above on the multilib variant for details of why this is
|
||||
+ // only included from within the sysroot.
|
||||
+ if (StringRef(LibPath).startswith(SysRoot))
|
||||
+ addPathIfExists(D, LibPath, Paths);
|
||||
+ }
|
||||
+
|
||||
+ // Similar to the logic for GCC above, if we are currently running Clang
|
||||
+ // inside of the requested system root, add its parent library path to those
|
||||
+ // searched.
|
||||
+ // FIXME: It's not clear whether we should use the driver's installed
|
||||
+ // directory ('Dir' below) or the ResourceDir.
|
||||
+ if (StringRef(D.Dir).startswith(SysRoot))
|
||||
+ addPathIfExists(D, D.Dir + "/../lib", Paths);
|
||||
+
|
||||
+ addPathIfExists(D, SysRoot + "/lib", Paths);
|
||||
+ addPathIfExists(D, SysRoot + "/usr/lib", Paths);
|
||||
+}
|
||||
+
|
||||
+bool kFreeBSD::HasNativeLLVMSupport() const { return true; }
|
||||
+
|
||||
+Tool *kFreeBSD::buildLinker() const { return new tools::gnutools::Linker(*this); }
|
||||
+
|
||||
+Tool *kFreeBSD::buildAssembler() const {
|
||||
+ return new tools::gnutools::Assembler(*this);
|
||||
+}
|
||||
+
|
||||
+std::string kFreeBSD::computeSysRoot() const {
|
||||
+ if (!getDriver().SysRoot.empty())
|
||||
+ return getDriver().SysRoot;
|
||||
+
|
||||
+ return std::string();
|
||||
+}
|
||||
+
|
||||
+std::string kFreeBSD::getDynamicLinker(const ArgList &Args) const {
|
||||
+ const llvm::Triple::ArchType Arch = getArch();
|
||||
+
|
||||
+ if (Arch == llvm::Triple::x86_64)
|
||||
+ return "/lib/ld-kfreebsd-x86-64.so.1";
|
||||
+
|
||||
+ if (Arch == llvm::Triple::x86)
|
||||
+ return "/lib/ld.so.1";
|
||||
+
|
||||
+ llvm_unreachable("unsupported architecture");
|
||||
+}
|
||||
+
|
||||
+void kFreeBSD::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
|
||||
+ ArgStringList &CC1Args) const {
|
||||
+ const Driver &D = getDriver();
|
||||
+ std::string SysRoot = computeSysRoot();
|
||||
+
|
||||
+ if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
|
||||
+ return;
|
||||
+
|
||||
+ if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
|
||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include");
|
||||
+
|
||||
+ if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
|
||||
+ SmallString<128> P(D.ResourceDir);
|
||||
+ llvm::sys::path::append(P, "include");
|
||||
+ addSystemInclude(DriverArgs, CC1Args, P);
|
||||
+ }
|
||||
+
|
||||
+ if (DriverArgs.hasArg(options::OPT_nostdlibinc))
|
||||
+ return;
|
||||
+
|
||||
+ // Check for configure-time C include directories.
|
||||
+ StringRef CIncludeDirs(C_INCLUDE_DIRS);
|
||||
+ if (CIncludeDirs != "") {
|
||||
+ SmallVector<StringRef, 5> dirs;
|
||||
+ CIncludeDirs.split(dirs, ":");
|
||||
+ for (StringRef dir : dirs) {
|
||||
+ StringRef Prefix =
|
||||
+ llvm::sys::path::is_absolute(dir) ? StringRef(SysRoot) : "";
|
||||
+ addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
|
||||
+ }
|
||||
+ // addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Lacking those, try to detect the correct set of system includes for the
|
||||
+ // target triple.
|
||||
+
|
||||
+ // Add include directories specific to the selected multilib set and multilib.
|
||||
+ if (GCCInstallation.isValid()) {
|
||||
+ const auto &Callback = Multilibs.includeDirsCallback();
|
||||
+ if (Callback) {
|
||||
+ for (const auto &Path : Callback(GCCInstallation.getMultilib()))
|
||||
+ addExternCSystemIncludeIfExists(
|
||||
+ DriverArgs, CC1Args, GCCInstallation.getInstallPath() + Path);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Implement generic Debian multiarch support.
|
||||
+ const StringRef X86_64MultiarchIncludeDirs[] = {
|
||||
+ "/usr/include/x86_64-kfreebsd-gnu"};
|
||||
+
|
||||
+ // CHECK
|
||||
+ const StringRef X86MultiarchIncludeDirs[] = {
|
||||
+ "/usr/include/i386-kfreebsd-gnu"};
|
||||
+
|
||||
+ ArrayRef<StringRef> MultiarchIncludeDirs;
|
||||
+ switch (getTriple().getArch()) {
|
||||
+ case llvm::Triple::x86:
|
||||
+ MultiarchIncludeDirs = X86MultiarchIncludeDirs;
|
||||
+ break;
|
||||
+ case llvm::Triple::x86_64:
|
||||
+ MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ for (StringRef Dir : MultiarchIncludeDirs) {
|
||||
+ if (D.getVFS().exists(SysRoot + Dir)) {
|
||||
+ addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + Dir);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Add an include of '/include' directly. This isn't provided by default by
|
||||
+ // system GCCs, but is often used with cross-compiling GCCs, and harmless to
|
||||
+ // add even when Clang is acting as-if it were a system compiler.
|
||||
+ addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
|
||||
+
|
||||
+ addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
|
||||
+}
|
||||
+
|
||||
+static std::string DetectLibcxxIncludePath(StringRef base) {
|
||||
+ std::error_code EC;
|
||||
+ int MaxVersion = 0;
|
||||
+ std::string MaxVersionString = "";
|
||||
+ for (llvm::sys::fs::directory_iterator LI(base, EC), LE; !EC && LI != LE;
|
||||
+ LI = LI.increment(EC)) {
|
||||
+ StringRef VersionText = llvm::sys::path::filename(LI->path());
|
||||
+ int Version;
|
||||
+ if (VersionText[0] == 'v' &&
|
||||
+ !VersionText.slice(1, StringRef::npos).getAsInteger(10, Version)) {
|
||||
+ if (Version > MaxVersion) {
|
||||
+ MaxVersion = Version;
|
||||
+ MaxVersionString = VersionText;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return MaxVersion ? (base + "/" + MaxVersionString).str() : "";
|
||||
+}
|
||||
+
|
||||
+void kFreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
+ llvm::opt::ArgStringList &CC1Args) const {
|
||||
+ const std::string& SysRoot = computeSysRoot();
|
||||
+ const std::string LibCXXIncludePathCandidates[] = {
|
||||
+ DetectLibcxxIncludePath(getDriver().ResourceDir + "/include/c++"),
|
||||
+ DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
|
||||
+ // If this is a development, non-installed, clang, libcxx will
|
||||
+ // not be found at ../include/c++ but it likely to be found at
|
||||
+ // one of the following two locations:
|
||||
+ DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"),
|
||||
+ DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") };
|
||||
+ for (const auto &IncludePath : LibCXXIncludePathCandidates) {
|
||||
+ if (IncludePath.empty() || !getVFS().exists(IncludePath))
|
||||
+ continue;
|
||||
+ // Use the first candidate that exists.
|
||||
+ addSystemInclude(DriverArgs, CC1Args, IncludePath);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void kFreeBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
+ llvm::opt::ArgStringList &CC1Args) const {
|
||||
+ // We need a detected GCC installation on kFreeBSD to provide libstdc++'s
|
||||
+ // headers.
|
||||
+ if (!GCCInstallation.isValid())
|
||||
+ return;
|
||||
+
|
||||
+ // By default, look for the C++ headers in an include directory adjacent to
|
||||
+ // the lib directory of the GCC installation. Note that this is expect to be
|
||||
+ // equivalent to '/usr/include/c++/X.Y' in almost all cases.
|
||||
+ StringRef LibDir = GCCInstallation.getParentLibPath();
|
||||
+ StringRef InstallDir = GCCInstallation.getInstallPath();
|
||||
+ StringRef TripleStr = GCCInstallation.getTriple().str();
|
||||
+ const Multilib &Multilib = GCCInstallation.getMultilib();
|
||||
+ const std::string GCCMultiarchTriple = getMultiarchTriple(
|
||||
+ getDriver(), GCCInstallation.getTriple(), getDriver().SysRoot);
|
||||
+ const std::string TargetMultiarchTriple =
|
||||
+ getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot);
|
||||
+ const GCCVersion &Version = GCCInstallation.getVersion();
|
||||
+
|
||||
+ // The primary search for libstdc++ supports multiarch variants.
|
||||
+ if (addLibStdCXXIncludePaths(LibDir.str() + "/../include",
|
||||
+ "/c++/" + Version.Text, TripleStr,
|
||||
+ GCCMultiarchTriple, TargetMultiarchTriple,
|
||||
+ Multilib.includeSuffix(), DriverArgs, CC1Args))
|
||||
+ return;
|
||||
+
|
||||
+ // Otherwise, fall back on a bunch of options which don't use multiarch
|
||||
+ // layouts for simplicity.
|
||||
+ const std::string LibStdCXXIncludePathCandidates[] = {
|
||||
+ // Gentoo is weird and places its headers inside the GCC install,
|
||||
+ // so if the first attempt to find the headers fails, try these patterns.
|
||||
+ InstallDir.str() + "/include/g++-v" + Version.Text,
|
||||
+ InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
|
||||
+ Version.MinorStr,
|
||||
+ InstallDir.str() + "/include/g++-v" + Version.MajorStr,
|
||||
+ // Android standalone toolchain has C++ headers in yet another place.
|
||||
+ LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,
|
||||
+ // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
|
||||
+ // without a subdirectory corresponding to the gcc version.
|
||||
+ LibDir.str() + "/../include/c++",
|
||||
+ };
|
||||
+
|
||||
+ for (const auto &IncludePath : LibStdCXXIncludePathCandidates) {
|
||||
+ if (addLibStdCXXIncludePaths(IncludePath, /*Suffix*/ "", TripleStr,
|
||||
+ /*GCCMultiarchTriple*/ "",
|
||||
+ /*TargetMultiarchTriple*/ "",
|
||||
+ Multilib.includeSuffix(), DriverArgs, CC1Args))
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* FIXME:
|
||||
+/home/srs/DEBs/llvm-toolchain-7/llvm-toolchain-7-7.0.1~+rc2-7/tools/clang/lib/Driver/ToolChains/KFreeBSD.cpp:431:15: error: no declaration matches ‘clang::SanitizerMask clang::driver::toolchains::kFreeBSD::getSupportedSanitizers() const’
|
||||
+ SanitizerMask kFreeBSD::getSupportedSanitizers() const {
|
||||
+*/
|
||||
+SanitizerMask kFreeBSD::getSupportedSanitizers() const {
|
||||
+ const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
|
||||
+ const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
|
||||
+ SanitizerMask Res = ToolChain::getSupportedSanitizers();
|
||||
+ // FIXME: Add here!!
|
||||
+ if (IsX86_64) {
|
||||
+ Res |= SanitizerKind::DataFlow;
|
||||
+ Res |= SanitizerKind::Leak;
|
||||
+ Res |= SanitizerKind::Thread;
|
||||
+ Res |= SanitizerKind::Efficiency;
|
||||
+ Res |= SanitizerKind::Scudo;
|
||||
+ Res |= SanitizerKind::HWAddress;
|
||||
+ Res |= SanitizerKind::KernelHWAddress;
|
||||
+ }
|
||||
+ if (IsX86 || IsX86_64)
|
||||
+ Res |= SanitizerKind::Function;
|
||||
+
|
||||
+ return Res;
|
||||
+}
|
||||
+
|
||||
Index: llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/KFreeBSD.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ llvm-toolchain-8-8~+rc1/clang/lib/Driver/ToolChains/KFreeBSD.h
|
||||
@@ -0,0 +1,54 @@
|
||||
+//===--- KFreeBSD.h - kFreeBSD ToolChain Implementations ----------*- C++ -*-===//
|
||||
+//
|
||||
+// The LLVM Compiler Infrastructure
|
||||
+//
|
||||
+// This file is distributed under the University of Illinois Open Source
|
||||
+// License. See LICENSE.TXT for details.
|
||||
+//
|
||||
+//===----------------------------------------------------------------------===//
|
||||
+
|
||||
+#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
|
||||
+#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
|
||||
+
|
||||
+#include "Gnu.h"
|
||||
+#include "clang/Driver/ToolChain.h"
|
||||
+
|
||||
+namespace clang {
|
||||
+namespace driver {
|
||||
+namespace toolchains {
|
||||
+
|
||||
+class LLVM_LIBRARY_VISIBILITY kFreeBSD : public Generic_ELF {
|
||||
+public:
|
||||
+ kFreeBSD(const Driver &D, const llvm::Triple &Triple,
|
||||
+ const llvm::opt::ArgList &Args);
|
||||
+
|
||||
+ bool HasNativeLLVMSupport() const override;
|
||||
+
|
||||
+ void
|
||||
+ AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
|
||||
+ llvm::opt::ArgStringList &CC1Args) const override;
|
||||
+ void addLibCxxIncludePaths(
|
||||
+ const llvm::opt::ArgList &DriverArgs,
|
||||
+ llvm::opt::ArgStringList &CC1Args) const override;
|
||||
+ void addLibStdCxxIncludePaths(
|
||||
+ const llvm::opt::ArgList &DriverArgs,
|
||||
+ llvm::opt::ArgStringList &CC1Args) const override;
|
||||
+
|
||||
+ SanitizerMask getSupportedSanitizers() const override;
|
||||
+
|
||||
+ virtual std::string computeSysRoot() const;
|
||||
+
|
||||
+ virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const;
|
||||
+
|
||||
+ std::vector<std::string> ExtraOpts;
|
||||
+
|
||||
+protected:
|
||||
+ Tool *buildAssembler() const override;
|
||||
+ Tool *buildLinker() const override;
|
||||
+};
|
||||
+
|
||||
+} // end namespace toolchains
|
||||
+} // end namespace driver
|
||||
+} // end namespace clang
|
||||
+
|
||||
+#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
|
23
debian/patches/kfreebsd/kfreebsd-triple.diff
vendored
Normal file
23
debian/patches/kfreebsd/kfreebsd-triple.diff
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
Index: llvm-toolchain-7-7.0.1/unittests/ADT/TripleTest.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-7-7.0.1.orig/unittests/ADT/TripleTest.cpp
|
||||
+++ llvm-toolchain-7-7.0.1/unittests/ADT/TripleTest.cpp
|
||||
@@ -99,6 +99,18 @@ TEST(TripleTest, ParsedIDs) {
|
||||
EXPECT_EQ(Triple::Hurd, T.getOS());
|
||||
EXPECT_EQ(Triple::GNU, T.getEnvironment());
|
||||
|
||||
+ T = Triple("i386-pc-kfreebsd-gnu");
|
||||
+ EXPECT_EQ(Triple::x86, T.getArch());
|
||||
+ EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
+ EXPECT_EQ(Triple::kFreeBSD, T.getOS());
|
||||
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
|
||||
+
|
||||
+ T = Triple("x86_64-pc-kfreebsd-gnu");
|
||||
+ EXPECT_EQ(Triple::x86_64, T.getArch());
|
||||
+ EXPECT_EQ(Triple::PC, T.getVendor());
|
||||
+ EXPECT_EQ(Triple::kFreeBSD, T.getOS());
|
||||
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
|
||||
+
|
||||
T = Triple("x86_64-pc-linux-gnu");
|
||||
EXPECT_EQ(Triple::x86_64, T.getArch());
|
||||
EXPECT_EQ(Triple::PC, T.getVendor());
|
35
debian/patches/kfreebsd/lib_Support.diff
vendored
Normal file
35
debian/patches/kfreebsd/lib_Support.diff
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/lib/Support/Triple.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lib/Support/Triple.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/lib/Support/Triple.cpp
|
||||
@@ -182,7 +182,7 @@ StringRef Triple::getOSTypeName(OSType K
|
||||
case FreeBSD: return "freebsd";
|
||||
case Fuchsia: return "fuchsia";
|
||||
case IOS: return "ios";
|
||||
- case KFreeBSD: return "kfreebsd";
|
||||
+ case kFreeBSD: return "kfreebsd";
|
||||
case Linux: return "linux";
|
||||
case Lv2: return "lv2";
|
||||
case MacOSX: return "macosx";
|
||||
@@ -479,7 +479,7 @@ static Triple::OSType parseOS(StringRef
|
||||
.StartsWith("freebsd", Triple::FreeBSD)
|
||||
.StartsWith("fuchsia", Triple::Fuchsia)
|
||||
.StartsWith("ios", Triple::IOS)
|
||||
- .StartsWith("kfreebsd", Triple::KFreeBSD)
|
||||
+ .StartsWith("kfreebsd", Triple::kFreeBSD)
|
||||
.StartsWith("linux", Triple::Linux)
|
||||
.StartsWith("lv2", Triple::Lv2)
|
||||
.StartsWith("macos", Triple::MacOSX)
|
||||
Index: llvm-toolchain-8-8~+rc1/lib/Support/Unix/Path.inc
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lib/Support/Unix/Path.inc
|
||||
+++ llvm-toolchain-8-8~+rc1/lib/Support/Unix/Path.inc
|
||||
@@ -62,7 +62,7 @@
|
||||
#define FSTATVFS fstatvfs
|
||||
#define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
|
||||
#else
|
||||
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
|
||||
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
#elif defined(__linux__)
|
26
debian/patches/kfreebsd/lib_Target_X86.diff
vendored
Normal file
26
debian/patches/kfreebsd/lib_Target_X86.diff
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/lib/Target/X86/X86Subtarget.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lib/Target/X86/X86Subtarget.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/lib/Target/X86/X86Subtarget.cpp
|
||||
@@ -284,7 +284,7 @@ void X86Subtarget::initSubtargetFeatures
|
||||
if (StackAlignOverride)
|
||||
stackAlignment = StackAlignOverride;
|
||||
else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
|
||||
- isTargetKFreeBSD() || In64BitMode)
|
||||
+ isTargetkFreeBSD() || In64BitMode)
|
||||
stackAlignment = 16;
|
||||
|
||||
// Some CPUs have more overhead for gather. The specified overhead is relative
|
||||
Index: llvm-toolchain-8-8~+rc1/lib/Target/X86/X86Subtarget.h
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lib/Target/X86/X86Subtarget.h
|
||||
+++ llvm-toolchain-8-8~+rc1/lib/Target/X86/X86Subtarget.h
|
||||
@@ -731,7 +731,7 @@ public:
|
||||
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
|
||||
|
||||
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
||||
- bool isTargetKFreeBSD() const { return TargetTriple.isOSKFreeBSD(); }
|
||||
+ bool isTargetkFreeBSD() const { return TargetTriple.isOSkFreeBSD(); }
|
||||
bool isTargetGlibc() const { return TargetTriple.isOSGlibc(); }
|
||||
bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
|
||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
18
debian/patches/kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
vendored
Normal file
18
debian/patches/kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/lldb/source/Host/freebsd/Host.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lldb/source/Host/freebsd/Host.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/lldb/source/Host/freebsd/Host.cpp
|
||||
@@ -11,6 +11,13 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/exec.h>
|
||||
+#ifdef __FreeBSD_kernel__
|
||||
+# ifdef __amd64__
|
||||
+# include </usr/include/x86_64-kfreebsd-gnu/sys/kglue/sys/types.h>
|
||||
+# else
|
||||
+# include </usr/include/i386-kfreebsd-gnu/sys/kglue/sys/types.h>
|
||||
+# endif
|
||||
+#endif
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/sysctl.h>
|
28
debian/patches/kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
vendored
Normal file
28
debian/patches/kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
+#ifndef __FreeBSD_kernel__
|
||||
#include <pthread_np.h>
|
||||
+#endif
|
||||
#include <stdlib.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
||||
Index: llvm-toolchain-8-8~+rc1/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
|
||||
+++ llvm-toolchain-8-8~+rc1/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
+#ifndef __FreeBSD_kernel__
|
||||
#include <pthread_np.h>
|
||||
+#endif
|
||||
#include <stdlib.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
12
debian/patches/kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
vendored
Normal file
12
debian/patches/kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
Index: llvm-toolchain-8-8~+rc1/tools/llvm-shlib/CMakeLists.txt
|
||||
===================================================================
|
||||
--- llvm-toolchain-8-8~+rc1.orig/tools/llvm-shlib/CMakeLists.txt
|
||||
+++ llvm-toolchain-8-8~+rc1/tools/llvm-shlib/CMakeLists.txt
|
||||
@@ -46,6 +46,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
list(REMOVE_DUPLICATES LIB_NAMES)
|
||||
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
16
debian/patches/series
vendored
16
debian/patches/series
vendored
@ -110,3 +110,19 @@ impl-path-hurd.diff
|
||||
D49754-powerpcspe-clang.diff
|
||||
D54409-powerpcspe-register-spilling.diff
|
||||
D54584-powerpcspe-double-parameter.diff
|
||||
|
||||
# kfreebsd
|
||||
kfreebsd/clang_lib_Basic_Targets.diff
|
||||
kfreebsd/CMakeLists.txt.diff
|
||||
kfreebsd/compiler-rt_lib.diff
|
||||
kfreebsd/include_llvm_ADT_Triple.h.diff
|
||||
kfreebsd/kfreebsd-libcxx-threads-detection.diff
|
||||
kfreebsd/kfreebsd-openmp.diff
|
||||
kfreebsd/kfreebsd-threads-build.diff
|
||||
kfreebsd/kfreebsd-triple-clang.diff
|
||||
kfreebsd/kfreebsd-triple.diff
|
||||
kfreebsd/lib_Support.diff
|
||||
kfreebsd/lib_Target_X86.diff
|
||||
kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
|
||||
kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
|
||||
kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
|
||||
|
7
debian/qualify-clang.sh
vendored
7
debian/qualify-clang.sh
vendored
@ -84,7 +84,12 @@ clang-$VERSION foo.c
|
||||
echo '#include <stddef.h>' > foo.c
|
||||
clang-$VERSION -c foo.c
|
||||
|
||||
|
||||
# https://bugs.launchpad.net/bugs/1810860
|
||||
clang-$VERSION -dumpversion &> foo.log
|
||||
if grep 4.2.1 foo.log; then
|
||||
echo "dumpversion still returns 4.2.1"
|
||||
# exit 1
|
||||
fi
|
||||
|
||||
# bug 903709
|
||||
echo '#include <stdatomic.h>
|
||||
|
Loading…
Reference in New Issue
Block a user