OpenSSL for android: linking shared libs error - Android General

I am trying to compile a simple program with ndk-build that uses functions from the OpenSSL libcrypto.so shared library, but I have some errors:
This is my Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := lib-crypto
LOCAL_SRC_FILES := libcrypto.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := tema1
LOCAL_SRC_FILES := tema1.c
LOCAL_SHARED_LIBRARIES := lib-crypto
LOCAL_C_INCLUDES := /home/aleksei/openSSL0.9.8/include
include $(BUILD_EXECUTABLE)
libcrypto.so is the library that I have built for android. I want to make a program using it. Now it gives me this error:
Install : libcrypto.so => libs/armeabi/libcrypto.so
Executable : tema1
./obj/local/armeabi/libcrypto.so: undefined reference to `dladdr'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/tema1] Error 1
What am I doing wrong?

Related

[Q] makefile

Hi
my first jni app and run into those android.mk problems:
SDL_SRCS := \
$(LOCAL_PATH)/src/*.c \
$(LOCAL_PATH)/src/*.cpp \
1: How should that look to include all .c and cpp files in src?
#LOCAL_SRC_FILES := $(foreach files $(SDL_SRCS), $(wildcard *.c)$
(files))
LOCAL_SRC_FILES := $(foreach F, $(SDL_SRCS), $(dir $(F)),$(notdir $
(wildcard $(LOCAL_PATH)/$(F))))
2: what libs to include?
LOCAL_LDLIBS := -llog -lGLESv2 -lm
the original c++ makefile has those:
LDFLAGS = -lm -lGL -lGLU -lglut
LIBOBJS =
LIBS = -L/usr/X11R6/lib -L/usr/lib -L/usr/lib -lGL -lGLU -lglut -lSDL -
lSDLmain -lSDL_mixer
Many thanks indeed
Michael

[Q] Build a native c helloworld with DynamicLinkLibrary?

Hi everyone, I want to make a native c program with a dynamic link library, so I put these files in Android/development/hello/: hello.c, myprint.h,myprint.c, the main() is in hello.c and include myprint.h, and the Android.mk is:
---------------------------------------------------------------------
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := myprint
LOCAL_SRC_FILES := myprint.c
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := helloworld
LOCAL_SRC_FILES := hello.c
LOCAL_SHARED_LIBRARIES := myprint
include $(BUILD_EXECUTABLE)
---------------------------------------------------------------------
Then I make helloworld, and the output info is that:
---------------------------------------------------------------------
target thumb C: helloworld <= development/hello/hello.c
target thumb C: myprint <= development/hello/myprint.c
target SharedLib: myprint (out/target/product/generic/obj/SHARED_LIBRARIES/myprint_intermediates/LINKED/myprint.so)
target Symbolic: myprint (out/target/product/generic/symbols/system/lib/myprint.so)
target Strip: myprint (out/target/product/generic/obj/lib/myprint.so)
target Executable: helloworld (out/target/product/generic/obj/EXECUTABLES/helloworld_intermediates/LINKED/helloworld)
/home/neil/dev/google_422/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lmyprint.so
development/hello/hello.c:5: error: undefined reference to 'myprint'
collect2: error: ld returned 1 exit status
---------------------------------------------------------------------
Please help me...

[Q] Error while compiling AOKP (Help needed)

Code:
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
TARGET_PRODUCT=aokp_p3110
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.5.0-17-generic-x86_64-with-LinuxMint-14-nadia
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39
OUT_DIR=/home/arun/aokp/out
============================================
Checking build tools versions...
grep: /bltsville/gcbv/version.h: No such file or directory
ls: cannot access /bltsville/ticpu/lib/android/libbltsville_*.*.so: No such file or directory
build/core/base_rules.mk:130: *** device/samsung/p3100/power: MODULE.TARGET.SHARED_LIBRARIES.power.piranha already defined by device/samsung/omap4-common/libpower. Stop.
Contents of both files...
OMAP4-Common/libpower
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := power.$(TARGET_BOOTLOADER_BOARD_NAME)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SRC_FILES := power.c
#LOCAL_SHARED_LIBRARIES := liblog
#LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
P3100/power
Code:
LOCAL_PATH := $(call my-dir)
# HAL module implemenation stored in
# hw/<POWERS_HARDWARE_MODULE_ID>.<ro.hardware>.so
include $(CLEAR_VARS)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SHARED_LIBRARIES := liblog libcutils
LOCAL_SRC_FILES := power_piranha.c
LOCAL_MODULE := power.piranha
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
Solution needed urgently please..
Solved.
Got new error
Code:
make: *** No rule to make target `device/samsung/omap4-common/bltsville/ticpu/lib/android/libbltsville_ticpu.', needed by `/home/arun/aokp/out/target/product/p3110/obj/lib/libbltsville_ticpu.'. Stop.
What changes will be needed in make file to solve it ?
Android.mk
Code:
LOCAL_PATH := $(call my-dir)
#Copying libbltsville_ticpu.BV_CPUVERSION.so
include $(CLEAR_VARS)
BV_CPUVERSION :=$(shell ls $(COMMON_PATH)/bltsville/ticpu/lib/android/libbltsville_*.*.so|\
sed 's/device\/samsung\/omap4-common\/bltsville\/ticpu\/lib\/android\/libbltsville_ticpu.//')
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE := libbltsville_ticpu.$(BV_CPUVERSION)
LOCAL_SRC_FILES := lib/android/libbltsville_ticpu.$(BV_CPUVERSION)
LOCAL_MODULE_PATH:= $(TARGET_OUT_VENDOR)/lib
include $(BUILD_PREBUILT)
#Creating SymLinks
#libbltsville_ticpu.so -> libbltsville_ticpu.BV_CPUVERSION.so
#libbltsville_cpu.so -> libbltsville_ticpu.so
SYMLINKS := $(TARGET_OUT_VENDOR)/lib/libbltsville_ticpu.so
$(SYMLINKS): TICPU_BINARY := ./libbltsville_ticpu.$(BV_CPUVERSION)
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
[user=279333]@ECHO[/user] "Symlink: [email protected] -> $(TICPU_BINARY)"
[user=4143519]@mkdir[/user] -p $(dir [email protected])
[user=1516568]@rm -rf[/user] [email protected]
$(hide) ln -fs $(TICPU_BINARY) [email protected]
@cp -afr $(COMMON_PATH)/bltsville/ticpu/lib/android/libbltsville_ticpu_license.txt $(TARGET_OUT_VENDOR)/lib
ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
SYMLINKS1 := $(TARGET_OUT_VENDOR)/lib/libbltsville_cpu.so
$(SYMLINKS1): LINK_BINARY := ./libbltsville_ticpu.so
$(SYMLINKS1): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
[user=279333]@ECHO[/user] "Symlink: [email protected] -> $(LINK_BINARY)"
[user=4143519]@mkdir[/user] -p $(dir [email protected])
[user=1516568]@rm -rf[/user] [email protected]
$(hide) ln -fs $(LINK_BINARY) [email protected]
ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS1)
# for mm
all_modules: $(SYMLINKS) $(SYMLINKS1)
Since PAC partially based on AOKP, I am sure @Nick0703 would be willing to help if you get into trouble. Good luck :good:
bro i am glad that you are developing aokp 4.2.2 for tab 2.
thanks.
I know its an useless reply

mismatched partition error for (recovery) boot up failed..

Hello Developers,
I am creating cyanogenmod 13 build for Cherry mobile flare s play.. I did half of the process, I created recovery image then I flash it on mobile but it's showing me error "mismatched partition error for (recovery) boot up failed".. How to get partitions size of the device???
This is my Boardconfig.mk file contains following..
USE_CAMERA_STUB := true
# inherit from the proprietary version
-include vendor/Cherry/Flare_S_Play/BoardConfigVendor.mk
TARGET_ARCH := arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := unknown
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_VARIANT := cortex-a7
TARGET_CPU_SMP := true
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_BOOTLOADER_BOARD_NAME := Flare_S_Play
BOARD_KERNEL_CMDLINE :=
BOARD_KERNEL_BASE := 0x80000000
BOARD_KERNEL_PAGESIZE := 2048
# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00A00000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00A00000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x60000000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x323100000
BOARD_FLASH_BLOCK_SIZE := 131072
TARGET_PREBUILT_KERNEL := device/Cherry/Flare_S_Play/kernel
BOARD_HAS_NO_SELECT_BUTTON := true
Now from where i will get the exact partitions size of device..?

boot.img too big error while building TWRP from source

I have a big issue, I'm trying to build TWRP for a non-supported device and I get this error :
Code:
/home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img maxsize=-28630272 blocksize=18165312 total=7467008 reserve=36330624
error: /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img too large (7467008 > [7700352 - 36330624])
build/core/Makefile:570 : la recette pour la cible « /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img » a échouée
make: *** [/home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img] Erreur 1
make: *** Suppression du fichier « /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img »
make: *** Attente des tâches non terminées....
#### make failed to build some targets (31 seconds) ####
My BoardConfig.mk :
Code:
USE_CAMERA_STUB := true
# inherit from the proprietary version
-include vendor/archos/ac50dis/BoardConfigVendor.mk
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_VARIANT := generic
TARGET_CPU_ABI := arm64-v8a
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_VARIANT := cortex-a7
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := mt6753
TARGET_CPU_SMP := true
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_BOOTLOADER_BOARD_NAME := ac50dis
BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2
BOARD_KERNEL_BASE := 0x40078000
BOARD_KERNEL_PAGESIZE := 2048
# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 7467008
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 17616077
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1978662912
BOARD_USERDATAIMAGE_PARTITION_SIZE := 14066017894
BOARD_FLASH_BLOCK_SIZE := 17616077
TARGET_PREBUILT_KERNEL := device/archos/ac50dis/kernel
BOARD_HAS_NO_SELECT_BUTTON := true
TW_THEME := portrait_hdpi
The "BOARD_BOOTIMAGE_PARTITION_SIZE := 7467008" line isn't with the true value of the boot partition size which is usually 17616077 but even if I set this one, it doesn't work at all.
I really neet help so if you have just a clue, tell me .
PS : I'm a 16 years old french guy so if their are some mistakes, don't blame me
TikiMatt said:
I have a big issue, I'm trying to build TWRP for a non-supported device and I get this error:...
Click to expand...
Click to collapse
Your best bet is to post this question within the following thread.
https://forum.xda-developers.com/showthread.php?t=3404024
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT PROVIDE SUPPORT VIA PM UNLESS ASKED/REQUESTED BY MYSELF.
PLEASE KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE

Categories

Resources