Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 807d9d62 authored by Ryan Prichard's avatar Ryan Prichard
Browse files

Switch libvndksupport's linker.c to C++

Bug: none
Test: device boots
Change-Id: I64237006a7f903647c8d8f7ca681b1da23ac53a9
parent 8a779ee9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ subdirs = ["tests"]
cc_library {
    name: "libvndksupport",
    native_bridge_supported: true,
    srcs: ["linker.c"],
    srcs: ["linker.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
+6 −3
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@
#include <sys/types.h>
#include <unistd.h>

__attribute__((weak)) extern struct android_namespace_t* android_get_exported_namespace(const char*);
__attribute__((weak)) extern void* android_dlopen_ext(const char*, int, const android_dlextinfo*);
__attribute__((weak)) extern "C" struct android_namespace_t* android_get_exported_namespace(
        const char*);
__attribute__((weak)) extern "C" void* android_dlopen_ext(const char*, int,
                                                          const android_dlextinfo*);

static const char* namespace_name = NULL;

@@ -67,7 +69,8 @@ void* android_load_sphal_library(const char* name, int flag) {
    struct android_namespace_t* vendor_namespace = get_vendor_namespace();
    if (vendor_namespace != NULL) {
        const android_dlextinfo dlextinfo = {
            .flags = ANDROID_DLEXT_USE_NAMESPACE, .library_namespace = vendor_namespace,
                .flags = ANDROID_DLEXT_USE_NAMESPACE,
                .library_namespace = vendor_namespace,
        };
        void* handle = NULL;
        if (android_dlopen_ext != NULL) {