Skip to content

Commit

Permalink
Update Clang to build 4630689.
Browse files Browse the repository at this point in the history
Test: ./checkbuild.py && ./run_tests.py
Bug: android/ndk#593
Bug: http://b/72512648
Change-Id: I01df21b47da547efc6c8b029fc389423e9a63c23
(cherry picked from commit fa3562bbdad17357fb7fb01cb77ac546abfa99a2)
  • Loading branch information
DanAlbert committed Mar 6, 2018
1 parent 283c5b7 commit 824d75a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 33 deletions.
15 changes: 6 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ Announcements
August 2019. Start porting now to avoid surprises when the time comes. For
more information, see [this blog post](https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html).

NDK
---
Changes
-------

* Updated Clang to build 4579689.
* Updated Clang to build 4630689.
* [Issue 313]: LTO now works on Windows.
* [Issue 527]: [Undefined Behavior Sanitizer] now works for NDK binaries.
* [Issue 593]: Clang now automatically passes `--eh-frame-hdr` to the
linker even for static executables, fixing exception handling.
* Updated gtest to upstream revision 0fe96607d85cf3a25ac40da369db62bbee2939a5.
* `libandroid_support` is no longer used when your NDK API level is greater
than or equal to 21 (Lollipop). Build system maintainers: be sure to update
Expand Down Expand Up @@ -82,6 +84,7 @@ NDK
[Issue 313]: https://github.com/android-ndk/ndk/issues/313
[Issue 527]: https://github.com/android-ndk/ndk/issues/527
[Issue 540]: https://github.com/android-ndk/ndk/issues/540
[Issue 593]: https://github.com/android-ndk/ndk/issues/593
[Issue 614]: https://github.com/android-ndk/ndk/issues/614

Known Issues
Expand All @@ -92,14 +95,8 @@ Known Issues
segfaults if the containing library is `dlclose`ed on devices running M or
newer, or devices before M when using a static STL. The simple workaround is
to not call `dlclose`.
* [Issue 593]: Exception handling does not work out-of-the-box with non-arm32
static executables. Clang does not pass `--eh-frame-hdr` to the linker for
static executables. This will be fixed in a future Clang update, but for now
this issue can be worked around by adding `-Wl,--eh-frame-hdr` to your
ldflags.
* [Issue 70838247]: Gold emits broken debug information for AArch64. AArch64
still uses BFD by default.

[Issue 360]: https://github.com/android-ndk/ndk/issues/360
[Issue 593]: https://github.com/android-ndk/ndk/issues/593
[Issue 70838247]: https://issuetracker.google.com/70838247
6 changes: 0 additions & 6 deletions build/cmake/android.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,6 @@ list(APPEND ANDROID_LINKER_FLAGS_EXE
-Wl,--gc-sections
-Wl,-z,nocopyreloc)

# Clang does not automatically pass --eh-frame-hdr to the linker for static
# executables.
# https://github.com/android-ndk/ndk/issues/593
# http://b/72512648
list(APPEND ANDROID_LINKER_FLAGS_EXE -Wl,--eh-frame-hdr)

# Debug and release flags.
list(APPEND ANDROID_COMPILER_FLAGS_DEBUG -O0)
if(ANDROID_ABI MATCHES "^armeabi")
Expand Down
6 changes: 0 additions & 6 deletions build/core/build-binary.mk
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ ifneq (,$(filter true,$(NDK_APP_PIE) $(TARGET_PIE)))
LOCAL_CFLAGS += -fpie
LOCAL_LDFLAGS += -fpie -pie
endif
else
# Clang does not automatically pass --eh-frame-hdr to the linker for
# static executables.
# https://github.com/android-ndk/ndk/issues/593
# http://b/72512648
LOCAL_LDFLAGS += -Wl,--eh-frame-hdr
endif
endif
endif
Expand Down
6 changes: 0 additions & 6 deletions build/tools/make_standalone_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ def make_clang_scripts(install_dir, triple, api, windows):
if arch == 'i686':
common_flags += ' -mstackrealign'

# Clang does not automatically pass --eh-frame-hdr to the linker for static
# executables.
# https://github.com/android-ndk/ndk/issues/593
# http://b/72512648
common_flags += ' -Wl,--eh-frame-hdr'

unix_flags = common_flags
unix_flags += ' --sysroot `dirname $0`/../sysroot'

Expand Down
2 changes: 1 addition & 1 deletion build/tools/prebuilt-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ get_llvm_toolchain_binprefix ()
{
local NAME DIR BINPREFIX
local SYSTEM=${1:-$(get_prebuilt_host_tag)}
local VERSION=4579689
local VERSION=4630689
SYSTEM=${SYSTEM%_64} # Trim _64 suffix. We only have one LLVM.
BINPREFIX=$ANDROID_BUILD_TOP/prebuilts/clang/host/$SYSTEM/clang-$VERSION/bin
echo "$BINPREFIX"
Expand Down
6 changes: 1 addition & 5 deletions checkbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _install_file(src_file, dst_file):
class Clang(ndk.builds.Module):
name = 'clang'
path = 'toolchains/llvm/prebuilt/{host}'
version = 'clang-4579689'
version = 'clang-4630689'

def get_prebuilt_path(self, host):
# The 32-bit Windows Clang is a part of the 64-bit Clang package in
Expand Down Expand Up @@ -515,18 +515,14 @@ def install_arch(self, out_dir, host, arch):
shutil.copy2(llvmgold, bfd_plugins)

if not is_win:
libcxx = os.path.join(clang_libs, 'libc++' + so)
libcxx_1 = os.path.join(
clang_libs, versioned_so(host, 'libc++', '1'))
libllvm = os.path.join(clang_libs, 'libLLVM' + so)

# The rpath on LLVMgold.so is ../lib64, so we have to install to
# lib/lib64 to have it be in the right place :(
lib_dir = os.path.join(install_path, 'lib/lib64')
os.makedirs(lib_dir)
shutil.copy2(libcxx, lib_dir)
shutil.copy2(libcxx_1, lib_dir)
shutil.copy2(libllvm, lib_dir)
else:
libwinpthread = os.path.join(clang_bin, 'libwinpthread-1.dll')
shutil.copy2(libwinpthread, bfd_plugins)
Expand Down

0 comments on commit 824d75a

Please sign in to comment.