[Q] Compiling Screencap for Samsung galaxy tab 2 10.1 4.1.1 - General Questions and Answers

Hi, I am trying to recompile the screencap executable to tweak the code for my needs.
Unfortunetaly, I get some compilation error when i compile the code
I am compiling with ndk-build from android-ndk-r9
Here is the log:
[email protected]:~/Development/Hello_Screencap-2$ /home/lafd/Development/android-ndk-r9/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile++ thumb : Hello-Sreencap-2 <= Hello_Screencap-2.cpp
Executable : Hello-Sreencap-2
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:36: error: undefined reference to 'android::ScreenshotClient::ScreenshotClient()'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:41: error: undefined reference to 'android::SurfaceComposerClient::getBuiltInDisplay(int)'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:41: error: undefined reference to 'android::ScreenshotClient::update(android::sp<android::IBinder> const&)'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/utils/StrongPointer.h:149: error: undefined reference to 'android::RefBase::decStrong(void const*) const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:44: error: undefined reference to 'android::ScreenshotClient::getWidth() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:45: error: undefined reference to 'android::ScreenshotClient::getHeight() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:46: error: undefined reference to 'android::ScreenshotClient::getFormat() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:47: error: undefined reference to 'android::ScreenshotClient::getSize() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:54: error: undefined reference to 'android::ScreenshotClient::~ScreenshotClient()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/Hello-Sreencap-2] Error 1
Well it seems that every calls that needs the android namespace can't be referenced.
But, SurfaceComposerClient is included which defines the android namespace
Here is the c++ code snippet:
#include <utils/RefBase.h>
#include <binder/IBinder.h>
#include <binder/MemoryHeapBase.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
using namespace android;
static void do_save(const char *filename, const void *buf, size_t size)
{
int out = open(filename, O_RDWR|O_CREAT, 0666);
int len = write(out, buf, size);
printf("Wrote %d bytes to out.\n", len);
close(out);
}
int main (int ac, char **av)
{
ScreenshotClient ssc;
const void *pixels;
size_t size;
int buffer_index;
if(ssc.update( android::SurfaceComposerClient::getBuiltInDisplay( android::ISurfaceComposer::eDisplayIdMain)) != NO_ERROR )
{
//printf("Captured: w=%d, h=%d, format=%d\n");
ssc.getWidth();
ssc.getHeight();
ssc.getFormat();
size = ssc.getSize();
do_save(av[1], pixels, size);
}
else
{
printf(" screen shot client Captured Failed");
}
return 0;
}
And The Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libskia \
libui \
libgui
LOCAL_SRC_FILES:= \
Hello_Screencap-2.cpp
LOCAL_MODULE:= Hello-Sreencap-2
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES += \
external/skia/include/core \
external/skia/include/effects \
external/skia/include/images \
external/skia/src/ports \
external/skia/src/core \
external/skia/include/utils \
include $(BUILD_EXECUTABLE)
When I compile the screencap from cyanogenmod, the compilation works but when the executable runs it shows an error about CANNOT LINK EXECUTABLE cannot locate symbol Zn7androidscreenshotclient...
If you need more don't hesitate

Related

[Q] Compiling gcc and toolchain for use ON android device

Hello all. I have built the android-ndk-r9d toolchain on my Ubuntu machine, and it will compile a few things like nmap and perl just fine with some tweaking (I forgot the links but there are projects that give the options to use when compiling these). But I haven't seen any successful compilations of more recent versions of gcc with bionic.
I did some digging around in spartacus' terminal-ide project, the point of which is to have java, vim, gcc for use on the device itself, I found that gcc was version 4.4.0. I have tried to reach him via email to see what ./configure settings he used, but to no response.
Has anyone else attempted this, to build android gcc in versions more recent than 4.4.0 for compiling software on the device? What configure settings have you tried, and how much have you modified the gcc source code itself? Or is everyone content to build other projects using their regular Linux box?
My device in question is a nexus 5, which has more than enough CPU power to do this, to quell any concerns people will have to that end.
Well, I had a day free yesterday and tried everything again, and I believe I hit the same stopping point error after correcting several others. Only this time, I made an actual script and patchfiles to handle everything to make this more organized. Again has anyone attempted to do this?
First, the script.
Code:
#!/bin/bash
HOME_DIR=/home/jmanley
GCC_BUILD_DIR=$HOME_DIR/gcc-android-build
HOST=arm-linux-androideabi
CFLAGS='-Wall -O -mandroid -mbionic'
LIBCFLAGS='-O2 -mandroid -mbionic'
LIBCPPFLAGS='-O2 -mandroid -mbionic'
LIBCXXFLAGS='-O2 -mandroid -mbionic -fno-implicit-templates'
PREFIX=/data
TOOLCHAIN_DIR=$HOME_DIR/arm-linux-androideabi-4.8
SYSROOT=$TOOLCHAIN_DIR/sysroot
GCC_VERSION=4.9.0
MPFR_VERSION=3.1.2
GMP_VERSION=6.0.0a
RENAMED_GMP_VERSION=6.0.0
MPC_VERSION=1.0.2
LDFLAGS='-lc -ldl -lgcc -lm -static'
LIBS='-lc -ldl -lgcc -lm -lsupc++ -lgnustl_shared -lgmp'
CC=arm-linux-androideabi-gcc
CXX=arm-linux-androideabi-g++
LD=arm-linux-androideabi-ld
RANLIB=arm-linux-androideabi-ranlib
AR=arm-linux-androideabi-ar
STRIP=arm-linux-androideabi-strip
PATH=$TOOLCHAIN_DIR/bin:$PATH
cd $HOME_DIR
mkdir $GCC_BUILD_DIR
tar -jxf gcc-$GCC_VERSION.tar.bz2
cd $HOME_DIR/gcc-$GCC_VERSION
tar -jxf ../gmp-$GMP_VERSION.tar.bz2
mv gmp-$RENAMED_GMP_VERSION gmp
tar -jxf ../mpfr-$MPFR_VERSION.tar.bz2
mv mpfr-$MPFR_VERSION mpfr
tar -zxf ../mpc-$MPC_VERSION.tar.gz
mv mpc-$MPC_VERSION mpc
patch -Np0 -i $HOME_DIR/getpagesize-gcc.patch
patch -Np0 -i $HOME_DIR/mpfr-impl.patch
patch -Np0 -i $HOME_DIR/libcpp-files.patch
patch -Np0 -i $HOME_DIR/libcpp-macro.patch
cd $GCC_BUILD_DIR
../gcc-$GCC_VERSION/configure \
--prefix=$PREFIX --host=$HOST --disable-option-checking --disable-ld \
--enable-shared --enable-languages=c \
--disable-bootstrap -disable-gold --disable-fortran --disable-libssp \
--disable-libquadmath --disable-libquadmath-support --disable-libada \
--disable-multilib --disable-libgomp --disable-cloog --disable-werror \
--with-sysroot=$SYSROOT --disable-nls --disable-long-long
make
sudo make install
Second, the actual error in question.
Code:
../../../gcc-4.9.0/gmp/mpz/powm_ui.c:162: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:228: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:149: error: undefined reference to '__gmpn_invert_limb'
divrem_2.c:91: error: undefined reference to '__gmpn_invert_limb'
collect2: error: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/jmanley/gcc-android-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/jmanley/gcc-android-build'
make: *** [all] Error 2
Now, some of the patchfiles I made to fix previous errors. Is any of this recommended?
Code:
*** libiberty/getpagesize.c 2005-03-27 07:31:13.000000000 -0800
--- getpagesize.c 2014-07-13 14:59:40.270231633 -0700
***************
*** 60,71 ****
# endif /* PAGESIZE */
#endif /* GNU_OUR_PAGESIZE */
- int
- getpagesize (void)
- {
- return (GNU_OUR_PAGESIZE);
- }
-
#else /* VMS */
#if 0 /* older distributions of gcc-vms are missing <syidef.h> */
--- 60,65 ----
Code:
*** libcpp/files.c 2014-01-02 14:24:45.000000000 -0800
--- files.c 2014-07-13 19:09:23.685783988 -0700
***************
*** 716,726 ****
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &file->st.st_size);
file->buffer_valid = true;
return true;
--- 716,728 ----
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
+ off_t ot = (off_t) file->st.st_size;
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &ot);
! file->st.st_size = ot;
file->buffer_valid = true;
return true;
Code:
*** libcpp/macro.c 2014-02-18 22:05:55.000000000 -0800
--- macro.c 2014-07-13 19:55:27.751477291 -0700
***************
*** 250,256 ****
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! tb = localtime (&st->st_mtime);
if (tb)
{
char *str = asctime (tb);
--- 250,260 ----
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! {
! time_t tt = (time_t) st->st_mtime;
! tb = localtime (&tt);
! st->st_mtime = tt;
! }
if (tb)
{
char *str = asctime (tb);
Code:
*** mpfr/src/mpfr-impl.h 2013-03-13 08:37:36.000000000 -0700
--- mpfr-impl.h 2014-07-13 18:44:36.599599742 -0700
***************
*** 1135,1142 ****
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT (localeconv()->decimal_point[0])
! #define MPFR_THOUSANDS_SEPARATOR (localeconv()->thousands_sep[0])
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')
--- 1135,1142 ----
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT ((char) '.')
! #define MPFR_THOUSANDS_SEPARATOR ('\0')
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')

Fix: CM-11 Philz/TWRP undefined reference to 'android::VectorImpl::finish_vector()'

To fix Philz-6.59.0 or TWRP-2.8.1.0 build error under CM-11.0 with the following output
system/core/include/utils/SortedVector.h:161: error: undefined reference to 'android::VectorImpl::finish_vector()'
Edit their respective files as shown below
Philz-Fix
=========
Edit: recovery-philz/Android.mk
-LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils liblog
+LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils liblog libutils
TWRP-Fix (libminuitwrp)
========
Edit: recovery-twrp/minuitwrp/Android.mk
-LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg libpng
+LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg libpng libutils
PS: This is my first post, if it helped you fix the problem please click the :good:

Error while compiling Kernel from source (Mediatek)

So I was compiling kernel for my Meizu m2 note and I encountered this error :
Code:
In file included from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/io.h:243:0,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/clocksource.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/clocksource/arm_arch_timer.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/arch_timer.h:27,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/timex.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timex.h:65,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/jiffies.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/ktime.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timer.h:5,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/workqueue.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/pm.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/device.h:25,
from drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:11:
/home/suvam/RRMM/kernel/meizu/m2note/include/asm-generic/iomap.h:31:21: note: expected 'void *' but argument is of type 'long unsigned int'
extern unsigned int ioread32(void __iomem *);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:99:26: warning: passing argument 1 of 'ioread32' makes pointer from integer without a cast
#define ISP_RD32(addr) ioread32(addr)
^
/home/suvam/RRMM/kernel/meizu/m2note/include/linux/printk.h:248:38: note: in expansion of macro 'ISP_RD32'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:87:37: note: in expansion of macro 'pr_debug'
#define LOG_DBG(format, args...) pr_debug(MyTag format, ##args)
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:10828:3: note: in expansion of macro 'LOG_DBG'
LOG_DBG("0x%08X %08X", (unsigned int)(ISP_TPIPE_ADDR + 0x00a8), (unsigned int)ISP_RD32(ISP_ADDR + 0x00a8));
^
In file included from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/io.h:243:0,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/clocksource.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/clocksource/arm_arch_timer.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/arch_timer.h:27,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/timex.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timex.h:65,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/jiffies.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/ktime.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timer.h:5,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/workqueue.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/pm.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/device.h:25,
from drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:11:
/home/suvam/RRMM/kernel/meizu/m2note/include/asm-generic/iomap.h:31:21: note: expected 'void *' but argument is of type 'long unsigned int'
extern unsigned int ioread32(void __iomem *);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: At top level:
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:175:22: warning: 'g_isp_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_isp_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:176:22: warning: 'g_isp_inner_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_isp_inner_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:177:22: warning: 'g_imgsys_config_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_imgsys_config_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'compat_put_isp_read_register_data':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:8407:6: warning: 'err' is used uninitialized in this function [-Wuninitialized]
err |= get_user(count, &data->Count);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'ISP_DONE_Buf_Time.isra.4':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:5522:49: warning: 'out' may be used uninitialized in this function [-Wmaybe-uninitialized]
pstRTBuf->ring_buf[i_dma].img_cnt = sof_count[out];
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'ISP_Buf_CTRL_FUNC':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:4447:34: warning: 'out' may be used uninitialized in this function [-Wmaybe-uninitialized]
deque_buf.sof_cnt = sof_count[out];
^
LD drivers/misc/mediatek/mach/mt6735/built-in.o
LD drivers/misc/mediatek/mach/built-in.o
make[4]: *** [drivers/misc/mediatek] Error 2
make[3]: *** [drivers/misc] Error 2
make[2]: *** [drivers] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/suvam/RRMM/kernel/meizu/m2note'
make: *** [TARGET_KERNEL_BINARIES] Error 2
#### make failed to build some targets (09:32 (mm:ss)) ####
Can somebody please help me out ?

[Resolved] Struct has no member named

So,
This error has been around like 5 days now.
Trying to compile aarch64 kernel which actually works if some drivers are disabled in defconfig, otherwise, they don't compile.
For example: arizona-core.c
Error message:
Code:
CC drivers/mfd/arizona-core.o
In file included from /home/nonta72/LP51/include/linux/kernel.h:13:0,
from /home/nonta72/LP51/include/linux/delay.h:10,
from /home/nonta72/LP51/drivers/mfd/arizona-core.c:13:
/home/nonta72/LP51/drivers/mfd/arizona-core.c: In function 'arizona_runtime_resume':
/home/nonta72/LP51/drivers/mfd/arizona-core.c:735:121: error: 'struct arizona_pdata' has no member named 'ldo_enable'
pr_debug("%s, ldo_enable=%d, ena_ldo=%d, reset=%d, i2c_addr=%d, irq_gpio=%d\n", __func__, gpio_get_value(arizona->pdata.ldo_enable),
^
/home/nonta72/LP51/include/linux/printk.h:246:38: note: in definition of macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
/home/nonta72/LP51/drivers/mfd/arizona-core.c:736:33: error: 'struct arizona_pdata' has no member named 'ena_ldo'
gpio_get_value(arizona->pdata.ena_ldo), gpio_get_value(arizona->pdata.reset),
^
/home/nonta72/LP51/include/linux/printk.h:246:38: note: in definition of macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
/home/nonta72/LP51/drivers/mfd/arizona-core.c:737:33: error: 'struct arizona_pdata' has no member named 'i2c_addr'
gpio_get_value(arizona->pdata.i2c_addr), gpio_get_value(arizona->pdata.irq_gpio));
^
/home/nonta72/LP51/include/linux/printk.h:246:38: note: in definition of macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
Driver : https://github.com/Nonta72/android_kernel_bq_msm8939/blob/cm-14.1/drivers/mfd/arizona-core.c
Solution:
In pdata.h file, find struct arizona_pdata and add this
Code:
int ldo_enable;
int ena_ldo;
int i2c_addr;

Build Aosp Extended on Ubuntu 18.04 (Bionic Beaver)

Build AOSP on ubuntu 18.04 Bionic Beaver
1. I suggest using screen when build so install it
sudo apt-get install screen
2. Add this line to /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu trusty main
3. Update repository list
sudo apt-get update
4. Install dependencies for building
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python
5. Setup git
git config --global user.name "your name"
git config --global user.email "your email"
6. Add repo path and enable ccache
nano ~/.bashrc
Add these lines to the bottom of bashrc
export PATH=~/bin:$PATH
export USE_CCACHE=1
export LC_ALL=C
Then to enable these use command
source ~/.bashrc
7. Make working directory
mkdir ~/android
cd ~/android
8. Initialise repo source (In this example we will use AospExtended Oreo )
repo init -u git://github.com/AospExtended/manifest.git -b 8.1.x
9. Sync repository (this could take a while depending on your internet connection, replace x with number of cores available remember to leave some free for system processes)
repo sync -c -jx --force-sync --no-clone-bundle --no-tags
10. Configure how much drive space ccache can use (I recommend 25-30gb)
prebuilts/misc/linux-x86/ccache/ccache -M 25G
11. Configure how much ram Jacks server can use (I recommend at least 8gb but the more resources you use the faster it will build)
export ANDROID_JACK_VM_ARGS="-Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
13. Build Initialise
. build/envsetup.sh
lunch aosp_devicename-userdebug
An example for Xiaomi Mi Max 2 codename (oxygen)
lunch aosp_oxygen-userdebug
14. Then to start building (replace x with available cores again the more cores made available the quicker it will compile)
make aex -jx
eva0034 said:
Build AOSP on ubuntu 18.04 Bionic Beaver
1. I suggest using screen when build so install it
sudo apt-get install screen
2. Add this line to /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu trusty main
3. Update repository list
sudo apt-get update
4. Install dependencies for building
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python
5. Setup git
git config --global user.name "your name"
git config --global user.email "your email"
6. Add repo path and enable ccache
nano ~/.bashrc
Add these lines to the bottom of bashrc
export PATH=~/bin:$PATH
export USE_CCACHE=1
Then to enable these use command
source ~/.bashrc
7. Make working directory
mkdir ~/android
cd ~/android
8. Initialise repo source (In this example we will use AospExtended Oreo )
repo init -u git://github.com/AospExtended/manifest.git -b 8.1.x
9. Sync repository (this could take a while depending on your internet connection, replace x with number of cores available remember to leave some free for system processes)
repo sync -c -jx --force-sync --no-clone-bundle --no-tags
10. Configure how much drive space ccache can use (I recommend 25-30gb)
prebuilts/misc/linux-x86/ccache/ccache -M 25G
11. Configure how much ram Jacks server can use (I recommend at least 8gb but the more resources you use the faster it will build)
export ANDROID_JACK_VM_ARGS="-Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
13. Build Initialise
. build/envsetup.sh
lunch aosp_devicename-userdebug
An example for Xiaomi Mi Max 2 codename (oxygen)
lunch aosp_oxygen-userdebug
14. Then to start building (replace x with available cores again the more cores made available the quicker it will compile)
make aex -jx
Click to expand...
Click to collapse
If you wish to use with another rom this guide add
Code:
sudo apt install selinux
.
If you get an error mentioning STATIC_LIBRARIES/libedify_intermediates/lexer.cpp make sure to also add
"export LC_ALL=C"
in your ~/.bashrc file.
@eva0034 I followed this guide but instead i replaced repo init 8.1.x with 7.1.1 because my device only has nougat support. I get stuck in repository sync at 99% every time. When I abort it shows failure to fetch snapdragon camera.
I posted on aex telegram and they advised me to delete snapdragon camera in repo/manifest xml.
I can't find this folder or file anywhere. Any idea?
undeclared identifiers n7100 build
what do i need to do to fix the errors below?
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:489:17: error: use of undeclared identifier 'GRALLOC_USAGE_YUV_ADDR'
if (usage & GRALLOC_USAGE_YUV_ADDR) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:87: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:97: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:107: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:454:49: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_lock(gralloc_module_t const* module, buffer_handle_t handle,
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:505:51: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_unlock(gralloc_module_t const* module, buffer_handle_t handle)
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:89: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:99: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:109: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:580:52: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_getphys(gralloc_module_t const* module, buffer_handle_t handle, void** paddr)
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:593:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
open: gralloc_device_open
^~~~~
.open =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:598:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
base:
^~~~~
.base =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:600:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
common:
^~~~~~~
.common =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:602:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
tag: HARDWARE_MODULE_TAG,
^~~~
.tag =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:603:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
version_major: 1,
^~~~~~~~~~~~~~
.module_api_version =
hardware/libhardware/include/hardware/hardware.h:114:23: note: expanded from macro 'version_major'
#define version_major module_api_version
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:604:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
version_minor: 0,
^~~~~~~~~~~~~~
.hal_api_version =
hardware/libhardware/include/hardware/hardware.h:132:23: note: expanded from macro 'version_minor'
#define version_minor hal_api_version
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:605:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
id: GRALLOC_HARDWARE_MODULE_ID,
^~~
.id =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:606:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
name: "Graphics Memory Allocator Module",
^~~~~
.name =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:607:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
author: "ARM Ltd.",
^~~~~~~
.author =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:608:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
methods: &gralloc_module_methods,
^~~~~~~~
.methods =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:609:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
dso: NULL,
^~~~
.dso =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:610:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
reserved : {0,},
^~~~~~~~~~
.reserved =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:612:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
registerBuffer: gralloc_register_buffer,
^~~~~~~~~~~~~~~
.registerBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:613:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
unregisterBuffer: gralloc_unregister_buffer,
^~~~~~~~~~~~~~~~~
.unregisterBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:614:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock: gralloc_lock,
^~~~~
.lock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:615:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
unlock: gralloc_unlock,
^~~~~~~
.unlock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:616:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
getphys: gralloc_getphys,
^~~~~~~~
.getphys =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:617:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
perform: NULL,
^~~~~~~~
.perform =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:618:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock_ycbcr: NULL,
^~~~~~~~~~~
.lock_ycbcr =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:620:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
framebuffer: NULL,
^~~~~~~~~~~~
.framebuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:621:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
flags: 0,
^~~~~~
.flags =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:622:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
numBuffers: 0,
^~~~~~~~~~~
.numBuffers =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:623:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
bufferMask: 0,
^~~~~~~~~~~
.bufferMask =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:624:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock: PTHREAD_MUTEX_INITIALIZER,
^~~~~
.lock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:625:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
currentBuffer: NULL,
^~~~~~~~~~~~~~
.currentBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:626:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
ion_client: -1,
^~~~~~~~~~~
.ion_client =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:616:9: error: field designator 'getphys' does not refer to any field in type 'gralloc_module_t'
getphys: gralloc_getphys,
^
42 warnings and 2 errors generated.
[ 0% 20/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/NOTICE_FILES/src/system/lib/liblights_helper.a.txt
Notice file: hardware/samsung/liblights/NOTICE -- /home/shaun/Desktop/android/out/target/product/n7100/obj/NOTICE_FILES/src/system/lib/liblights_helper.a.txt
[ 0% 21/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/link_type
Check module type: /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/link_type
[ 0% 22/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o
FAILED: /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o
/bin/bash -c "(echo "target thumb C++: gralloc.exynos4 <= hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp" ) && (mkdir -p /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/ ) && (PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++ -I device/samsung/smdk4412-common/include -I device/samsung/n7100/include -I bionic/libc/include -I hardware/samsung/exynos4/hal/libgralloc_ump/../include -I hardware/samsung/exynos4/hal/libgralloc_ump -I /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates -I /home/shaun/Desktop/android/out/target/product/n7100/gen/SHARED_LIBRARIES/gralloc.exynos4_intermediates -I libnativehelper/include_deprecated \$(cat /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/import_includes) -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem /home/shaun/Desktop/android/out/target/product/n7100/obj/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -DNDEBUG -g -Wstrict-aliasing=2 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=\$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -msoft-float -mfloat-abi=softfp -mfpu=neon -march=armv7-a -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -fvisibility-inlines-hidden -std=gnu++14 -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-rtti -DLOG_TAG=\"gralloc\" -DSAMSUNG_EXYNOS -DSAMSUNG_EXYNOS_CACHE_UMP -DUSE_PARTIAL_FLUSH -DSAMSUNG_EXYNOS4x12 -fPIC -D_USING_LIBCXX -DANDROID_STRICT -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.d -o /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp )"
target thumb C++: gralloc.exynos4 <= hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp
In file included from hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:30:
bionic/libc/include/string.h:164:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct __bionic_zero_size_is_okay_t {};
^
In file included from hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:41:
hardware/samsung/exynos4/hal/libgralloc_ump/../include/gralloc_priv.h:169:5: warning: field 'ion_client' will be initialized after field 'yaddr' [-Wreorder]
ion_client(0),
^
hardware/samsung/exynos4/hal/libgralloc_ump/../include/gralloc_priv.h:198:5: warning: field 'ion_client' will be initialized after field 'yaddr' [-Wreorder]
ion_client(0),
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:118:17: error: use of undeclared identifier 'GRALLOC_USAGE_HW_FIMC1'; did you mean 'GRALLOC_USAGE_HW_FB'?
if (usage & GRALLOC_USAGE_HW_FIMC1) {
^~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_HW_FB
hardware/libhardware/include/hardware/gralloc.h:96:5: note: 'GRALLOC_USAGE_HW_FB' declared here
GRALLOC_USAGE_HW_FB = 0x00001000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:196:37: error: use of undeclared identifier 'GRALLOC_USAGE_HWC_HWOVERLAY'
if ( (usage < 0 || usage & (GRALLOC_USAGE_HWC_HWOVERLAY | GRALLOC_USAGE_HW_FIMC1)) &&
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:196:67: error: use of undeclared identifier 'GRALLOC_USAGE_HW_FIMC1'; did you mean 'GRALLOC_USAGE_HW_FB'?
if ( (usage < 0 || usage & (GRALLOC_USAGE_HWC_HWOVERLAY | GRALLOC_USAGE_HW_FIMC1)) &&
^~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_HW_FB
hardware/libhardware/include/hardware/gralloc.h:96:5: note: 'GRALLOC_USAGE_HW_FB' declared here
GRALLOC_USAGE_HW_FB = 0x00001000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:199:25: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:208:25: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:234:86: warning: format specifies type 'unsigned int' but the argument has type 'private_handle_t *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s hnd=%x paddr=%x yaddr=%x offset=%x", __func__, hnd, current_address, gReservedMemSize, buffer_offset);
~~ ^~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:238:17: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (usage & GRALLOC_USAGE_HW_ION) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:248:34: error: use of undeclared identifier 'GRALLOC_USAGE_HWC_HWOVERLAY'
if (usage < 0 || usage & GRALLOC_USAGE_HWC_HWOVERLAY )
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:259:21: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:275:21: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:507:29: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (!(l_usage & GRALLOC_USAGE_HW_ION)) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:508:28: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
l_usage |= GRALLOC_USAGE_HW_ION; // Exynos HWC wants ION-friendly memory allocation
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:512:29: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (!(l_usage & GRALLOC_USAGE_PRIVATE_NONECACHE)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:513:28: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
l_usage |= GRALLOC_USAGE_PRIVATE_NONECACHE; // Exynos HWC wants ION-friendly memory allocation
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:525:24: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
l_usage |= GRALLOC_USAGE_HW_ION;
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:553:27: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (l_usage & GRALLOC_USAGE_HW_ION)
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:570:27: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (l_usage & GRALLOC_USAGE_HW_ION)
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:664:62: warning: unused parameter 'name' [-Wunused-parameter]
int alloc_device_open(hw_module_t const* module, const char* name, hw_device_t** device)
^
5 warnings and 16 errors generated.
[ 0% 23/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/STATIC_LIBRARIES/liblights_helper_intermediates/lights_helper.o
target thumb C: liblights_helper <= hardware/samsung/liblights/lights_helper.c
[ 0% 24/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/lights.o
target thumb C: lights.smdk4x12 <= hardware/samsung/liblights/lights.c
[ 0% 25/63617] build setup-jack-server
Ensuring Jack server is installed and started
Jack server already installed in "/home/shaun/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/shaun/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
[ 0% 26/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/KERNEL_OBJ/.config
Building Kernel Config
make: Entering directory '/home/shaun/Desktop/android/kernel/samsung/smdk4412'
GEN /home/shaun/Desktop/android/out/target/product/n7100/obj/KERNEL_OBJ/Makefile
arch/arm/mach-exynos/Kconfig:875:warning: choice value used outside its choice group
arch/arm/mach-exynos/Kconfig:877:warning: defaults for choice values not supported
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_U1 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects LINK_DEVICE_HSIC which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects UMTS_MODEM_XMM6262 which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (ARM) selects SECCOMP_FILTER which has unmet direct dependencies (HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET)
warning: (ARM) selects SECCOMP_FILTER which has unmet direct dependencies (HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_U1 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects LINK_DEVICE_HSIC which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects UMTS_MODEM_XMM6262 which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
#
Can someone tell me what step am i missing. I didn't get a shot of the vendor, it was done on another screen but it was from the Muppets git lge same branch. Thanks.
Samia Palos said:
If you wish to use with another rom this guide add
Code:
sudo apt install selinux
.
Click to expand...
Click to collapse
this caused to my machine to hang at ubuntu screen at reboot. I entered recovery mode and used sudo apt-get remove selinux but it still hangs.
any idea?
Airtioteclint said:
this caused to my machine to hang at ubuntu screen at reboot. I entered recovery mode and used sudo apt-get remove selinux but it still hangs.
any idea?
Click to expand...
Click to collapse
Don't actually install SELinux. You can build other ROMs just fine without it. (I have only really tried Lineage and Dirty Unicorns though.
Hey there eva0034. I appreciate you writing this up for people!
I attempted using this method for the Galaxy S6 (zerofltexx) but ran in to this hurdle when attempting to lunch.
Code:
[SIZE="3"][COLOR="seagreen"][email protected]:~/android$ lunch aosp_zerofltexx-userdebug[/COLOR]
vendor/aosp/config/bootanimation.mk:28: Target bootanimation res is undefined, using generic bootanimation
Looking for dependencies
Traceback (most recent call last):
File "build/tools/roomservice.py", line 368, in <module>
main()
File "build/tools/roomservice.py", line 312, in main
fetch_dependencies(repo_path)
File "build/tools/roomservice.py", line 225, in fetch_dependencies
dependencies = json.load(dep_f)
File "/usr/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 7 column 5 (char 123)[/SIZE]
These are the trees that I am using:
Code:
[SIZE="3"][COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_device_samsung_zerofltexx.git -b nx-8.1 device/samsung/zerofltexx[/COLOR]
Cloning into 'device/samsung/zerofltexx'...
remote: Counting objects: 389, done.
remote: Total 389 (delta 0), reused 0 (delta 0), pack-reused 389
Receiving objects: 100% (389/389), 8.31 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (220/220), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_device_samsung_zero-common.git -b nx-8.1 device/samsung/zero-common[/COLOR]
Cloning into 'device/samsung/zero-common'...
remote: Counting objects: 11826, done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 11826 (delta 58), reused 94 (delta 51), pack-reused 11683
Receiving objects: 100% (11826/11826), 21.12 MiB | 6.67 MiB/s, done.
Resolving deltas: 100% (7040/7040), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_kernel_samsung_exynos7420.git -b nx-8.1 kernel/samsung/exynos7420[/COLOR]
Cloning into 'kernel/samsung/exynos7420'...
remote: Counting objects: 5141645, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 5141645 (delta 20), reused 19 (delta 10), pack-reused 5141592
Receiving objects: 100% (5141645/5141645), 1.24 GiB | 9.76 MiB/s, done.
Resolving deltas: 100% (4260989/4260989), done.
Checking out files: 100% (48940/48940), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_vendor_samsung_zero-common.git -b nx-8.1 vendor/samsung/zero-common[/COLOR]
Cloning into 'vendor/samsung/zero-common'...
remote: Counting objects: 2106, done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 2106 (delta 27), reused 48 (delta 14), pack-reused 2031
Receiving objects: 100% (2106/2106), 116.09 MiB | 9.64 MiB/s, done.
Resolving deltas: 100% (1151/1151), done.
Checking out files: 100% (486/486), done.
[/SIZE]
And this is what it looks like when I run the envsetup.sh:
Code:
[SIZE="3"][COLOR="SeaGreen"][email protected]:~/android$ . build/envsetup.sh[/COLOR]
including device/samsung/zerofltexx/vendorsetup.sh
including vendor/aosp/vendorsetup.sh
including sdk/bash_completion/adb.bash[/SIZE]
Wondering if you or anybody else has any ideas as to how to solve this? Do I have to add something to "aex_manifest.xml" in local_manifests perhaps? Thank you to anybody who may be able to help. Am new to this
Edit: Got past the above issues by using a roomservice.xml file and get to around 6% of actual compiling but it throws an error when it gets to building the kernel. I give up for now... too hard for my tiny brain
not doing anything after "make aex -j2"
It just show it at the bottom of the command line and does nothing
Thanks
Shmart1 said:
It just show it at the bottom of the command line and does nothing
Click to expand...
Click to collapse
Maybe if you typed the proper command it might work
Finally to build:
. build/envsetup.sh
lunch aosp_device_codename-userdebug
mka aex -jx
Can someone tell me how to install vendor tree and kernel? i use A605K device, and i researched a bit.
but i still don't know how to install kernel tree and vendor tree. i know device tree and common tree can be installed by put device name folder in sourcefolder/devices folder, and how can i build vendor tree and kernel tree?
tmvkrpxl0 said:
Can someone tell me how to install vendor tree and kernel? i use A605K device, and i researched a bit.
but i still don't know how to install kernel tree and vendor tree. i know device tree and common tree can be installed by put device name folder in sourcefolder/devices folder, and how can i build vendor tree and kernel tree?
Click to expand...
Click to collapse
Since there is no current developer for your device, you are going to have to do create all the trees and kernel all by yourself..
Where the android source code is stored in ubuntu 18.10?
---------- Post added at 08:03 PM ---------- Previous post was at 07:37 PM ----------
aoleary said:
Since there is no current developer for your device, you are going to have to do create all the trees and kernel all by yourself..
Click to expand...
Click to collapse
Can someone tell me where the android source code is stored in ubuntu 18.10?
Vladut123 said:
Where the android source code is stored in ubuntu 18.10?
---------- Post added at 08:03 PM ---------- Previous post was at 07:37 PM ----------
Can someone tell me where the android source code is stored in ubuntu 18.10?
Click to expand...
Click to collapse
You have to press Ctrl+H to see the repo folder
Sent from my [device_name] using XDA-Developers Legacy app
eva0034 said:
Build AOSP on ubuntu 18.04 Bionic Beaver
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
Click to expand...
Click to collapse
can you tell more about these steps. For example, where I should download Kernel tree, to which directory? Or where I should download device tree and other components that you mention?
https://github.com/kegang0619/androi...msung_j5y17lte
https://github.com/kegang0619/androi...nos7870-common
Vendor tree:= https://github.com/kegang0619/android_vendor_samsung
Kernel Source:= https://github.com/kegang0619/FlareKernel_AOSP_V2
ROM Source:= https://github.com/AospExtended/plat...rameworks_base
Haste or Dogbin URL:=
https://del.dog/hixepifazo.rb
List Of Things You Have Tried To Do To Try And Resolve This Error:=
I'm building an AEX Oreo ROM. Here are the repositories I cloned https://github.com/kegang0619?tab=repositories
FAILED: TARGET_KERNEL_BINARIES
After a few searches, I thought that must be declared in the BoardConfig.mk of the device tree. But I couldn't figure out.
Any help would be appreciated.
What's the use of screen package?
I did the following but when i do make aex -j$(nproc) it gives this error
ninja: error: unknown target 'aex', did you mean 'dex'?

Categories

Resources