Commit 68f5b78e authored by Kunihiko Sakamoto's avatar Kunihiko Sakamoto Committed by Commit Bot

Revert "Implement __cxa_pure_virtual to avoid undefined symbol error"

This reverts commit 79fc11a5.

Reason for revert: Broke android-archive-rel build.
https://ci.chromium.org/p/chromium/builders/ci/android-archive-rel/7634

Original change's description:
> Implement __cxa_pure_virtual to avoid undefined symbol error
> 
> "undefined symbol: __cxa_pure_virtual" will happen when building
> //base/android/linker:chromium_android_linker with
> use_clang_coverage = true
> 
> It seems we can use infinite loop to avoid this error:
> https://stackoverflow.com/questions/920500/what-is-the-purpose-of-cxa-pure-virtual
> 
> 
> Bug: 1018780
> Change-Id: I97cc0a495320c4ede1ecd43cf1b7816b58646960
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1968050
> Commit-Queue: Yun Liu <yliuyliu@google.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#726178}

TBR=digit@chromium.org,rmcilroy@chromium.org,yliuyliu@google.com

Change-Id: Ia68fbab2f43bed74b8e134397973b83dcc5bf6e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1018780
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1974294Reviewed-by: default avatarKunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726183}
parent 94c302a8
...@@ -105,5 +105,3 @@ Local Modifications: ...@@ -105,5 +105,3 @@ Local Modifications:
- Add a document about testing the crazy linker in a Chromium checkout - Add a document about testing the crazy linker in a Chromium checkout
- Remove unnecessary alignment check for size of area that is about to mmap(2). - Remove unnecessary alignment check for size of area that is about to mmap(2).
- Implement __cxa_pure_virtual to avoid undefined symbol error.
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#ifdef __ANDROID__ #ifdef __ANDROID__
#include <android/log.h> #include <android/log.h>
...@@ -18,16 +17,6 @@ ...@@ -18,16 +17,6 @@
namespace crazy { namespace crazy {
// Log fatal error and exit.
void LogFatalAndExit(const char* message) {
#ifdef __ANDROID__
__android_log_write(ANDROID_LOG_FATAL, "crazy_linker", message);
#else
::write(STDERR_FILENO, message, sizeof(message) - 1);
#endif
_exit(1);
}
#if CRAZY_DEBUG #if CRAZY_DEBUG
namespace { namespace {
......
...@@ -29,9 +29,6 @@ template <bool> struct CompileAssert { }; ...@@ -29,9 +29,6 @@ template <bool> struct CompileAssert { };
namespace crazy { namespace crazy {
// Log fatal error and exit.
void LogFatalAndExit(const char* message);
#if CRAZY_DEBUG #if CRAZY_DEBUG
void Log(const char* location, const char* fmt, ...); void Log(const char* location, const char* fmt, ...);
......
...@@ -59,12 +59,6 @@ ...@@ -59,12 +59,6 @@
#define DT_PREINIT_ARRAYSZ 33 #define DT_PREINIT_ARRAYSZ 33
#endif #endif
// Avoid undefined symbol:__cxa_pure_virtual error.
extern "C" void __cxa_pure_virtual() {
static const char kFatalMessage[] = "Pure virtual function was called!";
crazy::LogFatalAndExit(kFatalMessage);
}
namespace crazy { namespace crazy {
namespace { namespace {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <android/log.h> #include <android/log.h>
#endif #endif
#include "crazy_linker_debug.h"
#include "crazy_linker_util.h" #include "crazy_linker_util.h"
// Note: unit-testing support files are in crazy_linker_files_mock.cpp // Note: unit-testing support files are in crazy_linker_files_mock.cpp
...@@ -200,7 +199,12 @@ void* operator new(size_t size) { ...@@ -200,7 +199,12 @@ void* operator new(size_t size) {
// runtime. Hence our fatal message does not contain the number of // runtime. Hence our fatal message does not contain the number of
// bytes requested by the allocation. // bytes requested by the allocation.
static const char kFatalMessage[] = "Out of memory!"; static const char kFatalMessage[] = "Out of memory!";
crazy::LogFatalAndExit(kFatalMessage); #ifdef __ANDROID__
__android_log_write(ANDROID_LOG_FATAL, "crazy_linker", kFatalMessage);
#else
::write(STDERR_FILENO, kFatalMessage, sizeof(kFatalMessage) - 1);
#endif
_exit(1);
#if defined(__GNUC__) #if defined(__GNUC__)
__builtin_unreachable(); __builtin_unreachable();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment