New package: mclinker

This commit is contained in:
Andrea Brancaleoni 2015-08-05 15:03:17 +02:00
parent 81e2aaf5b1
commit 45dbdc3019
5 changed files with 137 additions and 0 deletions

1
srcpkgs/mclinker-devel Symbolic link
View File

@ -0,0 +1 @@
mclinker

View File

@ -0,0 +1,77 @@
From 55c537ebf0d7b70e85126e2e2b1c675193e38696 Mon Sep 17 00:00:00 2001
From: Pete Chou <petechou@gmail.com>
Date: Fri, 19 Dec 2014 18:10:06 +0800
Subject: [PATCH] Fix build with llvm trunk@224046 or later.
commit 0be06cf3609cdf6bdc8f769348f6ffcaba560eec
Author: Rafael Espindola <rafael.espindola@gmail.com>
Date: Thu Dec 11 20:12:55 2014 +0000
Remove a convoluted way of calling close by moving the call to the only caller.
As a bonus we can actually check the return value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224046 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Core/Linker.cpp | 4 ++--
lib/Support/FileOutputBuffer.cpp | 13 +++++++------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/Core/Linker.cpp b/lib/Core/Linker.cpp
index b499b80..92747d5 100644
--- a/lib/Core/Linker.cpp
+++ b/lib/Core/Linker.cpp
@@ -281,7 +281,7 @@ bool Linker::emit(const Module& pModule, const std::string& pPath) {
FileOutputBuffer::create(
file, m_pObjLinker->getWriter()->getOutputSize(pModule), output);
- result = emit(*output.get());
+ result = emit(*output);
file.close();
return result;
}
@@ -294,7 +294,7 @@ bool Linker::emit(const Module& pModule, int pFileDescriptor) {
FileOutputBuffer::create(
file, m_pObjLinker->getWriter()->getOutputSize(pModule), output);
- return emit(*output.get());
+ return emit(*output);
}
bool Linker::reset() {
diff --git a/lib/Support/FileOutputBuffer.cpp b/lib/Support/FileOutputBuffer.cpp
index 11435ea..5418ead 100644
--- a/lib/Support/FileOutputBuffer.cpp
+++ b/lib/Support/FileOutputBuffer.cpp
@@ -19,17 +19,17 @@ FileOutputBuffer::FileOutputBuffer(llvm::sys::fs::mapped_file_region* pRegion,
FileOutputBuffer::~FileOutputBuffer() {
// Unmap buffer, letting OS flush dirty pages to file on disk.
- m_pRegion.reset(0);
+ m_pRegion.reset();
}
-std::error_code FileOutputBuffer::create(
- FileHandle& pFileHandle,
- size_t pSize,
- std::unique_ptr<FileOutputBuffer>& pResult) {
+std::error_code
+FileOutputBuffer::create(FileHandle& pFileHandle,
+ size_t pSize,
+ std::unique_ptr<FileOutputBuffer>& pResult) {
std::error_code ec;
std::unique_ptr<llvm::sys::fs::mapped_file_region> mapped_file(
new llvm::sys::fs::mapped_file_region(pFileHandle.handler(),
- false, llvm::sys::fs::mapped_file_region::readwrite, pSize, 0, ec));
+ llvm::sys::fs::mapped_file_region::readwrite, pSize, 0, ec));
if (ec)
return ec;
@@ -37,6 +37,7 @@ std::error_code FileOutputBuffer::create(
pResult.reset(new FileOutputBuffer(mapped_file.get(), pFileHandle));
if (pResult)
mapped_file.release();
+
return std::error_code();
}

View File

@ -0,0 +1,24 @@
From 3c65bd1fcb4648181bf86a5c7a45813ab0f27b8b Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Sun, 30 Aug 2015 15:59:42 +0200
Subject: [PATCH] musl
---
lib/Support/Unix/FileSystem.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Support/Unix/FileSystem.inc b/lib/Support/Unix/FileSystem.inc
index 67fdd73..0cf873d 100644
--- a/lib/Support/Unix/FileSystem.inc
+++ b/lib/Support/Unix/FileSystem.inc
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
+#include <limits.h>
namespace mcld {
namespace sys {
--
2.5.1

32
srcpkgs/mclinker/template Normal file
View File

@ -0,0 +1,32 @@
# Template file for 'mclinker'
pkgname=mclinker
version=2.9.0
revision=1
_version="${version%.*}" _version="${_version//.}"
wrksrc="$pkgname-release_${_version}"
build_style=gnu-configure
hostmakedepends="automake libtool flex llvm"
makedepends="zlib-devel libffi-devel libedit-devel ncurses-devel"
short_desc="LLVM Linker for Mobile Computing"
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
license="BSD"
homepage="https://github.com/$pkgname/$pkgname"
distfiles="$homepage/archive/release_${_version}.tar.gz"
checksum=af09905283840d3c3f29a202889711eec7fafd6090e09d3d71c9fdba5e83f4a4
patch_args="-Np1"
nocross=yes
pre_configure() {
sed -i '/unittests/d' configure.ac
sed -i 's/unittests//' Makefile.am
sed -i '/unittests/d' Makefile.am
autoreconf -fi
}
mclinker-devel_package() {
short_desc+=" - devel files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
}
}

3
srcpkgs/mclinker/update Normal file
View File

@ -0,0 +1,3 @@
site="https://api.github.com/repos/$pkgname/$pkgname/branches"
version="$_version"
pattern='"name":\s*"release_\K[^\d]*([\d\.]+)(?=")'