Opened 5 years ago

Closed 4 years ago

#1743 closed defect (worksforme)

Is it possible to compile libadblockplus on/for Raspberry pi?

Reported by: hemant Assignee:
Priority: Unknown Milestone:
Module: Libadblockplus Keywords:
Cc: sergz Blocked By:
Blocking: Platform: Unknown
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Is it possible to compile libadblockplus on Raspberry pi?

I tried compiling on rpi and cross compile from ubuntu but both didnt worked.

Change History (11)

comment:1 Changed 5 years ago by hemant

I have got following error while building on ubuntu

disassembler.cc:(.text._ZN2v88internalL8DecodeItEPNS0_7IsolateEP8_IO_FILERKNS0_15V8NameConverterEPhS8_+0x109): undefined reference to `disasm::Disassembler::Disassembler(disasm::NameConverter const&)'
disassembler.cc:(.text._ZN2v88internalL8DecodeItEPNS0_7IsolateEP8_IO_FILERKNS0_15V8NameConverterEPhS8_+0x1ff): undefined reference to `disasm::Disassembler::ConstantPoolSizeAt(unsigned char*)'
disassembler.cc:(.text._ZN2v88internalL8DecodeItEPNS0_7IsolateEP8_IO_FILERKNS0_15V8NameConverterEPhS8_+0x3a7): undefined reference to `disasm::Disassembler::InstructionDecode(v8::internal::Vector<char>, unsigned char*)'
disassembler.cc:(.text._ZN2v88internalL8DecodeItEPNS0_7IsolateEP8_IO_FILERKNS0_15V8NameConverterEPhS8_+0xff7): undefined reference to `disasm::Disassembler::~Disassembler()'
disassembler.cc:(.text._ZN2v88internalL8DecodeItEPNS0_7IsolateEP8_IO_FILERKNS0_15V8NameConverterEPhS8_+0x10fe): undefined reference to `disasm::Disassembler::~Disassembler()'
out/Debug/obj.target/third_party/v8/tools/gyp/../../../../v8_base.arm6/third_party/v8/src/disassembler.o:(.rodata._ZTVN2v88internal15V8NameConverterE[_ZTVN2v88internal15V8NameConverterE]+0x20): undefined reference to `disasm::NameConverter::NameOfCPURegister(int) const'
out/Debug/obj.target/third_party/v8/tools/gyp/../../../../v8_base.arm6/third_party/v8/src/disassembler.o:(.rodata._ZTVN2v88internal15V8NameConverterE[_ZTVN2v88internal15V8NameConverterE]+0x28): undefined reference to `disasm::NameConverter::NameOfByteCPURegister(int) const'
out/Debug/obj.target/third_party/v8/tools/gyp/../../../../v8_base.arm6/third_party/v8/src/disassembler.o:(.rodata._ZTVN2v88internal15V8NameConverterE[_ZTVN2v88internal15V8NameConverterE]+0x30): undefined reference to `disasm::NameConverter::NameOfXMMRegister(int) const'
out/Debug/obj.target/third_party/v8/tools/gyp/../../../../v8_base.arm6/third_party/v8/src/disassembler.o:(.rodata._ZTVN2v88internal15V8NameConverterE[_ZTVN2v88internal15V8NameConverterE]+0x40): undefined reference to `disasm::NameConverter::NameOfConstant(unsigned char*) const'
collect2: error: ld returned 1 exit status
third_party/v8/tools/gyp/mksnapshot.arm6.target.mk:114: recipe for target 'out/Debug/mksnapshot.arm6' failed
make[1]: * [out/Debug/mksnapshot.arm6] Error 1
make[1]: Leaving directory '/home/hemant/libadblockplus/build'

comment:2 Changed 5 years ago by mapx

  • Component changed from Unknown to Libadblockplus

comment:3 Changed 5 years ago by sergz

  • Cc sergz added

In the listing above the linker cannot find the implementation of some functions from v8. So, I would recommend to check v8, may be it needs to be updated or merely some option in gyp file needs to be set to the correct value.
@hemant, Could you please provide details how you are doing it, so we can reproduce the exact state to identify the issue?

comment:4 Changed 5 years ago by hemant

Hi,

Sorry for really late reply.
I am following checkout steps defined at
https://adblockplus.org/forum/viewtopic.php?t=17093

after checkout source I just run
"make ARCH=arm7"
in "libadblockplus" folder.

I also tried compiling libadblockplus on my rpi 2 box but got same error.

Last edited 5 years ago by hemant (previous) (diff)

comment:5 Changed 5 years ago by hemant

Above error was due to missing build for arm related files of v8.
I got it build after added arm7 in third_party/v8/tools/gyp/v8.gyp file.

"Line:550 --> ['v8_target_arch=="arm" or v8_target_arch=="arm7"', {"

also I have to disable snapshot in third_party/v8/build/features.gypi file.

Line:44 'v8_use_snapshot%': 'false',

comment:6 follow-up: Changed 5 years ago by hemant

getting following error while running abpshell.

~ $ ./abpshell

Error: Adblock Plus: Downloading URL https://easylist-downloads.adblockplus.org/easylist.txt failed (synchronize_connection_error)

Download address: https://easylist-downloads.adblockplus.org/easylist.txt?addonName=abpshell&addonVersion=1.0&application=standalone&applicationVersion=1.0&platform=libadblockplus&platformVersion=1.0&lastVersion=0
Channel status: 2147500037
Server response: 0 at compat.js:79
Traceback:
1: Components.utils.reportError() at compat.js:80
2: errorCallback() at downloader.js:140
3: /* anonymous */() at downloader.js:186
4: /* anonymous */() at compat.js:370

can you please advise to debug it?

comment:7 in reply to: ↑ 6 ; follow-up: Changed 5 years ago by sergz

Replying to hemant:

getting following error while running abpshell.
...
Server response: 0 at compat.js:79
...
can you please advise to debug it?

Congratulations with the compiling it!

Sounds like there is a trouble with the implementation of AdblockPlus::WebRequest. Could you check what implementation is used, may be you need to provide your component which is able to download data.
Check which GET is called in WebRequestThread::Run at WebRequestJsObject.cpp:61 (https://hg.adblockplus.org/libadblockplus/file/283cfc113717/src/WebRequestJsObject.cpp#l61)

Last edited 5 years ago by sergz (previous) (diff)

comment:8 in reply to: ↑ 7 ; follow-up: Changed 5 years ago by hemant

Replying to sergz:

Replying to hemant:

getting following error while running abpshell.
...
Server response: 0 at compat.js:79
...
can you please advise to debug it?

Congratulations with the compiling it!

Sounds like there is a trouble with the implementation of AdblockPlus::WebRequest. Could you check what implementation is used, may be you need to provide your component which is able to download data.
Check which GET is called in WebRequestThread::Run at WebRequestJsObject.cpp:61 (https://hg.adblockplus.org/libadblockplus/file/283cfc113717/src/WebRequestJsObject.cpp#l61)

Thanks for pointers.

Following is the call stack for GET its calling dummy function which is by default setting error code.

AdblockPlus::DefaultWebRequest::GET (this=0xb6501cf8, url=..., requestHeaders=...) at ../src/DefaultWebRequestDummy.cpp:23
(gdb) where
#0  AdblockPlus::DefaultWebRequest::GET (this=0xb6501cf8, url=..., requestHeaders=...) at ../src/DefaultWebRequestDummy.cpp:23
#1  0x0806ada9 in (anonymous namespace)::WebRequestThread::Run (this=0xb2b01610) at ../src/WebRequestJsObject.cpp:61
#2  0x080671c6 in (anonymous namespace)::CallRun (thread=0xb2b01610) at ../src/Thread.cpp:30
#3  0xb7e6cd78 in start_thread (arg=0xb2affb40) at pthread_create.c:311
#4  0xb7da401e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131
(gdb)

From DefaultWebRequestDummy.cpp

 20 AdblockPlus::ServerResponse AdblockPlus::DefaultWebRequest::GET(
 21     const std::string& url, const HeaderList& requestHeaders) const
 22 {
 23   AdblockPlus::ServerResponse result;
 24   result.status = NS_ERROR_FAILURE;
 25   result.responseStatus = 0;
 26   return result;
 27 }

Is there any sample code for WebRequest which I can use to write GET function for linux?

comment:9 in reply to: ↑ 8 ; follow-up: Changed 5 years ago by sergz

Replying to hemant:

...
Is there any sample code for WebRequest which I can use to write GET function for linux?

Yes, even more, if you can use libcurl you can try to use libadblockplus\src\DefaultWebRequestCurl.cpp instead of dummy.

comment:10 in reply to: ↑ 9 Changed 5 years ago by hemant

Replying to sergz:

Replying to hemant:

...
Is there any sample code for WebRequest which I can use to write GET function for linux?

Yes, even more, if you can use libcurl you can try to use libadblockplus\src\DefaultWebRequestCurl.cpp instead of dummy.

Thanks alot its not showing any error now and patterns.ini is having patterns :).

Thanks again for your help :).

comment:11 Changed 4 years ago by sergz

  • Resolution set to worksforme
  • Status changed from new to closed
  • Tester set to Unknown
  • Verified working unset
Note: See TracTickets for help on using tickets.