Cross-Compilation For MIPS Platform in Linux

39 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

hardik gohil

lukematon,
4.3.2015 klo 3.55.344.3.2015
vastaanottaja cryptop...@googlegroups.com
Hello,


I want to Cross-Compile this Library for MIPS Architecture Embedded Linux Board.

Has Anyone compiled this before.


I have compiled using the above procedure.

But the size of libcryptopp.so is 7Mb which is to high for Embedded Environment.

I would like to know i am adding unnecessary flags for compilation or this the  standard size ?

How can i reduce size ? 

Jeffrey Walton

lukematon,
4.3.2015 klo 13.19.044.3.2015
vastaanottaja cryptop...@googlegroups.com


On Wednesday, March 4, 2015 at 3:55:34 AM UTC-5, hardik gohil wrote:
Hello,


I want to Cross-Compile this Library for MIPS Architecture Embedded Linux Board.

Has Anyone compiled this before.

I have not (personally). Others on the list may have, though.

What package did you install to get the MIPS cross tools? I can test it later tonight.


I have compiled using the above procedure.

But the size of libcryptopp.so is 7Mb which is to high for Embedded Environment.

I would like to know i am adding unnecessary flags for compilation or this the  standard size ?

How can i reduce size ? 

The best I've been able to do with the shared object is about 2.8 MB on x86_64. That includes visibility and stripping tricks. See http://www.cryptopp.com/wiki/Debug_Symbols.

If you are willing to link to the static archive, then you should be able to prune the size further with http://www.cryptopp.com/wiki/Linux#Reducing_Application_Size.

Jeff 

hardik gohil

lukematon,
4.3.2015 klo 20.11.584.3.2015
vastaanottaja cryptop...@googlegroups.com
I am using Buildroot-2013 for MIPS Cross-Tools

hardik gohil

lukematon,
6.3.2015 klo 1.58.546.3.2015
vastaanottaja cryptop...@googlegroups.com
Hello,


Thank you I have used this link  http://www.cryptopp.com/wiki/Linux#Reducing_Application_Size. to reduce size.

Now my Library size is 3.1 MB..

Jeffrey Walton

lukematon,
6.3.2015 klo 19.46.266.3.2015
vastaanottaja cryptop...@googlegroups.com
Here's one I forgot to add that may prune anoth 100K or so:

GNU_LD216_OR_LATER = $(shell $(LD) -v 2>&1 | $(EGREP) -i -c '^gnu ld .* (2\.1[6-9]|2\.[2-9])')
ifeq ($(GNU_LD216_OR_LATER),1)
  CXXFLAGS += -Wl,exclude-libs,all
endif

Its a linker flag, but LDFLAGS is not used consistently. So its passed through the CXXFLAGS compiler flags. 

hardik gohil

lukematon,
8.3.2015 klo 22.24.178.3.2015
vastaanottaja cryptop...@googlegroups.com
My compiled program fail to run with this error:
can't resolve symbol '_ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE'

when I compile with disabling CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden 

check for symbol using command 
 
# $NM --dynamic libcryptopp.so | grep "_ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE"
00279c70 T _ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE





Jeffrey Walton

lukematon,
9.3.2015 klo 14.52.019.3.2015
vastaanottaja cryptop...@googlegroups.com


On Sunday, March 8, 2015 at 10:24:17 PM UTC-4, hardik gohil wrote:
My compiled program fail to run with this error:
can't resolve symbol '_ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE'

when I compile with disabling CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden 

 My gut feeling: -fvisibility-inlines-hidden is the culprit.

check for symbol using command 
 
# $NM --dynamic libcryptopp.so | grep "_ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE"
00279c70 T _ZN8CryptoPP6FilterC2EPNS_22BufferedTransformationE

What's the demangle of the symbol? Pipe it though `c++filt` (https://sourceware.org/binutils/docs/binutils/c_002b_002bfilt.html).

Jeff

Jeff 

Jeffrey Walton

lukematon,
9.3.2015 klo 17.44.559.3.2015
vastaanottaja cryptop...@googlegroups.com


On Sunday, March 8, 2015 at 10:24:17 PM UTC-4, hardik gohil wrote:
Crapp... I only gave you part of the information you needed.

Add the following to the end of config.h. A good place is after the __MWERKS__ tests to set CRYPTOPP_DLL:

#if __GNUC__ >= 4
  #undef CRYPTOPP_DLL
  #define CRYPTOPP_DLL __attribute__ ((visibility ("default")))
#endif

Here's the result on a Ubuntu test machine:

cryptopp$ nm -D libcryptopp.so | c++filt | grep Filter::Filter
00000000001b06e6 T CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*)
00000000001b06e6 T CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*)

Jeff

Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä