Linking libjpeg_static to CWM recovery issues - C++ or Other Android Development Languages

I am trying to add jpeg support to CWM recovery
I modified needed files:
c files header:
Code:
#include "jpeglib.h"
Android.mk
Code:
LOCAL_C_INCLUDES +=\
external/jpeg
LOCAL_STATIC_LIBRARIES += libjpeg_static
It compiles good but at linking stage I get:
Code:
undefined reference to 'jpeg_std_error'
undefined reference to 'jpeg_CreateDecompress'
...
I tried many ways, but I couldn't make it correctly link to libjpeg_static
Anyone have an idea on this?

Use nm to confirm those symbols actually exist in the static lib.

const_char said:
Use nm to confirm those symbols actually exist in the static lib.
Click to expand...
Click to collapse
Code:
nm libjpeg_static.a | grep jpeg_std_error
nm libjpeg_static.a | grep jpeg_CreateDecompress
#output:
#00000000 T jpeg_CreateDecompress
#00000000 T jpeg_std_error
T: text zone. So, they are not included
The issue is in libjpegstatic compiling
Maybe I am missing some flags, despite I tried many

Do you also have the command line of the compiler to confirm that it is actually linking to that lib?
Also, I don't remember, maybe you could also give a try with LOCAL_STATIC_LIBRARIES += jpeg_static?

const_char said:
Do you also have the command line of the compiler to confirm that it is actually linking to that lib?
Also, I don't remember, maybe you could also give a try with LOCAL_STATIC_LIBRARIES += jpeg_static?
Click to expand...
Click to collapse
I tried it obviously
If you are interested in trying to compile cwm with it, let me know
I will then commit changes to git
But you can try this:
lunch for your device
mmm external/jpeg
It will compile the ststic lib. Do not care about the dynamic error
You can see that compiled static lib with mmm is missing the links using nm

Related

Compile binary for testing linux kernel exploit for arm architecture

Hi,
i'm an android app developer. I have an HTC Desire and I would test kernel issue for root my device.
For check kernel or software issue, I compile on my linuxbox (on Intel) and binary file run in the same arch that compile it.
In an arm device like my android phone, how can I compile c source file?
We will say: "With an arm croos toolchain!"...
I have read http://www.hermann-uwe.de/blog/buil...-with-binutils-gcc-newlib-and-gdb-from-source that explain how to build the toolchain, but binary compiler that this steps create not compile a simple "Hello World" program:
Code:
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
because not have stdio.h header... O_O
So I have downloaded the GNU ARM toolchain binary for linux, but the compiler don't work because I can't run it on my linuxbox...
Why?
mmm... So I have copied the "include" directory from GNU Arm ToolChain to toolchain compiled from source (how explaine the link above).
now stdio.h is present but...
Code:
/tmp/ccfmzOMU.s: Assembler messages:
/tmp/ccfmzOMU.s:11: Error: junk at end of line, first unrecognized character is `@'
/tmp/ccfmzOMU.s:12: Error: junk at end of line, first unrecognized character is `@'
/tmp/ccfmzOMU.s:13: Error: too many memory references for `mov'
/tmp/ccfmzOMU.s:14: Error: no such instruction: `stmfd sp!,{fp,ip,lr,pc}'
/tmp/ccfmzOMU.s:15: Error: too many memory references for `sub'
/tmp/ccfmzOMU.s:16: Error: no such instruction: `ldr r0,.L3'
/tmp/ccfmzOMU.s:17: Error: no such instruction: `bl printf'
/tmp/ccfmzOMU.s:18: Error: expecting operand after ','; got nothing
/tmp/ccfmzOMU.s:19: Error: too many memory references for `mov'
/tmp/ccfmzOMU.s:20: Error: no such instruction: `ldmfd sp,{fp,sp,pc}'
How can i build binary elf file for my Desire architecture?
Thanks in andvance!
I am unable to link to any resources here due to them being behind a corporate firewall, but this link I found might help:
http://www.ibm.com/developerworks/linux/library/l-arm-toolchain/index.html
Here is a link to the tools:
http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite
Let me know if this is not what you are looking for.
Yes, this is what I need.
Thanks!
Now I've tried to compile my hello world in C for ARM, but the binary not run on my desire... I think that I have compiled with a mistake mcpu parameter.
The result is that if I copy helloworld binary in /data/local path in my Desire, set execution permission and execute the program:
Code:
$ ./helloworld
./helloworld
./helloworld: not found
the output of 'ls -l' command show that helloworld file exist and have 'x' permission...
So I think that is an incompatibily issue of the binary file...
Which one "-mcpu" value is correct for the Qualcomm Snapdragon QSD8250 inside HTC Desire?
I've tried any arm7* but it's the same... "not found".
Any ideas?
@azatoth
I get the same on my hero. Tried to run it on a other arm device (Linksys NSLU2) the same "not found" appears
mopodo said:
@azatoth
I get the same on my hero. Tried to run it on a other arm device (Linksys NSLU2) the same "not found" appears
Click to expand...
Click to collapse
Do you have found a solution for that?
I have no real way to test this, but the Snapdragon is a Cortex-A8 I believe... Try the following:
Code:
-mcpu=cortex-a8 -mfpu=neon
I hope this works, let me know if the behavior changes...
Vermithrax said:
I have no real way to test this, but the Snapdragon is a Cortex-A8 I believe... Try the following:
Code:
-mcpu=cortex-a8 -mfpu=neon
I hope this works, let me know if the behavior changes...
Click to expand...
Click to collapse
don't work yet... the response is always the same: not found...
you are linking to the wrong libc, you have to link to bionic... Are you using the full android build compiler?

[Q] libpcap static linking errors

Hello,
I have downloaded the libpcap in external folder from android source code using the Git and
repo. I used the toolcains of ndk (android-ndk-r5b) to compile the library following these
steps:
./configure --prefix=path-to-android-src/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
make clean
make
make install
and then a file libpcap.a is produced.
I have make a simple sniffer using libpcap (sniffer.c). When I try to compile it, these errors occur:
agcc sniffer.c libpcap.a
sniffer.c:9:18: error: pcap.h: No such file or directory
sniffer.c:19: warning: 'struct pcap_pkthdr' declared inside parameter list
sniffer.c:19: warning: its scope is only this definition or declaration, which is probably not what you want
sniffer.c: In function 'processPacket':
sniffer.c:23: warning: incompatible implicit declaration of built-in function 'printf'
sniffer.c:24: error: dereferencing pointer to incomplete type
sniffer.c:26: error: dereferencing pointer to incomplete type
sniffer.c:33: error: dereferencing pointer to incomplete type
sniffer.c: In function 'main':
sniffer.c:45: error: 'pcap_t' undeclared (first use in this function)
sniffer.c:45: error: (Each undeclared identifier is reported only once
sniffer.c:45: error: for each function it appears in.)
sniffer.c:45: error: 'descr' undeclared (first use in this function)
sniffer.c:46: error: 'PCAP_ERRBUF_SIZE' undeclared (first use in this function)
sniffer.c:62: warning: incompatible implicit declaration of built-in function 'printf'
sniffer.c:66: warning: incompatible implicit declaration of built-in function 'fprintf'
sniffer.c:66: error: 'stderr' undeclared (first use in this function)
sniffer.c:72: warning: incompatible implicit declaration of built-in function 'fprintf'
when I try to produce the object code in advance:
agcc -c sniffer.o sniffer.c
the same errors occured.
Can someone explain me how to solve this problem?
here is the alias of agcc I use in bashrc file:
./configure --prefix=/home/petsas/projects/mobile-attacks/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
Also, I have attached a file with the outputs of the commands above: configure, make and make install.
Thank you in advance!
I used the options -I and -L to specify the include and library files, and these errors are gone now..
Here is my new error log:
agcc --static -I /home/petsas/projects/mobile-attacks/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/include -L /home/petsas/projects/mobile-attacks/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/lib -o sniffer sniffer.c libpcap.a
/home/petsas/projects/mobile-attacks/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 3)
/home/petsas/projects/mobile-attacks/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 3)
/home/petsas/projects/mobile-attacks/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 3)
libpcap.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
any ideas?
I'm not 100% sure, but if you want to build native library for android you shouldn't use ./configure script. You should create Android.mk file and build library using it. Android.mk file is a native build environment for Android.
Refer to android-ndk\docs\ANDROID-MK.html for more information.
Yeah!
Thank you Zuljin!!!
I put the libpcap direcotry into the android-ndk-r5b/samples, I modified a bit the Android.mdk
and the structure of the direcotry, so as to look like the other ones inside the samples dir and
I used the ndk-build command inside the android-ndk-r5b direcory:
ndk-build -C samples/android-ndk-r5b
All worked fine! I was able to produce a libpicap.so file, and put it in the phone using the
commands:
in android:
# su
# mount -o,rw remount /dev/block/mtdblock4 /system/lib
in my Desktop:
$ adb push libpcap.so /system/lib/
I made a simple sniffer, I compiled and linked with the libpcap.so and works perfectly in
my HTC Hero!
Hi,
I have also trying to build this libpcap on Android.
I have downloaded the source from platform_external_libpcap and put all these files under jni directory for a android-ndk project (default) and tried building using ndk-build script.
But nothing happens but the control returns plainly without compiling the .so or .a file.
Can you tell me how you organized the folders in ndk project.?
regards,
Vijayan
Hello Vijayan,
You have to make a directory i.e. libpcap and then inside this directory,
you've got to create another one named as jni and put there all the source
files, as you have done. Then, inside this directory (jni) create a file named as
Android.mk so that it contains the follow lines:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:=\
/bpf_dump.c\
/bpf/net/bpf_filter.c\
/bpf_image.c\
/etherent.c\
/fad-gifc.c\
/gencode.c\
/grammar.c\
/inet.c\
/nametoaddr.c\
/optimize.c\
/pcap.c\
/pcap-linux.c\
/savefile.c\
/scanner.c\
/version.c
LOCAL_CFLAGS:=-O2 -g
LOCAL_CFLAGS+=-DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -Dlinux -D__GLIBC__ -D_GNU_SOURCE
LOCAL_MODULE:= pcap
LOCAL_MODULE_FILENAME:= libpcap
LOCAL_LDLIBS := \
-ldl
include $(BUILD_SHARED_LIBRARY)
Then, you only have to type this command:
ndk-build -C <path-to-jni-direcotry>
That's all! Now, inside the libpcap directory, and in the path:
libpcap/libs/armeabi/ should have been created the file you want:
libpcap.so
Let me know if you have any problems,
Thanasis
Hi,
Thanks. Now I'm able to compile the libpcap.so.
using this .so I have compiled the jpcap-0.7 (C source fiiles) to generate libjpcap.so.
Then I have created my Sniffer Application on Android. I have added the jpcap.jar, jpcap.so and libpcap.so in the lib folder of my Application.
But when I call this line
NetworkInterface[] devices = JpcapCaptor.getDeviceList();
am getting the following runtime error:
FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: getDeviceList
at jpcap.JpcapCaptor.getDeviceList(Native Method)
at com.example.snifferapp.SnifferApp.onCreate(SnifferApp.java:26)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Click to expand...
Click to collapse
Can you tellme What is going wrong here ?
Thanks.
Vijay
Yes, I had the same problem with you when I tried to make a sniffing application
using another one known java wrapper of libpcap: the jNetPcap, and particularly
I couldn't get the devices through this call: Pcap.findAllDevs(alldevs, errbuf);
That's because, even if you have root privileges on the console of the phone, as
you have a rooted phone, you cannot raun an application as root. That's not possible.
You can do that, only if your application is signed with the key of the platform, that is
of the Android OS that runs inside your phone.. So, the only way is to built by yourself
the Android OS and put it into the mobile. And then you have to sign your application
with the key that you have used to sign the OS.
For more information you can look here:
http://stackoverflow.com/questions/5966603/jnetpcap-on-android-problem-with-findalldevs-method
Hi,
Thanks for your reply.
But its very confusing.
Can you tellme, Whether Its possible to run a client application into Android which can monitor the network traffic in the device by anymeans?
If then what are all the possible ways. (like jpcap, etc....)
My idea is to develop a simple client application. I cannot think of building the whole Android OS and loading it into each device.
Hope to get a reply.
Thanks,
Vijay
I haven't done it before, because I only experience with native
programs that do network monitoring..
I think there are two simple solutions here. The first one is what exactly
Shark does: A tcpdump is running in the background that produces
traffic traces (pcap files) and you can develop an application that in periodic
time intervals reads these files and produce some outputs to the user.
The other one solution I can imagine is to develop again a native sniffer in
C with libpcap and then for each packet you receive or better for a batch of
packets you receive, you can send it through sockets to you application for
further processing..
Hope that helps..
FYI: There is a new application in Android called faceniff that does the work of
firesheep. That is you can hijack web sessions from facebook users. How is it
possible this application to monitor the web traffic of the phone? I think that
uses a native sniffer for this.. I am not sure, but it is not open source..
Hi, I did the steps as you described above:
Create a dir 'libpcap' with subdir 'jni'
Download the 'platform_external_libpcap' from 'github.com/android/platform_external_libpcap' (based on original libpcap version 0.9.8) and put the files at 'libpcap/jni'
Change the 'Android.mk' (see post number 6 of this thread)
run 'path/to/ndk-build -C path/to/libpcap/ndk' (android-ndk-r6)
When I do the last step of this list no 'libpcap/libs/armeabi/libpcap.so' will be produced but I get this output (I can reproduce this behavior on ubuntu 10.04 x86_64 and on debian i586):
> <user>@<host>:~/android/libpcap$ path/to/android-ndk-r6/ndk-build -C /home/<user>/android/libpcap/jni
> make: Entering directory `/home/<user>/android/libpcap/jni'
> SharedLibrary : libpcap.so
> /home/<user>/android/libpcap/obj/local/armeabi/objs/pcap//grammar.o: In function `pcap_parse':
> /home/<user>/android/libpcap/jni/y.tab.c:1711: undefined reference to `pcap_lex'
> collect2: ld returned 1 exit status
> make: *** [/home/<user>/android/libpcap/obj/local/armeabi/libpcap.so] Error 1
> make: Leaving directory `/home/<user>/android/libpcap/jni'
Does someone know what this error means and how to solve this problem?
daim0nas said:
Yeah!
Thank you Zuljin!!!
I put the libpcap direcotry into the android-ndk-r5b/samples, I modified a bit the Android.mdk
and the structure of the direcotry, so as to look like the other ones inside the samples dir and
I used the ndk-build command inside the android-ndk-r5b direcory:
ndk-build -C samples/android-ndk-r5b
All worked fine! I was able to produce a libpicap.so file, and put it in the phone using the
commands:
in android:
# su
# mount -o,rw remount /dev/block/mtdblock4 /system/lib
in my Desktop:
$ adb push libpcap.so /system/lib/
I made a simple sniffer, I compiled and linked with the libpcapp.so and works perfectly in
my HTC Hero!
Click to expand...
Click to collapse
Can you post your libpcap for us please.

[DEV][INFO] Android x86-atom Gtab3 Development

In here you will find all info about development for the x86 architecture on the Galaxy Tab3
In the OP I will try to gather all info I can find, and what others post here.
Post below I will post my own personal dev stuff
THIS IS ONLY FOR DEVELOPMENT
IF YOUR NOT DEVELOPING PLEASE DON'T POST
If you want to say Thanks... use the button​
Links
ANDROID ON INTEL ARCHITECTURE
Google group Android x86​
Recovery
My current recovery is build on Android 4.2.1
This made me compile it, and usable.
But we want more and better features, and so we need it on Android 4.2.2
But this doesn't compile
My Setup:
Ubuntu 13.04
Java 6.0
make 3.82
ADT bundle x86_64 (latest)
My current BoardConfig.mk
Code:
USE_CAMERA_STUB := true
# inherit from the proprietary version
-include vendor/samsung/santos10wifi/BoardConfigVendor.mk
TARGET_ARCH := x86
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := clovertrail
TARGET_CPU_ABI := x86
TARGET_CPU_ABI2 := x86
TARGET_ARCH_VARIANT := x86-atom
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_BOOTLOADER_BOARD_NAME := santos10wifi
#TARGET_KERNEL_SOURCE := kernel/samsung/santos10wifi
#TARGET_KERNEL_CONFIG := android_santos10_open_r00_user_defconfig
BOARD_KERNEL_CMDLINE := init=/init pci=noearly console=ttyS0 console=logk0 earlyprintk=nologger loglevel=4 hsu_dma=7 kmemleak=off androidboot.bootmedia=sdcard androidboot.hardware=santos10wifi androidboot.spid=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx androidboot.serialno=01234567890123456789012345678901 ip=50.0.0.2:50.0.0.1::255.255.255.0::usb0:on vmalloc=172M
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048
# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072
TARGET_PREBUILT_KERNEL := device/samsung/santos10wifi/kernel
BOARD_HAS_NO_SELECT_BUTTON := true
DEVICE_RESOLUTION := 2560x1600
#graphics modes
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
#TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
#TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565"
My current recovery.fstab:
Code:
/efs ext4 /dev/block/mmcblk0p2
/config ext4 /dev/block/mmcblk0p3
/cache ext4 /dev/block/mmcblk0p6
/system ext4 /dev/block/mmcblk0p8
/data ext4 /dev/block/mmcblk0p9 length=-16384
/recovery emmc /dev/block/mmcblk0p11
/modem emmc /dev/block/mmcblk0p12
/preload ext4 /dev/block/mmcblk0p13
/boot emmc /dev/block/mmcblk0p10
/sdcard datamedia /dev/null
/external_sd vfat /dev/block/mmcblk1p1
More info
Just now i got all 3 open source pakages from samsung, and see how different they are, and see if I can find a solution.
While compiling a recovery, I use this:
make -j3 otatools or make ARCH=x86 CROSS_COMPILE=$CCOMPILER otatools
build/tools/device/mkvendor.sh samsung santos10wifi prebuilt/kernel/samsung/santos10wifi/boot.img
. build/envsetup.sh
lunch cm_santos10wifi-eng
. build/tools/device/makerecoveries.sh cm_santos10wifi-eng or make -j3 recoveryimage or make ARCH=x86 CROSS_COMPILE=$CCOMPILER recoveryimage
And get these errors:
Code:
target SharedLib: libc (/home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so)
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/pthread.o: in function pthread_create:bionic/libc/bionic/pthread.c:374: error: undefined reference to '_thread_created_hook'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/dlmalloc.o: in function sys_alloc.constprop.11:bionic/libc/bionic/../upstream-dlmalloc/malloc.c:3198: error: undefined reference to 'pthread_atfork'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/dlmalloc.o: in function sys_trim.constprop.13:bionic/libc/bionic/../upstream-dlmalloc/malloc.c:3198: error: undefined reference to 'pthread_atfork'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/dlmalloc.o: in function dlmalloc:bionic/libc/bionic/../upstream-dlmalloc/malloc.c:3198: error: undefined reference to 'pthread_atfork'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/dlmalloc.o: in function dlvalloc:bionic/libc/bionic/../upstream-dlmalloc/malloc.c:3198: error: undefined reference to 'pthread_atfork'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(regcomp.o): in function p_b_cclass:bionic/libc/upstream-netbsd/libc/regex/regcomp.c:1434: error: undefined reference to 'strcpy'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fgetln.o): in function fgetln:bionic/libc/stdio/fgetln.c:85: error: undefined reference to 'memchr'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fgetln.o): in function fgetln:bionic/libc/stdio/fgetln.c:126: error: undefined reference to 'memchr'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fgets.o): in function fgets:bionic/libc/stdio/fgets.c:83: error: undefined reference to 'memchr'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fvwrite.o): in function __sfvwrite:bionic/libc/stdio/fvwrite.c:171: error: undefined reference to 'memchr'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(strtod.o): in function __dtoa:bionic/libc/stdlib/strtod.c:2158: error: undefined reference to 'strcpy'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(__strcpy_chk.o): in function __strcpy_chk:bionic/libc/string/__strcpy_chk.c:55: error: undefined reference to 'strcpy'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(asctime.o): in function asctime_r:bionic/libc/tzcode/asctime.c:117: error: undefined reference to 'strcpy'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fork.o): in function fork:bionic/libc/bionic/fork.c:44: error: undefined reference to '__timer_table_start_stop'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fork.o): in function fork:bionic/libc/bionic/fork.c:45: error: undefined reference to '__bionic_atfork_run_prepare'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fork.o): in function fork:bionic/libc/bionic/fork.c:62: error: undefined reference to '__bionic_atfork_run_child'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fork.o): in function fork:bionic/libc/bionic/fork.c:49: error: undefined reference to '__timer_table_start_stop'
/home/dutchdanny/android/source/cm/10.1/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: /home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(fork.o): in function fork:bionic/libc/bionic/fork.c:50: error: undefined reference to '__bionic_atfork_run_parent'
collect2: ld returned 1 exit status
make: *** [/home/dutchdanny/android/source/cm/10.1/out/target/product/santos10wifi/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so] Error 1
Something with libc
and/or
error: undefined reference to 'memchr'
Ok. Good thread! Some questions:
In your BoardConfig.mk -
1. ARCH_ARM_HAVE_TLS_REGISTER := true - what is it for? It is for ARM architecture and don't used for us, as i know.
2. DEVICE_RESOLUTION := 2560x1600 - this row is only used for TWRP and don't needed for CWM and system (ignored). If we build TWRP it's must be DEVICE_RESOLUTION := "1280x800". (with quotes)
As for you error - i think that problem in GCC compiler.
I will try to use your recovery.fstab last 2 rows for building TWRP (building OK, but do not mount internal storage automaticaly).
P.S. If anyone have problems with last NFS MostWanted game, try to add this lines in powervr.ini file in etc folder:
Code:
[com.ea.games.nfs13_row]
DefaultVertexBufferSize=3584000
MaxVertexBufferSize=4096000
DefaultPDSVertBufferSize=768000
DefaultVDMBufferSize=102400
DefaultIndexBufferSize=1024000
DefaultPregenMTECopyBufferSize=256000
PDSFragBufferSize=768000
ParamBufferSize=104857600
MaxParamBufferSize=125829120
Wit this, i can play well.
DutchDanny said:
Just now i got all 3 open source pakages from samsung, and see how different they are, and see if I can find a solution.
Click to expand...
Click to collapse
What do you mean by 3 open source packages? Where did you get them? The ones that are available here http://o7.no/19M7ZUX on samsung's opensource website?
Yes, original and update1 & update2
Send via my BinDroided HTC ONE
DutchDanny said:
Yes, original and update1 & update2
Send via my BinDroided HTC ONE
Click to expand...
Click to collapse
Thanks. So basically you overlaid all 3 files on the the original CyanogenMod 10.1 sources?
I already downloaded these 3 packages but (original, update1 and update2) but they don't really differ. Did you manually create a santos10 product target?
xmaczi123 said:
Thanks. So basically you overlaid all 3 files on the the original CyanogenMod 10.1 sources?
I already downloaded these 3 packages but (original, update1 and update2) but they don't really differ. Did you manually create a santos10 product target?
Click to expand...
Click to collapse
I did not overlay it to CM, but to aosp, but only with update2... just downloaded all to look inside, but as you saw.. they don't differ much.
The base of the target is created when you:
build/tools/device/mkvendor.sh samsung santos10wifi prebuilt/kernel/samsung/santos10wifi/boot.img
then edit the boardconfig.mk to fit it...
Will try to setup a full device tree by hand later on, so we can build a real cm.
But a good functional recovery is needed first
DutchDanny said:
I did not overlay it to CM, but to aosp, but only with update2... just downloaded all to look inside, but as you saw.. they don't differ much.
The base of the target is created when you:
build/tools/device/mkvendor.sh samsung santos10wifi prebuilt/kernel/samsung/santos10wifi/boot.img
then edit the boardconfig.mk to fit it...
Will try to setup a full device tree by hand later on, so we can build a real cm.
But a good functional recovery is needed first
Click to expand...
Click to collapse
Unfortunately I can't find mkvendor.sh in the whole working directory. How did you get hold of it? I'm also guessing that you copied the boot.img from the existing stock ROM. Am I right?
Thanks.
xmaczi123 said:
Unfortunately I can't find mkvendor.sh in the whole working directory. How did you get hold of it? I'm also guessing that you copied the boot.img from the existing stock ROM. Am I right?
Thanks.
Click to expand...
Click to collapse
Yes I'm using the stock boot.img
All others are made by info I found
Send via my BinDroided HTC ONE
DutchDanny said:
Yes I'm using the stock boot.img
All others are made by info I found
Send via my BinDroided HTC ONE
Click to expand...
Click to collapse
Why do we actually need a working stock recovery in order to compile and use ASOP? Can't we just create a tar.md5 archive and flash it with Odin?
xmaczi123 said:
Why do we actually need a working stock recovery in order to compile and use ASOP? Can't we just create a tar.md5 archive and flash it with Odin?
Click to expand...
Click to collapse
We need stock recovery to build initial device config and tree in source. If i understood your question...
Now then folks,
I'm seriously contemplating getting one of these for my next distraction, although with it being an x86 device, there's still some fun for all the family with or without the hardware,
@DutchDanny You seem to be leading a bit of a charge with this one, you done much raw porting in the past?
I've got the kernel and a 4.2.2 Rom that I've been poking around in, It shouldn't be too difficult to get something going, these some patches requiring in CM build system to add bz kernel image support but If there been following the AOSP bionic etc it should be okay.
trevd said:
Now then folks,
I'm seriously contemplating getting one of these for my next distraction, although with it being an x86 device, there's still some fun for all the family with or without the hardware,
@DutchDanny You seem to be leading a bit of a charge with this one, you done much raw porting in the past?
I've got the kernel and a 4.2.2 Rom that I've been poking around in, It shouldn't be too difficult to get something going, these some patches requiring in CM build system to add bz kernel image support but If there been following the AOSP bionic etc it should be okay.
Click to expand...
Click to collapse
I'm more an HTC guy, and not often work from source beside kernels.
I do know some about aosp, cm etc.
But when on HTC, I modify what they make.
For now the updater-binary is killing custom roms.
When I have a bit more time I will return....
3 other devices need support.
Send via my BinDroided HTC ONE
DutchDanny said:
I'm more an HTC guy, and not often work from source beside kernels.
I do know some about aosp, cm etc.
But when on HTC, I modify what they make.
For now the updater-binary is killing custom roms.
When I have a bit more time I will return....
3 other devices need support.
Send via my BinDroided HTC ONE
Click to expand...
Click to collapse
Yeah no worries, I need to build a cm-10.2 for x86 anyway, updater-binary. There might be a working one in this post http://forum.xda-developers.com/showpost.php?p=35887703&postcount=152 . Basically I built C x86 last year because I want to run it on my desktop but It's not really practical and I got stuck trying to make OpenGLes work with my radeon HD card. That is the CWM that resulted from the build. I just stashed it in a random edify related thread for future reference

Pixel 4: Build Vendor Image with a New HAL Service (Android 11)

Is there a way to compile the vendor image for the pixel 4 (Flame)? My goal is to add some new hardware on the phone. The kernel is already compiled with the new hardware driver and works perfectly. However, I seem I cannot resolve all the dependencies for the vendor image.
There is the output error:
device/google/coral/device.mk was modified, regenerating...
device/google/coral/aosp_flame.mk was modified, regenerating...
[ 99% 219/220] finishing build rules ...
FAILED:
system/chre/Android.mk: error: "chre (EXECUTABLES android-arm64) missing libsdsprpc (SHARED_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:946: error: exiting from previous errors.
17:07:33 ckati failed with: exit status 1
Click to expand...
Click to collapse
libsdsprpc is missing. I fear I need more than one library to complete the build.
I added this lines the BoardConfig-common.mk file in device/google/coral
# Build a separate vendor.img partition
BOARD_USES_VENDORIMAGE := true
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
#ALLOW_MISSING_DEPENDENCIES=true
BOARD_VNDK_VERSION := current
Click to expand...
Click to collapse
and commented this line in the vendor/google_devices/flame/BoardConfigPartial.mk. (from binaries driver folder downloaded from google)
#BOARD_PREBUILT_VENDORIMAGE := vendor/google_devices/flame/proprietary/vendor.img
Click to expand...
Click to collapse

How to include a native android library on a vendor NDK app

Hi,
It's my first question here, so thank you for this forum!
I want to use Android Native Window functionality on my cpp NDK application.
So, I've added the include to the top of my cpp file:
#include <android/native_window.h>
And added the android library to my Android.mk file:
LOCAL_LDLIBS += -landroid
But get a linker error:
Android.mk: error: "my_app (native:vendor) can not link against libandroid (native::latform)"
Click to expand...
Click to collapse
Is someone known how can I use the NativeWindow API on my vendor application?
Thanks a lot!
Netanel

Categories

Resources