Build libcxx and libcxxabi statically for armv7 and test building a C++ hello world
This commit is contained in:
1 parent
43906e77d6
commit
ed96326423
5 files changed
+194
-60
No files matched your search
@@ -0,0 +1,26 @@
|
||||
From f12a5570d2d24b147122d7b64fc1dadf7226db2c Mon Sep 17 00:00:00 2001
|
||||
From: Martin Storsjo <martin@martin.st>
|
||||
Date: Fri, 25 Aug 2017 11:00:37 +0300
|
||||
Subject: [PATCH 1/2] Handle object files named *.obj in merge_archives.py
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D37133
|
||||
---
|
||||
utils/merge_archives.py | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/utils/merge_archives.py b/utils/merge_archives.py
|
||||
index 856dd3b..b1bd3cb 100755
|
||||
--- a/utils/merge_archives.py
|
||||
+++ b/utils/merge_archives.py
|
||||
@@ -120,6 +120,8 @@ def main():
|
||||
|
||||
files = glob.glob(os.path.join(temp_directory_root, '*.o'))
|
||||
if not files:
|
||||
+ files = glob.glob(os.path.join(temp_directory_root, '*.obj'))
|
||||
+ if not files:
|
||||
print_and_exit('Failed to glob for %s' % glob_path)
|
||||
cmd = [ar_exe, '-qc', args.output] + files
|
||||
execute_command_verbose(cmd, cwd=temp_directory_root, verbose=args.verbose)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 79a72b66ba63b97812b8f0076c032da9a0033e9e Mon Sep 17 00:00:00 2001
|
||||
From: Martin Storsjo <martin@martin.st>
|
||||
Date: Fri, 25 Aug 2017 11:06:31 +0300
|
||||
Subject: [PATCH 2/2] Rerun ranlib manually after merging the static libraries
|
||||
|
||||
In cross build setups, the ar used in merge_archives.py might
|
||||
not be the right one for the target; make sure to rebuild the
|
||||
index for the static library.
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D37134
|
||||
---
|
||||
lib/CMakeLists.txt | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index 5786514..56b9a22 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -272,6 +272,8 @@ if (LIBCXX_ENABLE_STATIC)
|
||||
"$<TARGET_LINKER_FILE:cxx_static>"
|
||||
"${MERGE_ARCHIVES_ABI_TARGET}"
|
||||
"${MERGE_ARCHIVES_SEARCH_PATHS}"
|
||||
+ COMMAND
|
||||
+ ${CMAKE_RANLIB} $<TARGET_LINKER_FILE:cxx_static>
|
||||
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
|
||||
)
|
||||
endif()
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 8dedb3528699061cab1fde4c80847ee492226d42 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
||||
Date: Fri, 25 Aug 2017 10:55:45 +0300
|
||||
Subject: [PATCH 1/2] headers: Add casts in ua_wcs*chr in stralign.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When building libcxx, a version of wcschr that returns const
|
||||
is provided, breaking compilation here since the return from
|
||||
wcschr is returned directly as if it were a const pointer.
|
||||
By adding these casts, compilation succeeds.
|
||||
|
||||
This matches the calls to uaw_wcschr and uaw_wcsrchr directly
|
||||
below, having similar casts.
|
||||
|
||||
Signed-off-by: Martin Storsjö <martin@martin.st>
|
||||
---
|
||||
mingw-w64-headers/include/stralign.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mingw-w64-headers/include/stralign.h b/mingw-w64-headers/include/stralign.h
|
||||
index 9b5637d..f4d9d6d 100644
|
||||
--- a/mingw-w64-headers/include/stralign.h
|
||||
+++ b/mingw-w64-headers/include/stralign.h
|
||||
@@ -118,11 +118,11 @@ extern "C" {
|
||||
|
||||
#ifndef __CRT__NO_INLINE
|
||||
__CRT_INLINE PUWSTR_C ua_wcschr(PCUWSTR String,WCHAR Character) {
|
||||
- if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
|
||||
+ if(WSTR_ALIGNED(String)) return (PUWSTR_C)wcschr((PCWSTR)String,Character);
|
||||
return (PUWSTR_C)uaw_wcschr(String,Character);
|
||||
}
|
||||
__CRT_INLINE PUWSTR_C ua_wcsrchr(PCUWSTR String,WCHAR Character) {
|
||||
- if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
|
||||
+ if(WSTR_ALIGNED(String)) return (PUWSTR_C)wcsrchr((PCWSTR)String,Character);
|
||||
return (PUWSTR_C)uaw_wcsrchr(String,Character);
|
||||
}
|
||||
#if defined(__cplusplus) && defined(_WConst_Return)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From ac615730861d430aa38435ecb55031316062d6f6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
||||
Date: Fri, 25 Aug 2017 12:02:02 +0300
|
||||
Subject: [PATCH 2/2] crt: Include _strftime_l in msvcrt.def.in
|
||||
|
||||
This fixes linking of libc++, which uses this function. libc++
|
||||
needs a msvcrt new enough to provide this function (present
|
||||
since msvcr90 in the numbered msvcrt DLLs).
|
||||
---
|
||||
mingw-w64-crt/lib-common/msvcrt.def.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in
|
||||
index c63edd2..35c685d 100644
|
||||
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
|
||||
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
|
||||
@@ -1481,6 +1481,7 @@ strcspn
|
||||
strerror
|
||||
; strerror_s replaced by emu
|
||||
strftime
|
||||
+_strftime_l
|
||||
strlen
|
||||
strncat
|
||||
strncat_s
|
||||
--
|
||||
2.7.4
|
||||
|
||||
Reference in new issue
Block a user