aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/buglabs-osgi
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-04-01 00:12:59 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-04-06 18:00:47 +0200
commit34f638c9280318f889475a7e71e7d5e9e78a41ac (patch)
tree568fa86dac2f46478e11fbb43e82de65a2914060 /recipes/buglabs-osgi
parent46b92da9a732f49db583c13554aeedf8f02516c0 (diff)
downloadopenembedded-34f638c9280318f889475a7e71e7d5e9e78a41ac.tar.gz
fix com.buglabs.bug.jni.* 'could not read symbols: Bad value' error
Without that fix we have : | .../sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: CharDevice.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC | CharDevice.o: could not read symbols: Bad value | collect2: ld returned 1 exit status | make: *** [libCommon.so] Error 1 For the following recipes: com.buglabs.bug.jni.common com.buglabs.bug.jni.input com.buglabs.bug.jni.lcd com.buglabs.bug.jni.accelerometer com.buglabs.bug.jni.libmatthew com.buglabs.bug.jni.vonhippel com.buglabs.bug.jni.camera com.buglabs.bug.jni.rxtx com.buglabs.bug.jni.gps The solution was to pass -fPIC to the Makefile: For instance in com.buglabs.bug.jni.common/src/c the Makefile contained: ALL_CXXFLAGS += $(INCLUDE) $(CXXFLAGS) [...] %.o: %.cpp $(CXX) $(ALL_CXXFLAGS) -c -v $^ -o $@ So passing -fPIC to CXXFLAGS solved all of the compilation failures but com.buglabs.bug.jni.camera com.buglabs.bug.jni.camera which failed that way: | .../sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: Camera.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC | Camera.o: could not read symbols: Bad value | collect2: ld returned 1 exit status | make: *** [libCamera.so] Error 1 Had that in its Makefile: ALL_CCFLAGS += $(INCLUDE) $(CCFLAGS) [...] %.o: %.c $(CC) $(ALL_CCFLAGS) -c $^ -o $@ which corresponded to the compilation of bug_v4l.c Altough just setting CCFLAGS += "-fPIC" wasn't sufficent since CFLAGS was not exported (see run.do_jni_install script) So I had to export it. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Acked-by: Stefan Schmidt <stefan@buglabs.net>
Diffstat (limited to 'recipes/buglabs-osgi')
-rw-r--r--recipes/buglabs-osgi/bug-osgi.inc4
-rw-r--r--recipes/buglabs-osgi/com.buglabs.bug.jni.camera.bb3
2 files changed, 6 insertions, 1 deletions
diff --git a/recipes/buglabs-osgi/bug-osgi.inc b/recipes/buglabs-osgi/bug-osgi.inc
index b5b6e9fcdf..75908bb69b 100644
--- a/recipes/buglabs-osgi/bug-osgi.inc
+++ b/recipes/buglabs-osgi/bug-osgi.inc
@@ -8,7 +8,7 @@ inherit bug-java-library
JARFILENAME = "${BPN}.jar"
ALTJARFILENAMES = ""
-INC_PR = "r0"
+INC_PR = "r1"
SRCREV = "12839"
@@ -28,6 +28,8 @@ EXTRA_OEMAKE+="CLASSPATH_INCDIR=${STAGING_INCDIR}/classpath"
JAVAC_OPTIONS="-source 1.6"
+CXXFLAGS += "-fPIC"
+
do_compile() {
mkdir -p build
oe_makeclasspath cp -s ${DEPENDS} ${EXTRA_CP}
diff --git a/recipes/buglabs-osgi/com.buglabs.bug.jni.camera.bb b/recipes/buglabs-osgi/com.buglabs.bug.jni.camera.bb
index dced292758..28a22e19ae 100644
--- a/recipes/buglabs-osgi/com.buglabs.bug.jni.camera.bb
+++ b/recipes/buglabs-osgi/com.buglabs.bug.jni.camera.bb
@@ -2,6 +2,9 @@ require bug-osgi.inc
inherit jni-library
PR = "${INC_PR}.7+svnr${SRCREV}"
+
+export CCFLAGS += "-fPIC"
+
FILES_${PN} += "${JNI_LIB_DIR}/libCamera.so"
DEPENDS += "com.buglabs.common com.buglabs.bug.jni.common classpath jpeg virtual/kernel jpeg"