吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2631|回复: 4
收起左侧

[Android 求助] FART移植到android8.0源代码编译报错问题

[复制链接]
anywhereyang 发表于 2021-2-1 17:09
本帖最后由 anywhereyang 于 2021-2-1 17:41 编辑

报错如下:

art/runtime/native/dalvik_system_DexFile.cc:492: error: undefined reference to 'art::ScopedFastNativeObjectAccess::ScopedFastNativeObjectAccess(_JNIEnv*)'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)
[  0% 26/23412] //art/runtime:libart c...ounting/mod_union_table.cc [linux x86]
ninja: build stopped: subcommand failed.
16:23:09 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1



代码位置dalvik_system_DexFile.cc:
[C] 纯文本查看 复制代码
static void DexFile_dumpMethodCode(JNIEnv* env, jclass,jobject method) {
  if(method!=nullptr && env != nullptr)
  {
     ScopedFastNativeObjectAccess soa(env);                ////////////////这里是报错位置
                 ArtMethod* artmethod = ArtMethod::FromReflectedMethod(soa, method);
    //  ArtMethod *artmethod = jobject2ArtMethod( env,method);
                  myfartInvoke(artmethod);
          }          
  return;
}


已经在文件的开始位置包含了头文件
#include "scoped_fast_native_object_access.h"

有编译过的朋友有遇到这个问题吗

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

fengyr 发表于 2021-2-1 17:27
extern “C”{
#include "scoped_fast_native_object_access.h"
}
这样试试
 楼主| anywhereyang 发表于 2021-2-1 17:40
fengyr 发表于 2021-2-1 17:27
extern “C”{
#include "scoped_fast_native_object_access.h"
}

试了一下,还是报一样的错误,以下是头文件定义


[C] 纯文本查看 复制代码
#ifndef ART_RUNTIME_NATIVE_SCOPED_FAST_NATIVE_OBJECT_ACCESS_H_
#define ART_RUNTIME_NATIVE_SCOPED_FAST_NATIVE_OBJECT_ACCESS_H_

#include <jni.h>

#include "scoped_thread_state_change.h"

namespace art {

// Variant of ScopedObjectAccess that does no runnable transitions. Should only be used by "fast"
// JNI methods.
class ScopedFastNativeObjectAccess : public ScopedObjectAccessAlreadyRunnable {
 public:
  ALWAYS_INLINE explicit ScopedFastNativeObjectAccess(JNIEnv* env)
    REQUIRES(!Locks::thread_suspend_count_lock_)
    SHARED_LOCK_FUNCTION(Locks::mutator_lock_);

  ALWAYS_INLINE ~ScopedFastNativeObjectAccess() UNLOCK_FUNCTION(Locks::mutator_lock_) {}

 private:
  DISALLOW_COPY_AND_ASSIGN(ScopedFastNativeObjectAccess);
};

}  // namespace art

#endif  // ART_RUNTIME_NATIVE_SCOPED_FAST_NATIVE_OBJECT_ACCESS_H_

unit10000 发表于 2021-2-8 00:10
 楼主| anywhereyang 发表于 2021-3-1 13:49
unit10000 发表于 2021-2-8 00:10
楼主解决了吗 我也遇到这个问题了

还没有,气得我都把整个ubuntu虚拟机都删了,哈哈
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-23 11:49

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表