Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
hrbuckley
Posts: 38
Registered: ‎10-13-2010
My Device: LE Z10
My Carrier: Virgin Mobile
Accepted Solution

Cascades Zygote and Linking with Static Libraries

Using the Gold SDK version 10.0.9.2318 to build a project that uses static libraries. The libraries were created using the New BlackBerry Project wizard. The applications build and run fine in all build configurations except Device-Release. The application files build fine but when it comes time to link the build fails with:

 

libGeoLib.a(UTMUPS.o): relocation R_ARM_THM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC

I assume that the build system is trying to link all the libraries into one large shared library to but this fails because the object files used to construct the archive are not build correctly (without the -fPIC option).

 

Is there a way to exclude static libraries from the zygote shared object build? Or is there a way to get the library archives built with the required options so that they can be place in the zygote shared object?

 

Please use plain text.
Developer
hrbuckley
Posts: 38
Registered: ‎10-13-2010
My Device: LE Z10
My Carrier: Virgin Mobile

Re: Cascades Zygote and Linking with Static Libraries

I believe I have solved this.

 

In Momentics, right click on the static library project, select Properties. Goto C/C++ Build, Settings. Set configuration for Device-Release. On the Tool Settings tab select QCC Compiler, Extra Options. Add the -fPIC to QCC Options.

 

In the application project PRO file you may have to go back to the older way of setting library search path:

 

device {
	CONFIG(release, debug|release) {
		DESTDIR = o.le-v7
		LIBS +=  -L../../GeoLib/Device-Release -L../../shape/Device-Release
	}
	CONFIG(debug, debug|release) {
		DESTDIR = o.le-v7-g
		LIBS +=  -L../../GeoLib/Device-Debug -L../../shape/Device-Debug
	}
}

simulator {
	CONFIG(release, debug|release) {
		DESTDIR = o
		LIBS += -L../../GeoLib/Simulator-Debug -L../../shape/Simulator-Debug
	}
	CONFIG(debug, debug|release) {
		DESTDIR = o-g
		LIBS += -L../../GeoLib/Simulator-Debug -L../../shape/Simulator-Debug
	}
}
Please use plain text.